Is it possible to use the src files without compiling them to a library ?

515 views
Skip to first unread message

ftv.dev

unread,
Apr 25, 2012, 1:48:05 PM4/25/12
to Jansson users
I am trying to use Jansson C in a PowerPc machine but the problem that
I didn't succeded to compile it.

Is it possible to add just all the file in folder "jansson/src" to my
project and then compile the whole project ?

Petri Lehtinen

unread,
Apr 25, 2012, 1:58:16 PM4/25/12
to jansso...@googlegroups.com
Yes it is, but you need to rename jansson_config.h.in to
jansson_config.h and edit for your target system.

It should also be possible (and relatively easy) to cross-compile
Jansson using the cross toolchain provided by ELDK. This is usually
very straightforward in cross building environments. You should check
the documentation of ELDK on how to do it.

Petri

ftv.dev

unread,
Apr 25, 2012, 2:14:26 PM4/25/12
to Jansson users
I tried to do that (usin directly source files)
But i am getting a lot of errors:

This when using -Werror:
/bin/sh -ec 'ppc_85xx-gcc -DEZ_ENDIAN_BIG -DEZ_PCI_SWAP -pthread -
fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -I/home/
fakher/Bureau/EZdriver_NP_4_8.40a/host/env/include -I/home/fakher/
Bureau/EZdriver_NP_4_8.40a/host/vpci/include -I/home/fakher/Bureau/
EZdriver_NP_4_8.40a/host/driver/include -I/home/fakher/Bureau/
EZdriver_NP_4_8.40a/host/dev/include -I/home/fakher/Bureau/
EZdriver_NP_4_8.40a/host/cmd/include -I/home/fakher/Bureau/
EZdriver_NP_4_8.40a/host/parse/include -I/home/fakher/Bureau/
EZdriver_NP_4_8.40a/host/agent/include -I/home/fakher/Bureau/
EZdriver_NP_4_8.40a/host/mdbg/include -I/home/fakher/Bureau/
EZdriver_NP_4_8.40a/host/nl/include -I/home/fakher/Bureau/
EZdriver_NP_4_8.40a/host/tbs/include -I/home/fakher/Bureau/
EZdriver_NP_4_8.40a/samples/MdfStruct1/src/ -I/home/fakher/Bureau/
EZdriver_NP_4_8.40a/samples/MdfStruct1/src/scenarios -I/home/fakher/
Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/src/scr2c -I/home/
fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/src -I/home/
fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/src/jansson -I/
home/fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/src/
includes -I/home/fakher/Bureau/EZdriver_NP_4_8.40a/samples/
MdfStruct1/src/scr2c/BE -O2 -D_REENTRANT -DEZdevL_NOTE_LEVEL -W -Wall
-Werror -Wpointer-arith -Waggregate-return -Wcast-qual -Wchar-
subscripts -Wcomment -Wformat -Wimplicit -Winline -Wparentheses -
Wreturn-type -Wshadow -Wswitch -Wtrigraphs -Wuninitialized -Wno-unused
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-
declarations -Wnested-externs -Wno-pointer-sign -DEZ_OS_LINUX_USER -c
-o /home/fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/build/
linux/Obj_linux_ppc/dump.o /home/fakher/Bureau/EZdriver_NP_4_8.40a/
samples/MdfStruct1/src/jansson/dump.c'
cc1: warnings being treated as errors
/home/fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/src/jansson/
dump.c: In function 'do_dump':
/home/fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/src/jansson/
dump.c:218: warning: cast discards qualifiers from pointer target type
/home/fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/src/jansson/
dump.c:277: warning: cast discards qualifiers from pointer target type
/home/fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/src/jansson/
dump.c:282: warning: cast discards qualifiers from pointer target type
/home/fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/src/jansson/
dump.c:309: warning: cast discards qualifiers from pointer target type
/home/fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/src/jansson/
dump.c:365: warning: cast discards qualifiers from pointer target type
make: *** [dump.o] Erreur 1



And without -Werror:





/bin/sh -ec 'ppc_85xx-gcc -DEZ_ENDIAN_BIG -DEZ_PCI_SWAP -pthread -
fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -I/home/
fakher/Bureau/EZdriver_NP_4_8.40a/host/env/include -I/home/fakher/
Bureau/EZdriver_NP_4_8.40a/host/vpci/include -I/home/fakher/Bureau/
EZdriver_NP_4_8.40a/host/driver/include -I/home/fakher/Bureau/
EZdriver_NP_4_8.40a/host/dev/include -I/home/fakher/Bureau/
EZdriver_NP_4_8.40a/host/cmd/include -I/home/fakher/Bureau/
EZdriver_NP_4_8.40a/host/parse/include -I/home/fakher/Bureau/
EZdriver_NP_4_8.40a/host/agent/include -I/home/fakher/Bureau/
EZdriver_NP_4_8.40a/host/mdbg/include -I/home/fakher/Bureau/
EZdriver_NP_4_8.40a/host/nl/include -I/home/fakher/Bureau/
EZdriver_NP_4_8.40a/host/tbs/include -I/home/fakher/Bureau/
EZdriver_NP_4_8.40a/samples/MdfStruct1/src/ -I/home/fakher/Bureau/
EZdriver_NP_4_8.40a/samples/MdfStruct1/src/scenarios -I/home/fakher/
Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/src/scr2c -I/home/
fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/src -I/home/
fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/src/jansson -I/
home/fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/src/
includes -I/home/fakher/Bureau/EZdriver_NP_4_8.40a/samples/
MdfStruct1/src/scr2c/BE -O2 -D_REENTRANT -DEZdevL_NOTE_LEVEL -W -Wall
-Wpointer-arith -Waggregate-return -Wcast-qual -Wchar-subscripts -
Wcomment -Wformat -Wimplicit -Winline -Wparentheses -Wreturn-type -
Wshadow -Wswitch -Wtrigraphs -Wuninitialized -Wno-unused -Wwrite-
strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-
declarations -Wnested-externs -Wno-pointer-sign -DEZ_OS_LINUX_USER -c
-o /home/fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/build/
linux/Obj_linux_ppc/utf.o /home/fakher/Bureau/EZdriver_NP_4_8.40a/
samples/MdfStruct1/src/jansson/utf.c'
rm -f /home/fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/bin/
linux/EZahe_linux_ppc
cd /home/fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/build/
linux/Obj_linux_ppc; ppc_85xx-gcc EZaheNPsl.o EZaheConfig.o
EZaheAllToAll_MDF.o EZaheAllToAll_PRS.o EZaheAllToAll_RSV.o
EZaheAllToAll_SRC.o MdfStruct1.o AccessTable.o parser.o EZhost.o
dump.o error.o hashtable.o load.o memory.o pack_unpack.o strbuffer.o
strconv.o utf.o -Wl,-whole-archive /home/fakher/Bureau/
EZdriver_NP_4_8.40a/host/nl/bin/linux/EZnl_linux_ppc.a /home/fakher/
Bureau/EZdriver_NP_4_8.40a/host/tbs/bin/linux/EZtbs_linux_ppc.a /home/
fakher/Bureau/EZdriver_NP_4_8.40a/host/nl/bin/linux/
EZnlmxpt_linux_ppc.a /home/fakher/Bureau/EZdriver_NP_4_8.40a/host/nl/
bin/linux/EZnlmnp4xpt_linux_ppc.a /home/fakher/Bureau/
EZdriver_NP_4_8.40a/host/nl/bin/linux/EZnlmgenerictblmgr_linux_ppc.a /
home/fakher/Bureau/EZdriver_NP_4_8.40a/host/nl/bin/linux/
EZnlmcommon_linux_ppc.a /home/fakher/Bureau/EZdriver_NP_4_8.40a/host/
nl/bin/linux/EZnlm11kdevmgr_linux_ppc.a /home/fakher/Bureau/
EZdriver_NP_4_8.40a/host/env/bin/linux/EZenv_linux_ppc.a /home/
fakher/Bureau/EZdriver_NP_4_8.40a/host/vpci/bin/linux/
EZvpci_linux_ppc.a /home/fakher/Bureau/EZdriver_NP_4_8.40a/host/
driver/bin/linux/EZdriver_linux_ppc.a /home/fakher/Bureau/
EZdriver_NP_4_8.40a/host/dev/bin/linux/EZdev_linux_ppc.a /home/
fakher/Bureau/EZdriver_NP_4_8.40a/host/cmd/bin/linux/
EZcmd_linux_ppc.a /home/fakher/Bureau/EZdriver_NP_4_8.40a/host/parse/
bin/linux/EZparse_linux_ppc.a /home/fakher/Bureau/
EZdriver_NP_4_8.40a/host/agent/bin/linux/EZagent_linux_ppc.a /home/
fakher/Bureau/EZdriver_NP_4_8.40a/host/mdbg/bin/linux/
EZmdbg_linux_ppc.a -Wl,-no-whole-archive -lpthread -static -o /home/
fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/bin/linux/
EZahe_linux_ppc;
/home/fakher/Bureau/EZdriver_NP_4_8.40a/host/env/bin/linux/
EZenv_linux_ppc.a(EZosSocket.o): In function `EZosSocket_Connect':
EZosSocket.c:(.text+0x2f8): warning: Using 'gethostbyname' in
statically linked applications requires at runtime the shared
libraries from the glibc version used for linking
parser.o: In function `parseAction':
parser.c:(.text+0x48): undefined reference to `json_object_get'
parser.c:(.text+0x4c): undefined reference to `json_integer_value'
dump.o: In function `do_dump':
dump.c:(.text+0x548): undefined reference to `json_object_iter'
dump.c:(.text+0x5a8): undefined reference to `json_object_size'
dump.c:(.text+0x5dc): undefined reference to `json_object_iter_key'
dump.c:(.text+0x5f4): undefined reference to `json_object_iter_next'
dump.c:(.text+0x6a0): undefined reference to `json_object_get'
dump.c:(.text+0x728): undefined reference to `json_array_size'
dump.c:(.text+0x7e4): undefined reference to `json_array_get'
dump.c:(.text+0x81c): undefined reference to `json_string_value'
dump.c:(.text+0x834): undefined reference to `json_real_value'
dump.c:(.text+0x8c0): undefined reference to `json_integer_value'
dump.c:(.text+0x980): undefined reference to `json_object_iter_next'
dump.c:(.text+0x98c): undefined reference to `json_object_iter_key'
dump.c:(.text+0x9c0): undefined reference to `json_object_iter_value'
hashtable.o: In function `hashtable_do_clear':
hashtable.c:(.text+0x1f4): undefined reference to `json_delete'
hashtable.o: In function `hashtable_iter_set':
hashtable.c:(.text+0x50c): undefined reference to `json_delete'
hashtable.o: In function `hashtable_del':
hashtable.c:(.text+0x640): undefined reference to `json_delete'
hashtable.o: In function `hashtable_set':
hashtable.c:(.text+0x784): undefined reference to `json_delete'
load.o: In function `parse_value':
load.c:(.text+0x1174): undefined reference to `json_string_nocheck'
load.c:(.text+0x1210): undefined reference to `json_real'
load.c:(.text+0x124c): undefined reference to `json_null'
load.c:(.text+0x1288): undefined reference to `json_false'
load.c:(.text+0x12c4): undefined reference to `json_true'
load.c:(.text+0x1300): undefined reference to `json_object'
load.c:(.text+0x1354): undefined reference to `json_object_get'
load.c:(.text+0x13bc): undefined reference to
`json_object_set_new_nocheck'
load.c:(.text+0x1438): undefined reference to `json_array'
load.c:(.text+0x14cc): undefined reference to `json_array_append_new'
load.c:(.text+0x14f8): undefined reference to `json_delete'
load.c:(.text+0x1508): undefined reference to `json_integer'
load.c:(.text+0x1564): undefined reference to `json_delete'
load.c:(.text+0x158c): undefined reference to `json_delete'
load.c:(.text+0x1598): undefined reference to `json_delete'
load.o: In function `parse_json':
load.c:(.text+0x178c): undefined reference to `json_delete'
pack_unpack.o: In function `unpack':
pack_unpack.c:(.text+0x2c8): undefined reference to
`json_integer_value'
pack_unpack.c:(.text+0x32c): undefined reference to
`json_number_value'
pack_unpack.c:(.text+0x3f4): undefined reference to `json_object_get'
pack_unpack.c:(.text+0x418): undefined reference to `json_null'
pack_unpack.c:(.text+0x4e8): undefined reference to
`json_string_value'
pack_unpack.c:(.text+0x5f0): undefined reference to `json_real_value'
pack_unpack.c:(.text+0x650): undefined reference to
`json_integer_value'
pack_unpack.c:(.text+0x6e8): undefined reference to `json_array_size'
pack_unpack.c:(.text+0x6fc): undefined reference to `json_array_size'
pack_unpack.c:(.text+0x820): undefined reference to `json_array_get'
pack_unpack.c:(.text+0x970): undefined reference to `json_object_size'
pack_unpack.c:(.text+0x980): undefined reference to `json_object_size'
pack_unpack.o: In function `pack':
pack_unpack.c:(.text+0xeac): undefined reference to `json_integer'
pack_unpack.c:(.text+0xefc): undefined reference to `json_array'
pack_unpack.c:(.text+0xf24): undefined reference to
`json_array_append_new'
pack_unpack.c:(.text+0xf94): undefined reference to `json_delete'
pack_unpack.c:(.text+0xfc8): undefined reference to `json_true'
pack_unpack.c:(.text+0x100c): undefined reference to `json_real'
pack_unpack.c:(.text+0x1044): undefined reference to `json_integer'
pack_unpack.c:(.text+0x1050): undefined reference to `json_null'
pack_unpack.c:(.text+0x10c0): undefined reference to
`json_string_nocheck'
pack_unpack.c:(.text+0x10cc): undefined reference to `json_object'
pack_unpack.c:(.text+0x1134): undefined reference to
`json_object_set_new_nocheck'
pack_unpack.c:(.text+0x120c): undefined reference to `json_false'
pack_unpack.o: In function `json_vpack_ex':
pack_unpack.c:(.text+0x1448): undefined reference to `json_delete'
collect2: ld returned 1 exit status
make: *** [/home/fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/
bin/linux/EZahe_linux_ppc] Erreur 1

Petri Lehtinen

unread,
Apr 26, 2012, 1:49:36 AM4/26/12
to jansso...@googlegroups.com
ftv.dev wrote:
> I tried to do that (usin directly source files)
> But i am getting a lot of errors:
>
> This when using -Werror:
>
[snip]
>
> /home/fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/src/jansson/
> dump.c: In function 'do_dump':
> /home/fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/src/jansson/
> dump.c:218: warning: cast discards qualifiers from pointer target type
> /home/fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/src/jansson/
> dump.c:277: warning: cast discards qualifiers from pointer target type
> /home/fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/src/jansson/
> dump.c:282: warning: cast discards qualifiers from pointer target type
> /home/fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/src/jansson/
> dump.c:309: warning: cast discards qualifiers from pointer target type
> /home/fakher/Bureau/EZdriver_NP_4_8.40a/samples/MdfStruct1/src/jansson/
> dump.c:365: warning: cast discards qualifiers from pointer target type
> make: *** [dump.o] Erreur 1

You're passing the -Wcast-qual option to gcc, and that's why you see
these warnings. They are harmless, but quite unavoidable.

> And without -Werror:
>
[snip]
>
> parser.o: In function `parseAction':
> parser.c:(.text+0x48): undefined reference to `json_object_get'
> parser.c:(.text+0x4c): undefined reference to `json_integer_value'
> dump.o: In function `do_dump':
> dump.c:(.text+0x548): undefined reference to `json_object_iter'
> dump.c:(.text+0x5a8): undefined reference to `json_object_size'
> dump.c:(.text+0x5dc): undefined reference to `json_object_iter_key'
> dump.c:(.text+0x5f4): undefined reference to `json_object_iter_next'
> dump.c:(.text+0x6a0): undefined reference to `json_object_get'
> dump.c:(.text+0x728): undefined reference to `json_array_size'
> dump.c:(.text+0x7e4): undefined reference to `json_array_get'
> dump.c:(.text+0x81c): undefined reference to `json_string_value'
> dump.c:(.text+0x834): undefined reference to `json_real_value'
> dump.c:(.text+0x8c0): undefined reference to `json_integer_value'
> dump.c:(.text+0x980): undefined reference to `json_object_iter_next'

You'll need to compile value.c and use value.o in the linking stage.

Petri

ftv.dev

unread,
Apr 26, 2012, 9:36:20 AM4/26/12
to Jansson users
Thank you Petri for your response.
Yes I have discovered, yesterday that I forgot to compile the value.c.
Now every thing works great.
Reply all
Reply to author
Forward
0 new messages