RE: Using libraries with GNU C for MPC555
"David Eicher" <[email protected]>
| Newsgroups | gmane.comp.hardware.motorola.microcontrollers |
|---|---|
| Message-ID | <[email protected]> |
THANKS Dan! That did it. I missed the significance of the difference between -L and -l (upper and lower case L) in the online GNU documentation. Once I put the searchpath in -L and the library name in -l I was in business. That cleaned up a lot of unresolved references the linker was struggling with. I just have to fix the remaining linker issues and I've got an executable. Linkers sure are picky! Thanks again, Dave _____ From: [email protected] [mailto:[email protected]] On Behalf Of Dan Fowell Sent: Thursday, July 14, 2005 7:34 AM To: [email protected] Subject: RE: [MPC500] Using libraries with GNU C for MPC555 I don't use stdio or printf, but I do link in a library called libc.a (which has sprintf, atoi, and many others). My link command looks as follows: powerpc-elf-ld.exe -g -t --verbose -Trom.lnk -o main.elf startup.o serial.o main.o hdw.o -L../lib -lc It's been a few years, but I think the -L tells it to link in the libraries, I specify the location of the library "../lib" and then I specify which library "-lc" which tells it to link in the c library (there is a libm.a and a libg.a as well). So from where I compile, my libc.a file is back a directory and then in a "lib" folder I created. Hope that helps. Dan _____ [Non-text portions of this message have been removed] ----------------------------------------------------------- To learn more about Freescale Microcontrollers, please visit http://www.freescale.com/mcu Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/MPC500/ <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/