[gdal-dev] troubles building trunk on OSX + Xcode 4.3

William Kyngesburye woklist at kyngchaos.com
Tue May 15 22:54:34 EDT 2012


On May 15, 2012, at 9:07 PM, Joaquim Luis wrote:

>> Has this worked in the past?  Did you change any configuration options from then?  Or update any dependent libraries?
> 
> Yes, it did work several times in the past. But also yes, I updated dependencies using homebrew. Started by netcdf, which brought hdf5. Next, had to update libjpeg. All of that in top of upgrading XCode from 4.1 to 4.3.2
> Also had an error in one of the ecw headers. Not sure anymore of the exact terms but was something that was declared EXTERNAL wchar_t in OSX header and static on the NCe.../?) ecw header. I removed the 'static' declaration and it went well after
> 
>> Also, the link command immediately preceding the first error would help figure out what's going on.
> 
> It's a very long one. It starts with
> 
> and ends with
> 
> ./ogr/.libs/ogr_expat.o ./ogr/.libs/ogrpgeogeometry.o ./ogr/.libs/ogrgeomediageometry.o   -lsqlite3 -lexpat /usr/local/lib/libNCSEcw.dylib -L/usr/lib -L/usr/local/lib -L/System/Library/Frameworks/Carbon.framework/Carbon /usr/local/lib/libNCSEcwC.dylib /usr/local/lib/libNCSCnet.dylib /usr/local/lib/libNCSUtil.dylib -ljasper -L/usr/local/Cellar/netcdf/4.1.3/lib -lnetcdf -lhdf5 /usr/local/lib/libmfhdf.a /usr/local/lib/libdf.a -ljpeg -ltiff -lpq -ldl -lcurl -liconv -lxml2 -lz -lpthread -licucore -lm    -install_name  /usr/local/lib/libgdal.1.dylib -compatibility_version 18 -current_version 18.0 -Wl,-single_module
> ld: warning: path '/System/Library/Frameworks/Carbon.framework/Carbon' following -L not a directory
> Undefined symbols for architecture x86_64:
>  "operator new(unsigned long)", referenced from:
>      IdrisiDataset::IdrisiDataset()in IdrisiDataset.o
>      _GDALRegister_IDRISI in IdrisiDataset.o
>      IdrisiDataset::Open(GDALOpenInfo*)       in IdrisiDataset.o
> ...

From it's placement in the above and a vague memory of the old ecw builds, I suspect the carbon part comes from ECW.  those separate libNCEcw* libraries are an old way of building ECW, the newer method builds as a single libecwj2.  ECW is a PITA to compile on OSX (my notes still leave some unsolved problems).

But for the error, it maybe because it's using the wrong command to link - this is C++, and that's where the new() op is from.  Normally, the easy way to link is use g++, which automatically links the necessary C++ library.  But your link command is using gcc, which would need the C++ library linked in manually.  This is odd because libtool is passed g++, but ends up using gcc.  Did you update libtool in your GDAL source?

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Mon Dieu! but they are all alike.  Cheating, murdering, lying, fighting, and all for things that the beasts of the jungle would not deign to possess - money to purchase the effeminate pleasures of weaklings.  And yet withal bound down by silly customs that make them slaves to their unhappy lot while firm in the belief that they be the lords of creation enjoying the only real pleasures of existence....

- the wisdom of Tarzan




More information about the gdal-dev mailing list