Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on Ubuntu 24.04 #93

Open
m4caque opened this issue Jun 25, 2024 · 0 comments
Open

Build fails on Ubuntu 24.04 #93

m4caque opened this issue Jun 25, 2024 · 0 comments

Comments

@m4caque
Copy link

m4caque commented Jun 25, 2024

Building latest source fails on Ubuntu with errors:

TRObject.m:51:1: warning: class ‘TRObject’ defined without specifying a base class [-Wobjc-root-class]
   51 | + (id) alloc {
      | ^
TRObject.m: In function ‘-[TRObject isKindOfClass:]’:
TRObject.m:106:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
  106 |     for (Class superClass = selfClass; superClass != NULL; superClass = class_getSuperclass(superClass)) {
      |     ^~~
TRObject.m:106:5: note: use option ‘-std=c99’, ‘-std=gnu99’, ‘-std=c11’ or ‘-std=gnu11’ to compile your code
make[1]: *** [../Mk/compile.mk:6: TRObject.o] Error 1

And later in the build:

PXTestCaseRunner.m: In function ‘-[PXTestCaseRunner runAllCases]’:
PXTestCaseRunner.m:82:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
   82 |     for (int i = 0; i < numClasses; i++) {
      |     ^~~
PXTestCaseRunner.m:82:5: note: use option ‘-std=c99’, ‘-std=gnu99’, ‘-std=c11’ or ‘-std=gnu11’ to compile your code
PXTestCaseRunner.m: In function ‘-[PXTestCaseRunner runCase:]’:
PXTestCaseRunner.m:132:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
  132 |     for (unsigned int i = 0; i < methodCount; i++) {
      |     ^~~
make[1]: *** [../Mk/compile.mk:6: PXTestCaseRunner.o] Error 1

Appending the flag "-std=gnu99" to OBJCFLAGS in both src/Makefile and tests/Makefile allows the build to finish successfully, e.g.:
OBJCFLAGS+= $(LDAP_CFLAGS) $(OPENVPN_CFLAGS) -std=gnu99

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant