Hi ,
I have a test_1.c file which includes <camkes.h>
camkes.h which is automatically generated has following includes #include <camkes/dataport.h> #include <camkes/error.h> #include <stdint.h> #include <stdlib.h> #include <utils/util.h> #include <platsupport/io.h>
and another file
test_2.c which includes "socket.h"
In CMakeLists.txt, where I compile my test_1.c and test_2.c looks like this
DeclareCAmkESComponent(test INCLUDES "../muslibc/include/sys"* // necessary for compilation as test_2.c has "socket.h"* SOURCES "test_1.c" "test_2.c" C_FLAGS -Wall -Werror LIBS seos_libs )
However when I compile , I start getting these errors:
In file included from ../projects/util_libs/libplatsupport/include/platsupport/io.h:20:0, from projects/test/include/camkes.h:20, from ../projects/src/test_1.c:8: ../projects/musllibc/include/sys/errno.h:1:2: error: #warning redirecting incorrect #include <sys/errno.h> to <errno.h> [-Werror=cpp] *#warning redirecting incorrect #include <sys/errno.h> to <errno.h>*
^~~~~~~ In file included from ../projects/musllibc/include/sys/errno.h:2:0, from ../projects/util_libs/libplatsupport/include/platsupport/io.h:20, from projects/test/include/camkes.h:20, from ../projects/src/test_1.c:8: ../projects/musllibc/include/sys/errno.h:1:2: error: #warning redirecting incorrect #include <sys/errno.h> to <errno.h> [-Werror=cpp] #warning redirecting incorrect #include <sys/errno.h> to <errno.h>
How could this be solved ?
thanks --yk
"yogidk" == yogidk yogidk@gmail.com writes:
yogidk> and another file
yogidk> test_2.c which includes "socket.h"
yogidk> DeclareCAmkESComponent(test yogidk> INCLUDES "../muslibc/include/sys"* // necessary for yogidk> compilation as test_2.c has "socket.h"*
This line means that "#include <errno.h>" picks up sys/errno.h instead of errno.h.
Get rid of it. Instead, do '#include <sys/socket.h> instead of '#include <socket.h>'
Peter C -- Dr Peter Chubb Tel: +61 2 9490 5852 http://ts.data61.csiro.au/ Trustworthy Systems Group Data61, CSIRO (formerly NICTA)
"../muslibc/include/sys" // necessary for compilation as test_2.c has "socket.h"
This line shouldn't be here, and instead socket.h should be included via <sys/socket.h>. Otherwise many other include directives are going to match on the incorrect files.
Kent. ________________________________ From: Devel devel-bounces@sel4.systems on behalf of Chubb, Peter (Data61, Kensington NSW) Peter.Chubb@data61.csiro.au Sent: Friday, 14 June 2019 8:03 AM To: yogidk . Cc: devel@sel4.systems Subject: Re: [seL4] camkes error.h include problem
"yogidk" == yogidk yogidk@gmail.com writes:
yogidk> and another file
yogidk> test_2.c which includes "socket.h"
yogidk> DeclareCAmkESComponent(test yogidk> INCLUDES "../muslibc/include/sys"* // necessary for yogidk> compilation as test_2.c has "socket.h"*
This line means that "#include <errno.h>" picks up sys/errno.h instead of errno.h.
Get rid of it. Instead, do '#include <sys/socket.h> instead of '#include <socket.h>'
Peter C -- Dr Peter Chubb Tel: +61 2 9490 5852 http://ts.data61.csiro.au/ Trustworthy Systems Group Data61, CSIRO (formerly NICTA) _______________________________________________ Devel mailing list Devel@sel4.systems https://sel4.systems/lists/listinfo/devel