GCC output directory

G

Gernot Frisch

Might b e a bit OT, but I know there's lots of you who can help
quickly.

Is there any way to let gcc/g++ output the .o files in a folder I can
specify?

Thank you for not flaming,

-Gernot
int main(int argc, char** argv) {printf
("%silto%c%cf%cgl%ssic%ccom%c", "ma", 58, 'g', 64, "ba", 46, 10);}
 
B

benben

Gernot said:
Might b e a bit OT, but I know there's lots of you who can help
quickly.

Is there any way to let gcc/g++ output the .o files in a folder I can
specify?

What's wrong with g++ followed by a cp?
 
I

Ian Collins

Gernot said:
Might b e a bit OT, but I know there's lots of you who can help
quickly.

Is there any way to let gcc/g++ output the .o files in a folder I can
specify?
-o is a common compiler switch to specify the output file name.
 
G

Gernot Frisch

What's wrong with g++ followed by a cp?

in my case "mv". The files are generated in the directory of the
g++.exe. But the compiler directory might be read only to a normal
user, so it would be nice if I could tell it to use another one in the
first place...
 
O

Owen Jacobson

in my case "mv". The files are generated in the directory of the
g++.exe. But the compiler directory might be read only to a normal
user, so it would be nice if I could tell it to use another one in the
first place...

I think you'll find they're placed in the current directory, not the
directory containing gcc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

int(a) vs (int)a 19
reference to parent inherritance? 9
unreachable code? 4
gcc strange error 2
queue where I can delete in the middle? 3
date comparison 2
OT: CVS 4
a[3} slower than a.x; a.z; a.z 27

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,126
Latest member
FastBurnketoIngredients
Top