Re: Linking

Orlando Arias <[email protected]>
Newsgroups gmane.comp.hardware.texas-instruments.msp430.gcc.user
Message-ID <[email protected]>
You need to explicitly link the other object files into the final elf as
well.
msp430-gcc -Os -Wall -g -mmcu=msp430f5438a main.o bluetooth.o comm.o
characters.o output.o -o main.elf

On Wed, 2013-04-17 at 20:20 -0400, Ian Chapman wrote:
> Hi all,
>      My Makefile produces all the dot.o files from the dot.c files with 
> a few warnings.  However the link stage fails to find the functions 
> called by main.c that are specified in the dot.h and defined in the 
> dot.c files and by then should be in dot.o files.
> Makefile
> CC=msp430-gcc
> CFLAGS=-Os -Wall -g -mmcu=msp430f5438a
> main : main.o bluetooth.o comm.o characters.o output.o
>      $(CC) $(CFLAGS) main.c -o main.elf
> main.o : main.c main.h
>      $(CC) $(CFLAGS) -c main.c
> etc
> 
> Result
> msp430-gcc -Os -Wall -g -mmcu=msp430f5438a main.c -o main.elf
> /tmp/ccx0kuof.o: In function `main':
> /home/stan/msp430/TDU/main.c:202: undefined reference to `vEnterCommandMode'
> /home/stan/msp430/TDU/main.c:203: undefined reference to `vSendCommand'
> collect2: ld returned 1 exit status
> make: *** [main] Error 1
> 
>      I guess I'm missing a flag to indicate that the dot.o files are in 
> the working directory but that should be the gcc default.  Any ideas?  Ian.
> 
> 
> ------------------------------------------------------------------------------
> Precog is a next-generation analytics platform capable of advanced
> analytics on semi-structured data. The platform includes APIs for building
> apps and a phenomenal toolset for data science. Developers can use
> our toolset for easy data analysis & visualization. Get a free account!
> http://www2.precog.com/precogplatform/slashdotnewsletter
> _______________________________________________
> Mspgcc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter

_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)

iEYEABECAAYFAlFvyPMACgkQUxW/UBZ+LqG02ACffZIAkwlWiyj/tpKeRyi5RK15
hDEAoLTxfpUWlDfL8TidgDqy8IGvJCT9
=rmCH
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.