Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking error wirth undefined reference to `strdup' in contiki build #99

Open
Stefan-Schmidt opened this issue Sep 20, 2016 · 4 comments

Comments

@Stefan-Schmidt
Copy link

Trying to build the various examples for the 6lowpanclicker right now.

Initiated the manifest with master (also tried dev, same result).

Whenever I run a build for contiki which includes the lwm2m example I get this linking error.

make[1]: Entering directory '/home/stefan/Projects/ieee802154/Ci40/creatorkit/packages/button-sensor'
CC lwm2m-client-button-sensor.c
LD lwm2m-client-button-sensor.mikro-e
contiki-mikro-e.a(coap_abstractio): In function coap_RegisterUri': coap_abstraction_contiki.c:(.text.coap_RegisterUri+0x20): undefined reference tostrdup'
contiki-mikro-e.a(lwm2m_definitio): In function NewObjectType': lwm2m_definition.c:(.text.NewObjectType+0x6c): undefined reference tostrdup'
contiki-mikro-e.a(lwm2m_definitio): In function NewResourceType': lwm2m_definition.c:(.text.NewResourceType+0x6c): undefined reference tostrdup'
contiki-mikro-e.a(lwm2m_util.o): In function Lwm2mCore_SplitQuery': lwm2m_util.c:(.text.Lwm2mCore_SplitQuery+0x30): undefined reference tostrdup'
lwm2m_util.c:(.text.Lwm2mCore_SplitQuery+0x98): undefined reference to strdup' contiki-mikro-e.a(lwm2m_util.o):lwm2m_util.c:(.text.Lwm2mCore_SplitQuery+0xdc): more undefined references tostrdup' follow
collect2: error: ld returned 255 exit status
../../constrained-os/contiki/Makefile.include:280: recipe for target 'lwm2m-client-button-sensor.mikro-e' failed
make[1]: *** [lwm2m-client-button-sensor.mikro-e] Error 255
rm lwm2m-client-button-sensor.co

xc32-gcc version is v1.42 and installed into /opt/microchip/xc32/v1.42/

As compilation itself seems to work I would thing maybe the linking flags are not setup correctly? Or is there some piece of code missing providing strdup for th this arch on contiki?

@abhijit-mahajani-imgtec
Copy link
Contributor

Can you please check with 1.34 compiler once? Meanwhile we will check with 1.42 and get back to you.
You can get pre-built hex files at https://github.com/CreatorKit/manifest/releases/tag/v0.9.5

@Stefan-Schmidt
Copy link
Author

Indeed v1.34 works like it should. Thanks a lot! Maybe add it as a note to the docs?

@abhijit-mahajani-imgtec
Copy link
Contributor

Thanks @Stefan-Schmidt , https://github.com/CreatorDev/contiki/tree/3.0-mikro-e/platform/mikro-e describes the need of 1.34 compiler, however we will update the documentation such that it becomes more obvious.

@Stefan-Schmidt
Copy link
Author

Ah, thanks for pointing this out. I only looked at the generic Creatorkit docs and not into the contiki mikro-e folder.

Places that just mention to install the cx32 compiler from the microship website (without the version hint):
https://docs.creatordev.io/clicker/guides/working-with-contiki/
https://docs.creatordev.io/ci40/iotkit/iot-project-tools/#building-from-source-code

Maybe also mention the v1.34 download link explicitly as the microship website only mentions the newest version and I had to google for the file name to get a link for v1.34

Besides the doc improvements this issue can be closed. Feel free to do so whenever you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants