linking static libs with (?) different architecture

I’m running into a problem that’s not OF specific (really) but that I figured I’d ask about here and see if anyone else could give me an idea. I’m running into this:

  
ld: warning: in /Users/base/openframeworks/of_061/apps/examples/juliusTesting/src/libjulius.a, file was built for unsupported file format which is not the architecture being linked (i386)  

So, apparently julius is building a library that isn’t i386, but I’m configuring it like so:

  
./configure  --host=i386-apple-darwin --cache-file=.././config.cache --srcdir=.  

and I see in the config:

  
checking host system type... i386-apple-darwin  

What’s more everything else getting generated (executables) in the julius make process works (i.e. it’s not ppc). Is this as simple as their makefiles generating bad stuff or is there something else I might be missing? Thanks!

the --host parameter in the configure script tells it what’s the platform in which you’re going to compile not for which you want to generate the library for. try with --target instead.

Thanks Arturo, I gave it a try with the --target flag set and it’s still not working.

I’m not sure what’s up on 10.6 b/c even going back to the projects where I was using libjulius on 10.5 I get the same error. Hopefully someone on the julius site will have an idea.

Just figured someone else might run into this, so I’ll post how I got it fixed. Here’s what I get from gcc:

  
  
[base-2:~]base$gcc -v  
Using built-in specs.  
Target: i686-apple-darwin10  
Configured with: /var/tmp/gcc/gcc-5659~1/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1  
Thread model: posix  
  

so when I compile julius I need to add

  
CFLAGS=-m32  

to all the makefiles, otherwise it’s getting compiled as i686.