Link errors on Snow Leopard
I creating a small desktop application using Qt and Poco on Mac OS X Snow Leopard.
Qt works fine, but once I started linking with Poco I get the following warning:
ld: warning: in /Developer/SDKs/MacOSX10.6.sdk/usr/local/lib/libPocoFoundation.8.dylib, file is not of required architecture
Also whe开发者_StackOverflow社区n I link against the 10.5 SDK:
ld: warning: in /Developer/SDKs/MacOSX10.5.sdk/usr/local/lib/libPocoFoundation.8.dylib, file is not of required architecture
Any hints on how to solve this?
Solved!
Here's my workaround (I also posted it on the Poco forums btw):
The problem is that when the architecture is not specified Snow Leopard defaults to 64-bit, while older versions of the OS default to 32-bit. In the Poco build system, the Darwin config file does not specify the architecture, so it picks 32 bit. My solution was to copy the Darwin_x86_64 config file over the Darwin file and replace the textual instances of 'x86_64' with 'i386'. This forces a 32 bit build.
A somewhat hackish solution though, let me know if it can be done in a cleaner way...
Did you pull down the libraries from somewhere? Poco comes with all the source. Recompile it.
精彩评论