Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / August 2005



Tip: Looking for answers? Try searching our database.

linking gcc built libs

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robert - 25 Jul 2005 15:06 GMT
I am statically linking some image libraries I built wwith gcc
(config/make stuff) into a Codewarrior built dynamic library. This
works on 10.3.x but on 10.4.2 I get some undefined symbols all from the
C++ and C libraries. I am linking with the BSD libraries using
MSL_C++_BSD_C_Mach-O_D.lib and BSD_Runtime_Mach-O_D.lib. I can also
resolve a few of these (restFP, saveFP, __eprintf) by linking with
libgcc.a (in /usr/lib/gcc/darwin/3.3/, under 10.3 there was a link to
it in /usr/lib, but no more). Any ideas what I am missing?

Thanks!

Here are the link errors:

Link Error   : undefined: 'std::ostream::seekp(std::fpos<__mbstate_t>)'
(code)
Referenced from '_tiffosReadProc(void*, void*, long)' in libtiff.a

Link Error   : undefined: 'std::istream::seekg(long long,
std::_Ios_Seekdir)' (code)
Referenced from '_tiffosReadProc(void*, void*, long)' in libtiff.a

Link Error   : undefined: 'std::ostream::seekp(long long,
std::_Ios_Seekdir)' (code)
Referenced from '_tiffosReadProc(void*, void*, long)' in libtiff.a

Link Error   : undefined: 'std::ios_base::Init::~Init()' (code)
Referenced from '_tiffosReadProc(void*, void*, long)' in libtiff.a

Link Error   : undefined: 'sscanf$LDBLStub' (code)
Referenced from 'out_of_memory' in libjpeg.a

Link Error   : undefined: 'vfprintf$LDBLStub' (code)
Referenced from '_tiffReadProc' in libtiff.a

Link Error   : undefined: 'restFP' (code)
Referenced from 'jpeg_idct_float' in libjpeg.a
Referenced from 'TIFFCIELabToXYZ' in libtiff.a
Referenced from 'TIFFVGetFieldDefaulted' in libtiff.a
Referenced from 'LogL16Decode' in libtiff.a
Referenced from 'PixarLogGuessDataFmt' in libtiff.a

Link Error   : undefined: 'saveFP' (code)
Referenced from 'jpeg_idct_float' in libjpeg.a
Referenced from 'TIFFCIELabToXYZ' in libtiff.a
Referenced from 'TIFFVGetFieldDefaulted' in libtiff.a
Referenced from 'LogL16Decode' in libtiff.a
Referenced from 'PixarLogGuessDataFmt' in libtiff.a

Link Error   : undefined: '__eprintf' (code)
Referenced from 'TIFFGetTagListCount' in libtiff.a
Referenced from 'LogL16Decode' in libtiff.a
Referenced from 'PixarLogGuessDataFmt' in libtiff.a
Referenced from '_ZIPSetupDecode' in libtiff.a
Referenced from 'Fax3PreDecode' in libtiff.a
Referenced from 'LZWSetupDecode' in libtiff.a
Referenced from 'PredictorSetup' in libtiff.a
Referenced from 'TIFFSetupStrips' in libtiff.a
Referenced from 'TIFFStartStrip' in libtiff.a
Referenced from 'tagCompare' in libtiff.a
Referenced from 'DumpModeEncode' in libtiff.a

Link Error   : undefined: 'sprintf$LDBLStub' (code)
Referenced from 'error_exit' in libjpeg.a
Referenced from 'TIFFRGBAImageOK' in libtiff.a
Referenced from 'tagCompare' in libtiff.a
Referenced from 'png_write_info_before_PLTE' in libpng12.a
Referenced from 'png_save_uint_32' in libpng12.a
Referenced from 'png_set_crc_action' in libpng12.a
Referenced from 'png_get_uint_32' in libpng12.a
Referenced from 'png_create_read_struct_2' in libpng12.a
Referenced from 'png_set_sig_bytes' in libpng12.a

Link Error   : undefined: 'fprintf$LDBLStub' (code)
Referenced from '_TIFFprintAscii' in libtiff.a
Referenced from 'error_exit' in libjpeg.a
Referenced from '_tiffReadProc' in libtiff.a
Referenced from 'Fax3PreDecode' in libtiff.a
Referenced from 'PredictorSetup' in libtiff.a
Referenced from 'tagCompare' in libtiff.a
Referenced from 'png_save_uint_32' in libpng12.a
Referenced from 'png_get_uint_32' in libpng12.a
Referenced from 'png_warning' in libpng12.a
MW Ron - 25 Jul 2005 23:44 GMT
>I am statically linking some image libraries I built wwith gcc
>(config/make stuff) into a Codewarrior built dynamic library. This
[quoted text clipped - 4 lines]
>libgcc.a (in /usr/lib/gcc/darwin/3.3/, under 10.3 there was a link to
>it in /usr/lib, but no more). Any ideas what I am missing?

What versio of CodeWarrior are you using?

did you rebuild your precompiled headers and libraries after upgrading
to 10.4?   You must at least upgrade your precompiled headers.

If this is 8.3  did you point the OS X Volume to the 10.2.8 SDK or is it
at root?

Be sure your access paths are correct and that include is not recursive
search.

Ron

>Here are the link errors:
>
[quoted text clipped - 67 lines]
>Referenced from 'png_get_uint_32' in libpng12.a
>Referenced from 'png_warning' in libpng12.a

Signature

CodeWarrior Community Forum is a free online resource for developers
to discuss CodeWarrior topics with other users and our staff
       --   http://www.codewarrior.com/community  --

Ron Liechty - MWRon@metrowerks.com - http://www.codewarrior.com

Robert - 26 Jul 2005 13:23 GMT
> What versio of CodeWarrior are you using?

CW 9.5, w/xCode 2.1

> did you rebuild your precompiled headers and libraries after upgrading
> to 10.4?   You must at least upgrade your precompiled headers.

The system had (or came with) 10.4. CW 9.5 was installed on that.
Though I will check with my sys admins to see exactly what they did.

> Be sure your access paths are correct and that include is not recursive
> search.

No different than what I used on 10.3 and earlier.

Has anyone else out there linked a gcc built lib with a CW app or
dylib? If anyone has done this with one of the open source image
libraries (libpng, libtiff, libjpeg). What did you do? Did it work?

Robert
MW Ron - 26 Jul 2005 20:13 GMT
>> What versio of CodeWarrior are you using?
>
[quoted text clipped - 16 lines]
>
>Robert

Be sure you have XCode 2.1 installed.

CodeWarrior links with libraries made by XCode (frameworks for example)
I don't think that is it but you never know.

An example project sent to support would help.

Ron

Signature

CodeWarrior Community Forum is a free online resource for developers
to discuss CodeWarrior topics with other users and our staff
       --   http://www.codewarrior.com/community  --

Ron Liechty - MWRon@metrowerks.com - http://www.codewarrior.com

brianhray@gmail.com - 15 Aug 2005 21:25 GMT
I am having what seems to be a simular issue. How did this turn out?

I am using the .a files from config/make on a well know Mozilla
project. I link to these and make a static library. It builds fine in
codewarrior 9.5 OSX 10.4.2 Xcode 2.0. However, when I use this static
library in anouther codewarrior build (to make a bundle) I get the link
errors found below. I am not using the MSL or BSD dylibs anywhere.
Should I be?  I am, however, using bundle1.o for the application
bundle.

Please help.

Link Error   : undefined: 'sscanf$LDBLStub' (code)
Referenced from '_PR_InitLog' in JavascriptMachODebugLib
Project: SRCFromOriginal, Target: Pro Debug MACH

Link Error   : undefined: '__eprintf' (code)
Referenced from 'error_table_name' in JavascriptMachODebugLib
Project: SRCFromOriginal, Target: Pro Debug MACH

Link Error   : undefined: 'fprintf$LDBLStub' (code)
Referenced from '_PR_InitLog' in JavascriptMachODebugLib
Referenced from '_PR_DestroyZones' in JavascriptMachODebugLib
Referenced from '_PR_InitDtoa' in JavascriptMachODebugLib
Project: SRCFromOriginal, Target: Pro Debug MACH

Link Error   : undefined: '__moddi3' (code)
Referenced from 'ComputeGMT' in JavascriptMachODebugLib
Project: SRCFromOriginal, Target: Pro Debug MACH

Link Error   : undefined: '__divdi3' (code)
Referenced from 'IsValidNetAddr' in JavascriptMachODebugLib
Referenced from 'ComputeGMT' in JavascriptMachODebugLib
Project: SRCFromOriginal, Target: Pro Debug MACH

Link Error   : undefined: 'sprintf$LDBLStub' (code)
Referenced from 'fill2' in JavascriptMachODebugLib
Project: SRCFromOriginal, Target: Pro Debug MACH

Link Error   : undefined: '__umoddi3' (code)
Referenced from 'fill2' in JavascriptMachODebugLib
Project: SRCFromOriginal, Target: Pro Debug MACH

Link Error   : undefined: '__udivdi3' (code)
Referenced from '_PR_InitClock' in JavascriptMachODebugLib
Referenced from 'fill2' in JavascriptMachODebugLib
Project: SRCFromOriginal, Target: Pro Debug MACH
Robert - 24 Aug 2005 13:40 GMT
Here are the system libraries I found I had to add to resolve those
undefined names. You probably do not need all of them. Experiment to
see. Or use the 'nm' command to search for your symbols.

Here are the libraries I ended up adding:

/usr/lib/gcc/darwin/3.3/libgcc.a
/usr/lib/libSystemStubs.a
    All those symbols with $LDBLStub in their name
/usr/lib/libstdc++.6.dylib

This is along with the ordinary (for me)
MSL_C++_BSD_C_Mach-O.lib
BSD_Runtime_Mach-O.lib
 these are in Codewarrior directory tree.

and frameworks:

System
Carbon

Hope this helps.

Robert
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.