tags:

views:

112

answers:

1

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 when 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...

+1  A: 

Did you pull down the libraries from somewhere? Poco comes with all the source. Recompile it.

Duck
Specifically, recompile it for the desired architecture and choose the needed one when compiling with `-arch`.
Georg Fritzsche
You can check the architecture of a binary file with the lipo command. (lipo -info /path/to/binary)
Dan
@gf: I pulled the SVN branch and built it from scratch. @Dan: Thanks! The architecture is: x86_64. I probably need to make a 386 build, I think..
StackedCrooked
Don't the configure scripts work on the Mac?
Duck
@Duck: running configure with config=Darwin still causes x86_64 builds to be created. I posted on the Poco forums about this.
StackedCrooked