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...
Did you pull down the libraries from somewhere? Poco comes with all the source. Recompile it.
Related
Good day all
I have been searching for a method of cross-compiling for QT-Creator in Linux for sometime now, and I have been having alot of trouble with it.
Background info
please note: I am on a Linux machine, and would like to cross compile Windows Apps
My system:
Ubuntu Gnome 16.10
QT Creator 4.0.2 (based on QT 5.7)
I have came across a few SO links, a few blogs with broken instructions, etc and one seeming helpful but dependencies could not be found.
I have also attempted another compiler MXE and cloned and attempted to build the MXE compiler from the GIT repo, which failed (no solution for the build error - VTK build error)
I decided to download precompiled MinGW compilers (i686 and x86_x64 versions) from sourceforge
Issue:
In QT Creator, adding the compiler is done without an issue, adding the "Kit" and selecting the newly added compiler, an red exclamation gives an error
The Compiler (x86_windows_msys_pe_64bit) cannot produce code for QT version 5.7.0 GCC 64Bit (x86_linux_generic_elf_64bit)
This occurs for both 32 + 64 bit compilers.
I think that you should have a QT version that matches your compiler ABI. The error tells you that the MinGW compiler doesn't match the Linux version of QT you have used. Therefore, get a windows version of QT and use it instead (just as you've added WinGW).
You can download Qt Binaries from here.
We want our software to support OSX Versions down to 10.9. In XCode you can set the target version, that is no problem, but we have another lib that gets linked in the projekt which is built using cmake. Now XCode complains that the lib is build for 10.11, but our project is 10.9. Can I somehow tell clang on the command line to compile for an older version?
The only information I have found is to set OSX_VERSION as variable, but it seems to have no effect.
Thanks in advance!
From clang --help:
-mmacosx-version-min=<value>
Set Mac OS X deployment target
Do be on the lookout for gotchas with earlier deployment targets, and make sure you test all the OS versions you support.
was it ever possbile to create a C++ command line tool as a fat binary in XCode (32bit and 64bit in one file)? I thought it was, but if I try it now, XCode hangs during "Creating Universal Binary."
I updated to OSX Mavericks and I am using XCode 4.6.2. It doesn't matter which compiler I choose. As soon as I set "Build Active Architecture Only" to false, the compiler hangs during "Creating Universal Binary".
Additionally I am building a static C++ library in my project which has no problems to be build for 32 and 64 bit in one file.
I hope you can help me.
Cheers
Georg
I had the same problem after updating to Mavericks. Both Xcode 4.6.3. and Xcode 3.2.6 were hanginig endlessly during "Creating Universal Binary."
As it's the lipo command line tool that's creating the universal binaries I did some research and found this discussion which solved my problems:
Installing psycopg2 has it stuck between xcrun and lipo
According to the answers given there Xcode apparently didn't find lipo in the end but unfortunately shows no error message in this case.
After backing up the 10.9 version of /usr/bin/lipo and linking in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo as described in the post creating the universal binaries was working again.
Like many others, I'm taking the CS106B class on iTunes and, although the class is old, I am attempting to use the Stanford C++ libraries that are current. They are found here: http://www.stanford.edu/class/cs106b/.
During the Build Phase of projects, I have inserted into "Link Binary with Libraries" the files "random.h" and "libStanfordCPPlib.a". When I do this, I get the following error messages:
Check dependencies
warning: skipping file '/Users/lewis/Documents/Think Like a Programmer/CS106/VotingSimulation/../../../Programming Abstractions/Assignment 1/Assignment1-xcode/0 - Warmup/StanfordCPPLib/random.h' (unexpected file type 'sourcecode.c.h' in Frameworks & Libraries build phase)
ld: warning: ignoring file /Users/lewis/Documents/Programming Abstractions/Assignment 1/Assignment1-xcode/0 - Warmup/StanfordCPPLib/libStanfordCPPLib.a, file was built for archive which is not the architecture being linked (x86_64): /Users/lewis/Documents/Programming Abstractions/Assignment 1/Assignment1-xcode/0 - Warmup/StanfordCPPLib/libStanfordCPPLib.a
Undefined symbols for architecture x86_64:
"randomChance(double)", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am using Mac OS X 10.7.5 and XCode 4.6.2. I have set the Build Settings Base SDK to OS X 10.7 for both the Project and the Target.
It appears to me that the "libStanfordCPPlib.a" file may be an archive file that I have to unarchive before I can link the implementation code for the header files. Is this what I need to do, and if so, how do I do it? Am I doing something else wrong in linking the files?
I'm a noob and I'd appreciate help from anyone who has been successful in getting the current Stanford CS106B C++ libraries to work in XCode 4.6.2.
I just ran into this problem myself after upgrading to the newest version of xcode (ver. 5.0, OSX ver. 10.8.5).
Try switching the architecture of the project to 32-bit Intel (i386). The default is "Standard Architectures 64-bit Intel (x86_64)".
I'm currently using xcode 6.4 and trying to work through the cs 106b course work, I had the same issue of not being able to run the sample files and assignment files (can be found here btw http://web.stanford.edu/class/archive/cs/cs106b/cs106b.1136/ ). After changing the Architectures for both the Project and Target to 32-bit-intel as listed above I still received errors. I had to take the additional step of changing the OSX deployment target from 10.10 to 10.8 under the Project info.
This allowed the program to build but I received a notification that i needed to install the Java Runtime Environment, and there was no consult output. Installing this did not resolve the issue. I was only able to fully execute the code after installing the Java Development Kit. I am now able to compile all files for the course.
I hope this update helps more recent attempts to access this info.
I hope you've found an answer to your problem by now, but as I was suffering from a similar problem, trying to get xcode 5.1 to compile Warmup.cpp, I thought I'd post my solution for those others trying to get xcode to work with the cs106b libraries.
After struggling with xcode 5.1.1 and 5.0.2, I downloaded xcode 4.6.3 off of the apple dev site, www.developer.apple.com, and trashed the later versions. After installing 4.6.3, I still got errors, but after switching the Architecures for the Project and for the Target, to "32-bit-Intel", as messysaurus suggests, the warmupp.cpp compiled fine. Trying this same technique with xcode 5.1.1 and 5.0.2 yielded no results.
Hope this helps anyone else running into problems.
I'm currently programming an extension to a program, which only supports
i386 (and I am running amd64 Ubuntu 11.10). Whenever I compile my extension source
I need to use the -m32 flag to force 32 bit architecture (otherwise the program will not be able to load my extension). Sooner or later it is inevitable to avoid boost
thanks to its huge and stable library, which leads to my problem.
I want to use the boost filesystem, which uses OS specific function calls, which in turn leads to the requirement of a library file instead of only a header implementation. The problem is; I can't/don't know how to setup the boost filesystem (i386 version) on my amd64 machine. If I download a prebuilt (.deb) package for i386 and install it using -force-architecture it still fails complaining about dependencies.
So basically; how do I setup boost with 32bit (i386) architecture on my (amd64) system?
It seems as if I did it right all along but I was too dumb to realize how to properly link libraries with the GCC linker, coming from a Windows environment. You can easily compile boost libraries by using the -m32 flag and by setting up bjam properly. See the first answer in this question for details: How do I force a 32 bit build of boost with gcc?