문제

I'm trying to include and compile

#include <json/json.h>

However even though I've installed it and included it on the project settings it wouldn't find the path.

here's what I've so far done:

path to libjson:

 /usr/include/jsoncpp-src-0.5.0

options in eclipse gcc c++ compiler:

-Ijson_linux-gcc-4.5.2_libmt -O0 -g3 -Wall -c -fmessage-length=0 -ljson_linux-gcc-4.5.2_libmt

libraries in gcc c++ linker:

-L/usr/include/jsoncpp-src-0.5.0/include/

Anything else I forgot to do to make it work?

도움이 되었습니까?

해결책

try adding -I/usr/include/jsoncpp-src-0.5.0 to compiler options

다른 팁

-L indicates where to find shared libraries (e.g. .so)

-I is the search path for the header files.

If the problem occurs during compilation (json.h not found), then you have indicated the wrong -I

If it occurs during linking (symbol not found), then you have indicated a wrong -L, a wrong -l, or forgot to run ldconfig

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top