Discussion:
[Contiki-developers] Does any of you make any math.h function work in redbee-econotag?
CARLOS MORENO LEON
2012-11-19 21:01:36 UTC
Permalink
Hi all,
I have an issue that seems to be so easy to solve but its making me crazy.
After compile and simulate my program properly in cooja, the compiler can't
find the reference for the "exp" and "pow" functions when compiling the
real mote. I have included math.h library in the .c file and tried to add
the lm library in several makefiles as some of you suggest in the
developers list, but it doesn't work for me. As you can see I'm not really
skillful and I'm pretty new in contiki so... may I have some help? I'm
using redbee-econotag.

thanks,
Carlos
Frederik Hermans
2012-11-20 12:25:44 UTC
Permalink
Post by CARLOS MORENO LEON
I have included math.h library in the .c file
and tried to add the lm library in several makefiles as some of you
suggest in the developers list, but it doesn't work for me.
I haven't followed the discussion, but have you added -lm at the *end*
of your link command?

Bad:
gcc -lm -lsomeotherlib -o foo foo.c -Wall

Good:
gcc -lsomeotherlib -o foo foo.c -Wall -lm

I had this issue before, and adding lm at the end helped. Also see
http://stackoverflow.com/questions/9934549/very-strange-linker-behavior

HTH,

/Frederik
CARLOS MORENO LEON
2012-11-20 15:59:36 UTC
Permalink
Thanks for your reply,

I think the similar thing when using makefiles would be changing the
location of -lm in these two lines in the mc1322x Makefile.include file:

$Q$(CC) $(LDFLAGS) -o $@ -Wl,--start-group $^ -lm -Wl ,--end-group

$$Q$$(CC) $$(LDFLAGS) -o $$@ -Wl,--start-group $$^ -lm -Wl ,--end-group

No matter where, it doesn't work.
Any other suggestion?

Thanks, Carlos
Post by Frederik Hermans
Post by CARLOS MORENO LEON
I have included math.h library in the .c file
and tried to add the lm library in several makefiles as some of you
suggest in the developers list, but it doesn't work for me.
I haven't followed the discussion, but have you added -lm at the *end*
of your link command?
gcc -lm -lsomeotherlib -o foo foo.c -Wall
gcc -lsomeotherlib -o foo foo.c -Wall -lm
I had this issue before, and adding lm at the end helped. Also see
http://stackoverflow.com/questions/9934549/very-strange-linker-behavior
HTH,
/Frederik
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Contiki-developers mailing list
https://lists.sourceforge.net/lists/listinfo/contiki-developers
Sergio Donalduck
2012-11-22 00:04:34 UTC
Permalink
Hi Carlos,

have you tried adding TARGET_LIBFILES += -lm in the application Makefile?

Here it says that it should help, but I do not know whether this is
necessary for the econotag mote.

http://comments.gmane.org/gmane.os.contiki.devel/9727

Best!
Sergio




On Tue, Nov 20, 2012 at 4:59 PM, CARLOS MORENO LEON <
Post by CARLOS MORENO LEON
Thanks for your reply,
I think the similar thing when using makefiles would be changing the
No matter where, it doesn't work.
Any other suggestion?
Thanks, Carlos
Post by Frederik Hermans
Post by CARLOS MORENO LEON
I have included math.h library in the .c file
and tried to add the lm library in several makefiles as some of you
suggest in the developers list, but it doesn't work for me.
I haven't followed the discussion, but have you added -lm at the *end*
of your link command?
gcc -lm -lsomeotherlib -o foo foo.c -Wall
gcc -lsomeotherlib -o foo foo.c -Wall -lm
I had this issue before, and adding lm at the end helped. Also see
http://stackoverflow.com/questions/9934549/very-strange-linker-behavior
HTH,
/Frederik
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Contiki-developers mailing list
https://lists.sourceforge.net/lists/listinfo/contiki-developers
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Contiki-developers mailing list
https://lists.sourceforge.net/lists/listinfo/contiki-developers
Loading...