I have some cpp files that I would like to compile it in order to run on simulator and iPhone. What I am trying to do is:
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 easy way I can edit these 2 line of command in order to have a library compiled for all architectures (x86_64 i386 armv7 armv7s arm64)? Or should I build some huge scripts to have that library? If so? Is there any ready scripts for that?
I have also tried to run it using -arch:
g++ -c file1.cpp file2.cpp -std=c++11 -arch armv7 -arch x86_64
but these are some errors I'm getting
//----------------- Error 1 -------------------------//
//----------------- Error 2 -------------------------//
//----------------- Error 3 -------------------------//
Thanks!
Have you considered the -arch
compiler flag ?
g++ -c file1.cpp file2.cpp -std=c++11 -arch x86_64 -arch i386 -arch armv7 #...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With