[dundee] How to compile

Jonathan Barber dundee at lists.lug.org.uk
Tue Jun 3 12:03:02 2003


On Tue, Jun 03, 2003 at 10:17:30AM +0100, Mark Harrigan wrote:
> On Tue, Jun 03, 2003 at 09:47:47AM +0100, Keir Lawson wrote:
> > Im trying (and failing thanks to pointers) to learn C++ and am using
> > anjuta/g++ to do so. however since i upgraded to mandrake 9.1 when I try
> > to compile with the command g++ -o test.cpp test.o it compiles correctly
> > but when it try to execute it (./test.o) it says "cannot execute binary
> > file"  this used to work on my old install.
> > 
> > keir
> 
> That shouldn't ever have worked :), though it's close. The proper
> syntax would be g++ -o test.o test.cpp. Now if that doesn't work it
> starts to get interesting. 

You shouldn't really be compiling to a files with a .o suffix either, as
this is traditionally the suffix for object files rather than
executables, and will confuse other programs (such as make) that can be
useful.
-- 
Jon