05-14-2012 08:00 AM
Hi all
I am trying to integrate json parser in my BB10 native project. The codes are taken from here
https://github.com/blackberry/JSON_parser/
I copied the JSON_parser.h and JSON_parser.c file into the source directory. In the HelloCascadesApp.cpp i have included the header file.
Now when compiling the project, i get error as
undefined reference to `init_JSON_config'
This is the compiler output
**** Build of configuration Simulator-Debug for project another **** make Simulator-Debug d:/bbndk-10.0.4-beta/host/win32/x86/usr/bin/qmake -spec unsupported/blackberry-armv7le-g++ -o arm/Makefile another.pro CONFIG+=device d:/bbndk-10.0.4-beta/host/win32/x86/usr/bin/qmake -spec unsupported/blackberry-x86-g++ -o x86/Makefile another.pro CONFIG+=simulator make -C ./translations -f Makefile update release make[1]: Entering directory `C:/ndk-10.0.4-workspace/another/translations' d:/bbndk-10.0.4-beta/host/win32/x86/usr/bin/lupdate another.pro Updating 'another_en_GB.ts'... Found 0 source text(s) (0 new and 0 already existing) Updating 'another_fr.ts'... Found 0 source text(s) (0 new and 0 already existing) Updating 'another_it.ts'... Found 0 source text(s) (0 new and 0 already existing) Updating 'another_de.ts'... Found 0 source text(s) (0 new and 0 already existing) Updating 'another_es.ts'... Found 0 source text(s) (0 new and 0 already existing) Updating 'another.ts'... Found 0 source text(s) (0 new and 0 already existing) d:/bbndk-10.0.4-beta/host/win32/x86/usr/bin/lrelea se another.pro Could not find qmake configuration directoryCould not read qmake configuration file D:/bbndk-10.0.4-beta/target/qnx6/usr/share/qt4/mks pecs/qmake.confUsing OS scope before setting MAKEFILE_GENERATORD:/bbndk-10.0.4-beta/target/qnx6 /usr/share/qt4/mkspecs/features/debug_and_release. prf(1): Using OS scope before setting MAKEFILE_GENERATORD:/bbndk-10.0.4-beta/target/qnx6 /usr/share/qt4/mkspecs/features/qt.prf(4): Using OS scope before setting MAKEFILE_GENERATORD:/bbndk-10.0.4-beta/target/qnx6 /usr/share/qt4/mkspecs/features/qt.prf(36): Using OS scope before setting MAKEFILE_GENERATORD:/bbndk-10.0.4-beta/target/qnx6 /usr/share/qt4/mkspecs/features/qt.prf(197): 'qtAddLibrary' is not a recognized test functionD:/bbndk-10.0.4-beta/target/qnx6/usr/share /qt4/mkspecs/features/qt.prf(197): 'qtAddLibrary' is not a recognized test functionD:/bbndk-10.0.4-beta/target/qnx6/usr/share /qt4/mkspecs/features/qt.prf(197): 'qtAddLibrary' is not a recognized test functionD:/bbndk-10.0.4-beta/target/qnx6/usr/share /qt4/mkspecs/features/qt.prf(197): 'qtAddLibrary' is not a recognized test functionD:/bbndk-10.0.4-beta/target/qnx6/usr/share /qt4/mkspecs/features/qt.prf(197): 'qtAddLibrary' is not a recognized test functionD:/bbndk-10.0.4-beta/target/qnx6/usr/share /qt4/mkspecs/features/qt.prf(197): 'qtAddLibrary' is not a recognized test functionD:/bbndk-10.0.4-beta/target/qnx6/usr/share /qt4/mkspecs/features/qt.prf(197): 'qtAddLibrary' is not a recognized test functionD:/bbndk-10.0.4-beta/target/qnx6/usr/share /qt4/mkspecs/features/qt.prf(213): Using OS scope before setting MAKEFILE_GENERATORD:/bbndk-10.0.4-beta/target/qnx6 /usr/share/qt4/mkspecs/features/moc.prf(3): 'qtPrepareTool' is not a recognized test functionD:/bbndk-10.0.4-beta/target/qnx6/usr/share /qt4/mkspecs/features/moc.prf(12): Using OS scope before setting MAKEFILE_GENERATORD:/bbndk-10.0.4-beta/target/qnx6 /usr/share/qt4/mkspecs/features/moc.prf(97): Using OS scope before setting MAKEFILE_GENERATORD:/bbndk-10.0.4-beta/target/qnx6 /usr/share/qt4/mkspecs/features/uic.prf(108): Using OS scope before setting MAKEFILE_GENERATORThe directory name is invalid. Updating 'C:/ndk-10.0.4-workspace/another/translations/anot her_en_GB.qm'... Generated 0 translation(s) (0 finished and 0 unfinished) Updating 'C:/ndk-10.0.4-workspace/another/translations/anot her_fr.qm'... Generated 0 translation(s) (0 finished and 0 unfinished) Updating 'C:/ndk-10.0.4-workspace/another/translations/anot her_it.qm'... Generated 0 translation(s) (0 finished and 0 unfinished) Updating 'C:/ndk-10.0.4-workspace/another/translations/anot her_de.qm'... Generated 0 translation(s) (0 finished and 0 unfinished) Updating 'C:/ndk-10.0.4-workspace/another/translations/anot her_es.qm'... Generated 0 translation(s) (0 finished and 0 unfinished) Updating 'C:/ndk-10.0.4-workspace/another/translations/anot her.qm'... Generated 0 translation(s) (0 finished and 0 unfinished) make[1]: Leaving directory `C:/ndk-10.0.4-workspace/another/translations' make -C ./x86 -f Makefile debug make[1]: Entering directory `C:/ndk-10.0.4-workspace/another/x86' make -f Makefile.Debug make[2]: Entering directory `C:/ndk-10.0.4-workspace/another/x86' qcc -Vgcc_ntox86 -lang-c++ -Wl,-rpath-link,d:/bbndk-10.0.4-beta/target/qnx6/x 86/lib -Wl,-rpath-link,d:/bbndk-10.0.4-beta/target/qnx6/x 86/usr/lib -o o-g/another o-g/.obj/hellocascades.o o-g/.obj/HelloCascadesApp.o o-g/.obj/moc_HelloCascadesApp.o -lcurl -Ld:/bbndk-10.0.4-beta/target/qnx6/x86/lib -Ld:/bbndk-10.0.4-beta/target/qnx6/x86/usr/lib -Ld:/bbndk-10.0.4-beta/target/qnx6/x86/usr/lib/qt4 /lib -LD:/bbndk-10.0.4-beta/target/qnx6/x86/usr/lib/qt4 /lib -lm -lbps -lbb -lQtCascades -lQtDeclarative -lQtScript -lQtSvg -lQtSql -lQtXmlPatterns -lQtXml -lQtGui -lQtNetwork -lQtCore Could not find qmake configuration directoryCould not find qmake configuration fileUsing OS scope before setting MAKEFILE_GENERATORo-g/.obj/HelloCascadesApp.o: In function `parse_JSON': C:\ndk-10.0.4-workspace\another\x86/../src/HelloCa scadesApp.cpp:216: undefined reference to `init_JSON_config' C:\ndk-10.0.4-workspace\another\x86/../src/HelloCa scadesApp.cpp:224: undefined reference to `new_JSON_parser' cc: d:/bbndk-10.0.4-beta/host/win32/x86/usr/bin/ntox86 -ld caught signal 1 make[2]: *** [o-g/another] Error 1 make[2]: Leaving directory `C:/ndk-10.0.4-workspace/another/x86' make[1]: Leaving directory `C:/ndk-10.0.4-workspace/another/x86' make[1]: *** [debug] Error 2 make: *** [Simulator-Debug] Error 2 **** Build Finished ****
I used this json parser earlier in BB 2.0 NDK without any issues.
Can anyone help me out?
regards
Solved! Go to Solution.
05-14-2012 10:38 AM
by default, c files are ignored, to add it, edit your {appname}.pro
and add either the singel file:
SOURCES += ../src/*.cpp ../src/JSON_parser.c
or all *.c files:
SOURCES += ../src/*.cpp ../src/*.c
05-14-2012 10:44 AM
@jamespaulmuir Thank you very very much. I was running here and there the whole day and finally was giving up. You showed me the light. Thank you again!!