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

make problems with wakaama client #634

Closed
yan0727 opened this issue Oct 20, 2021 · 4 comments
Closed

make problems with wakaama client #634

yan0727 opened this issue Oct 20, 2021 · 4 comments
Labels

Comments

@yan0727
Copy link

yan0727 commented Oct 20, 2021

this is operate report:

                [root@IoT-Apps lwm2m]# make
                [  2%] Building C object CMakeFiles/lwm2mclient.dir/object_test.c.o
                /opt/wakaama/examples/client/object_test.c: In function ‘get_test_object’:
                /opt/wakaama/examples/client/object_test.c:562:13: error: ‘for’ loop initial declarations are only allowed in C99 mode
                             for (int j = 0; j <= i; j++) {
                             ^
                /opt/wakaama/examples/client/object_test.c:562:13: note: use option -std=c99 or -std=gnu99 to compile your code
                make[2]: *** [CMakeFiles/lwm2mclient.dir/object_test.c.o] Error 1
                make[1]: *** [CMakeFiles/lwm2mclient.dir/all] Error 2
                make: *** [all] Error 2
@mlasch
Copy link
Contributor

mlasch commented Oct 20, 2021

Hello @yan0727, can you be a bit more specific on which compiler you are using? I guess you are building with an old C-language version. You should use at least c99.
For reference, there is a discussion about which compiler versions are supported in Wakaama: #494

@yan0727
Copy link
Author

yan0727 commented Oct 21, 2021

@mlasch thanks for you reply, I'm using GCC version 4.8.5, support c99 mode, But I don't know why this is a problem.

@mlasch
Copy link
Contributor

mlasch commented Oct 26, 2021

Indeed, GCC 4.8.5 seems to support c99, but does not default to c99. Have you tried to use -DCMAKE_C_STANDARD=99 to explicitly set the c language version?

@rettichschnidi
Copy link
Contributor

Please reopen in case this is still a problem.

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

No branches or pull requests

3 participants