سؤال

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