c++ - Trying to compile .cpp with g++ for 64 bit windows -


first tried downloading after searching mingw64 windows. didn't work. while searching solution came across this, answer includes seems legit version of mingw64.

this being third or fourth mingw64 i've downloaded, happy see g++64.exe assumed take care of everything. doesn't, after compiling g++64 -o hello.exe -c hello.cpp , running hello error saying this version of [...]\hello.exe not compatible[...].

what doing wrong? i've tried -m64. there additional setting need change? should post g++64 -v?

your command wrong, you're not creating .exe file, object file need link produce executable. this:

g++64 -o hello.exe hello.cpp 

the -c argument tells compiler compile not link code. can above in 2 steps, compile , link:

g++64 -c -o hello.o  hello.cpp g++64 -o hello.exe hello.o 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -