Author Topic: Unable to link on Snow Leopard (Xcode 3.2.6)  (Read 70636 times)

migrap

  • Newbie
  • *
  • Posts: 3
    • View Profile
Unable to link on Snow Leopard (Xcode 3.2.6)
« on: August 23, 2011, 03:38:17 PM »
When I attempt to link justthread-mp-4.5.a I get the following error "file was built for unsupported file format which is not the architecture being linked (x86_64)".

I've removed the "x86_64" from the list of valid architectures and I'm only trying to build against the 32-bit Intel architecture.

Xcode's build command starts with "g++-4.5 -arch i386 -isysroot" and then is followed by paths to headers, sources, etc. So things appear to be right.

What am I missing?

Anthony Williams

  • Administrator
  • Full Member
  • *****
  • Posts: 103
    • View Profile
    • just::thread C++ Thread Library
Re: Unable to link on Snow Leopard (Xcode 3.2.6)
« Reply #1 on: August 23, 2011, 03:57:37 PM »
It does seem like the linker is trying to link an x86_64 binary. Can you post a sample project that demonstrates the problem?

migrap

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Unable to link on Snow Leopard (Xcode 3.2.6)
« Reply #2 on: August 23, 2011, 04:15:48 PM »
I tried a couple times to post the attachment and was met with an "Internal Server Error". Doh!

I've uploaded it to my website http://www.migrap.com/tmp/Threads.zip

Anthony Williams

  • Administrator
  • Full Member
  • *****
  • Posts: 103
    • View Profile
    • just::thread C++ Thread Library
Re: Unable to link on Snow Leopard (Xcode 3.2.6)
« Reply #3 on: August 23, 2011, 06:16:43 PM »
Sorry about the problem you encountered with uploading an attachment.

With regards to your problem, it should just be a matter of doing a Clean from the Build menu in XCode. For some reason, XCode had built an x86_64 object file from main.cpp, but wasn't rebuilding it for i386.

If you are still having problems, let me know.

migrap

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Unable to link on Snow Leopard (Xcode 3.2.6)
« Reply #4 on: August 24, 2011, 01:27:33 AM »
I think I figured it out. I'm not sure exactly what I did, but it works. I'm going to try to replicate it on my laptop now and figure out what minimally has to be done. I know I had to do some pretty extravagant things and I'd like to see if I can simplify.

Thanks for the help!!!