C API with version 3.0.0-rc2 won't compile : undefined reference

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
dodobibi
Posts: 5
Joined: 24 Aug 2017 13:31

C API with version 3.0.0-rc2 won't compile : undefined reference

Post by dodobibi »

I try to compile a C program which use libzway.so.

It work nice with version 2.3.5, but not with version 3.0.rc2.
The compilation of z-way-test wasen't work too

It won't compile because there is undefined references for these functions :

Code: Select all

cc -L/opt/z-way-server/libs    -o z-way-test main.o -lzway -lzcommons -lpthread -lxml2 -lz -lm -lcrypto -larchive
/opt/z-way-server/libs/libzway.so : référence indéfinie vers « s2_inclusion_challenge_response »
/opt/z-way-server/libs/libzway.so : référence indéfinie vers « S2_destroy »
/opt/z-way-server/libs/libzway.so : référence indéfinie vers « s2_inclusion_joining_start »
/opt/z-way-server/libs/libzway.so : référence indéfinie vers « s2_inclusion_set_event_handler »
/opt/z-way-server/libs/libzway.so : référence indéfinie vers « s2_inclusion_notify_timeout »
/opt/z-way-server/libs/libzway.so : référence indéfinie vers « s2_inclusion_init »
/opt/z-way-server/libs/libzway.so : référence indéfinie vers « S2_send_frame_done_notify »
/opt/z-way-server/libs/libzway.so : référence indéfinie vers « S2_get_caller_ctx »
/opt/z-way-server/libs/libzway.so : référence indéfinie vers « S2_send_data »
/opt/z-way-server/libs/libzway.so : référence indéfinie vers « s2_inclusion_key_grant »
/opt/z-way-server/libs/libzway.so : référence indéfinie vers « keystore_public_key_read »
/opt/z-way-server/libs/libzway.so : référence indéfinie vers « S2_timeout_notify »
/opt/z-way-server/libs/libzway.so : référence indéfinie vers « S2_application_command_handler »
/opt/z-way-server/libs/libzway.so : référence indéfinie vers « s2_inclusion_abort »
/opt/z-way-server/libs/libzway.so : référence indéfinie vers « S2_init_ctx »
/opt/z-way-server/libs/libzway.so : référence indéfinie vers « s2_inclusion_including_start »
collect2: error: ld returned 1 exit status
Makefile:24 : la recette pour la cible « z-way-test » a échouée
make: *** [z-way-test] Erreur 1

Is this an oversight in the header files ?
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: C API with version 3.0.0-rc2 won't compile : undefined reference

Post by PoltoS »

Yes, there is ;) add -lzs2
dodobibi
Posts: 5
Joined: 24 Aug 2017 13:31

Re: C API with version 3.0.0-rc2 won't compile : undefined reference

Post by dodobibi »

Thanks, but libzs2.so isn't provided in z-way-server-RaspberryPiXTools-v3.0.0-rc2.tgz

Code: Select all

cc -L/opt/z-way-server/libs    -o z-way-test main.o -lzway -lzcommons -lzs2 -lpthread -lxml2 -lz -lm -lcrypto -larchive
/usr/bin/ld : ne peut trouver -lzs2
collect2: error: ld returned 1 exit status
Makefile:24 : la recette pour la cible « z-way-test » a échouée
make: *** [z-way-test] Erreur 1
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: C API with version 3.0.0-rc2 won't compile : undefined reference

Post by PoltoS »

Indeed... It is statically compiled. We will fix it in the next beta release
dodobibi
Posts: 5
Joined: 24 Aug 2017 13:31

Re: C API with version 3.0.0-rc2 won't compile : undefined reference

Post by dodobibi »

Great, thank you

Edit :
I tried the 3.0.0.rc3 version.

There is always undefined reference when compiling, and not libzs2.so
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: C API with version 3.0.0-rc2 won't compile : undefined reference

Post by PoltoS »

Please try rc5 - now libzs2.so is in the libs folder
dodobibi
Posts: 5
Joined: 24 Aug 2017 13:31

Re: C API with version 3.0.0-rc2 won't compile : undefined reference

Post by dodobibi »

Everything is ok now.
Thank you !
Post Reply