0

I am trying to run this code a file called make-simple.sh from cygwin with sh make-simple.sh This file contains the following code needed to compile a main.cpp file

#!/bin/bash
g++ -c -arch i386 -arch x86_64 -O3 -fno-tree-pre -fno-strict-aliasing -DNDEBUG -msse3 -mssse3 -I/usr/include/nite -I/usr/include/ni -DXN_SSE -o Release/main.o ../SingleControl/main.cpp
g++ -o ./SingleControl ./Release/main.o ./Release/signal_catch.o ./Release/kbhit.o -arch i386 -arch x86_64  -L../Bin -lOpenNI -lXnVNite

I think that this works only on Mac. Is it possible to make it work under Windows with cygwin?

Thank you.

1 Answer 1

0

Pass only a single -arch value.

EDIT: or better, none at all. Like this:

#!/bin/bash
g++ -c -O3 -fno-tree-pre -fno-strict-aliasing -DNDEBUG -msse3 -I/usr/include/nite -I/usr/include/ni -DXN_SSE -o Release/main.o ../SingleControl/main.cpp
g++ -o ./SingleControl ./Release/main.o ./Release/signal_catch.o ./Release/kbhit.o -L../Bin -lOpenNI -lXnVNite
4
  • Still getting the "g++: x86_64: No such file or directory" error. Maybe is not a Mac to Windows issue as I thought. Thank you
    – Mircea
    May 12, 2011 at 16:07
  • You need to remove both the option and the value. May 12, 2011 at 16:08
  • #!/bin/bash g++ -c -O3 -fno-tree-pre -fno-strict-aliasing -DNDEBUG -msse3 -mssse3 -I/usr/include/nite -I/usr/include/ni -DXN_SSE -o Release/main.o ../SingleControl/main.cpp g++ -o ./SingleControl ./Release/main.o ./Release/signal_catch.o ./Release/kbhit.o -L../Bin -lOpenNI -lXnVNite
    – Mircea
    May 12, 2011 at 16:10
  • the error is now: No such file or directorycpp g++: no input files ./Release/main.o: file not recognized: File format not recognized
    – Mircea
    May 12, 2011 at 16:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.