I am trying to use an open source SDK in VS Code and for some reason I can’t compile. Hopefully this will be very easy to answer.
I always get this error: test.c:22:10: fatal error: linphone/core.h: No such file or directory 22 | #include "linphone/core.h"
My code is extremely simple:
#include "linphone/core.h"
#include <signal.h>
-
I am using VS Code through SSH on a remote Ubuntu machine.
-
Most libraries depend on other libraries in the FOSS project, so I would really want to add the whole folder and it’s sub-folders as dependency.
-
The project tree looks like this:
MyProject
|_ linphone-sdk
| |_ include
| |_ linphone
| | |_ core.h
| |_ mediastreamer2
| | |_ bitratecontrol.h
| |_ a bunch of other folders
|_ helloworld.c -
I tried compiling with gcc manually and it didn’t work.
gcc test.c -o test -I/linphone-sdk/include/linphone/core.h
or evengcc test.c -o test -I/home/user/Documents/MyProject/linphone-sdk/include/linphone/core.h
-
I modified tasks.json in a similar way as manually calling gcc
-
The only way I can get the library to “work” is by doing
#include "linphone-sdk/include/linphone/core.h"
instead of"linphone/core.h"
but then I get errors likepath/to/my/project/linphone-sdk/include/linphone/core.h:24:10: fatal error: mediastreamer2/bitratecontrol.h: No such file or directory
which is what I would expect (see project tree).
There is probably a better way to get it to work than changing every include one by one until it works, right?