When I compile my program without optimization flag, it works fine g++ -std=c++11 -o app `xml2-config --cflags` app.cpp `xml2-config --libs` -static-libgcc -static-libstdc++
When I try g++ -std=c++11 -o3 app `xml2-config --cflags` app.cpp `xml2-config --libs` -static-libgcc -static-libstdc++
I get this error g++: error: app: No such file or directory
What's the solution?
-o is not related to optimization, don't replace it. Add the -O3 flag somewhere else. The -o flag expects the output filename to appear after it. Also, I believe flags are case sensitive.