Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Undefined symbols with ld

Undefined symbols with ld
Thread Tools
Fresh-Faced Recruit
Join Date: Aug 2001
Status: Offline
Reply With Quote
Dec 28, 2001, 01:35 AM
 
Trying to get libmpeg2 working on OS X....

Everthing compiles fine (after my tweaking for CC instead of gcc) but I get this in the linker:

/bin/sh ../libtool --mode=link cc -g -O3 -fomit-frame-pointer -faltivec -force_cpusubtype_ALL -Wall -flat_namespace -o mpeg2dec mpeg2dec.o getopt.o ../libmpeg2/libmpeg2.la ../libvo/libvo.a -lSM -lICE -L/usr/X11R6/lib -lX11 -lXext libcpuaccel.la
cc -g -O3 -fomit-frame-pointer -faltivec -force_cpusubtype_ALL -Wall -flat_namespace -o mpeg2dec mpeg2dec.o getopt.o ../libmpeg2/.libs/libmpeg2.a ../libvo/libvo.a -lSM -lICE -L/usr/X11R6/lib -lX11 -lXext ./.libs/libcpuaccel.a
/usr/bin/ld: Undefined symbols:

_mpeg2_cpu_state_init
_mpeg2_idct_altivec_init

_mpeg2_mc_altivec
_arch_accel
make[1]: *** [mpeg2dec] Error 1
make: *** [all-recursive] Error 1


I'm not exactly sure what this means... Are there any flags for the linker I should use? Or is it a problem with the library code... and in that case, what do I do? How do I define a symbol?

TIA,
David
     
Fresh-Faced Recruit
Join Date: May 1999
Status: Offline
Reply With Quote
Dec 28, 2001, 08:22 PM
 
A link error means that there is a line of code that is making reference to a symbol (it can be a variable, or function, etc), that has not been defined. In this case, it looks like you are missing four functions. You are probably not linking in the object file that contains these symbols. So do a search in your code (in the .c or .cpp files) for "mpeg2_cpu_state_init", for example (the leading underscore is added by the compiler). Then pass that to the libtool line that you had below. Make sense?
     
LordRPI  (op)
Fresh-Faced Recruit
Join Date: Aug 2001
Status: Offline
Reply With Quote
Dec 28, 2001, 09:31 PM
 
Yeah, I got it... actually got it figured out... they were being cut off by the preprocessor... figures I got the stuff off of sourceforge... after every revision, it's like... IT'LL COMPILE CORRECTLY THIS TIME!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:25 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2