V
Victor Bazarov
cplusplus said:Hi, I just started a C++ cource in school and am using
gcc --version 3.3.1 (Suse Linux 9.0). Everything is
working great except I need to have the exacuatable in
".exe" format and be able to run on a windows machine.
I asked my teacher how this could be done and he told
me by using the "-o" option or I could
simply rename the a.out file to "helloworld.exe".
Your teacher played a cruel joke on you. The name of the
file and the internal format of the executable are not at
all connected.
I used the following command:
g++ -ansi -pedantic -Wall -o helloworld.exe helloworld.cpp
It works great, but I was a bit skeptical so I put the file
on a floppy and tried opening it on a windows machine. The
file wont open and says that there is an error reading the file.
I assume this is because the program is a linux exacuatable file.
Is there a command I can use to make it an actual windows .EXE file?
No.
I tried looking through the man page and just couldn't find it.
You need what is known as a "cross-compiler". The compiler
that comes with your OS is only going to produce executables
for that OS.
Please ask in a newsgroup dedicated to your platform (either
one would do) since here it is off-topic. Yours is not a C++
_language_ problem but a C++ _compiler_ problem.
Victor