help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to collapse the two g++ lines to one


From: Simon Buchan
Subject: Re: How to collapse the two g++ lines to one
Date: Fri, 23 Sep 2005 22:40:19 +1200
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

Ulrich Eckhardt wrote:
Stephan Strauss wrote:

How is it possible to collapse these two lines into one:


g++ -Wall -I/usr/include -g -c -o accumaa.o accumaa.c

g++ -Wall -I/usr/include -L/usr/X11R6/lib -o accumaa -lX11 -lXi -lXmu
-lglut -lGL -lGLU -lm accumaa.o


One thing first: you should put the libs that are linked to after the files
that link to them. Other than that, it isn't possible, except if you can
live without the file accumaa.o; in that case, try this:

g++ -Wall -o accumaa accumaa.c -lX11 -lglut -lGLU ..

Well, not _quite_ true. One could cheat and use ';', or tell it to --keep-temps (which also gives you .ii and .s files as well).
BTW: it is customary to call C++ sources .cc, .cxx, .C or most often .cpp.

Uli

It tells the compiler what language it is, otherwise you should use
-x c++





reply via email to

[Prev in Thread] Current Thread [Next in Thread]