I have some cpp files that I would like to compile to run on a simulator and iPhone. I am trying to do this:
g++ -c file1.cpp file2.cpp -std=c++11 ar rcs libabc.a *.o
And this compiles fine, but only for x86_64 architecture. Obviously ...
Is there any simple way I can edit these two lines of the command to have a library compiled for all architectures (x86_64 i386 armv7 armv7s arm64)? Or should I build some huge scripts to have this library? If so? Are there any scripts for this?
I also tried running it with -arch:
g++ -c file1.cpp file2.cpp -std=c++11 -arch armv7 -arch x86_64
but these are some errors that I get



Thanks!
source share