Search code examples
cgccarmcross-compilingheader-files

libwebsockets.h - no such file or directory, Ubuntu, arm-linux-gcc cross compiler


I am building a web server using the libwebsockets library on a TS-7800 board using the arm-linux-gcc cross compiler. Using Ubuntu. Installed CMake, OpenSSL, and libwebsockets and built the library per the instructions on Github.

I made a "hello world" C file which #includes libwebsockets.h When I compile the executable with gcc, it compiles fine and the .exe runs. When I compile with arm-linux-gcc, I get the following:

root@gordon-MS-7A39:/# arm-linux-gcc -o hellosockets /home/gordon/workspace/HelloCrossWorld/hello_cross.c
/home/gordon/workspace/HelloCrossWorld/hello_cross.c:3:27: libwebsockets.h: No such file or directory

It appears that arm-linux-gcc compiler cannot "see" the header file for libwebsockets. I'm guessing that the installation of the websockets library was successful because gcc can see it.

How do I enable the arm cross compiler to see the libwebsockets.h file?

Thank you for your input!


Solution

  • I was unaware of the -I and -L preprocessor options for gcc and arm-linux-gcc. I was able to add libraries to the project and will look into creating makefiles for the project.