Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » cannot specify -o with -c or -S and multiple compilations?

This thread is locked; no one can reply to it. rss feed Print
cannot specify -o with -c or -S and multiple compilations?
Gnatinator
Member #2,330
May 2002
avatar

ERROR: cannot specify -o with -c or -S and multiple compilations

Could anyone please tell me what that linking error means??

spellcaster
Member #1,493
September 2001
avatar

What was your commandline?

--
There are no stupid questions, but there are a lot of inquisitive idiots.

mEmO
Member #1,124
March 2001
avatar

Very difficult to say without more info. Are you using Dev-C++ or command line? If it's command line it might be an error in you setup

g++ -c myfile.cpp -o myfile.o -s
g++ myfile.o -lalleg -o myexe.exe -s

That should do the trick (assuming you only use allegro, that is). If it's Dev-Cpp I don't know exactly what cause it. It might be an error in your setup; I don't know.

---------------------------------------------
There is only one God, and Connor is his son!
http://www.memocomputers.com
Happy birthday!

spellcaster
Member #1,493
September 2001
avatar

My guess would be that you're commandline arguements would imply linking, but you've specified either -c or -S so it's not allowed to link.

--
There are no stupid questions, but there are a lot of inquisitive idiots.

23yrold3yrold
Member #1,134
March 2001
avatar

Your files have spaces in their names.
We will now stone you.

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

spellcaster
Member #1,493
September 2001
avatar

Quote:

We will now stone you.

"Are there any women here today?"

Ehh, all right. Two points, ah, two flats, and a packet of gravel.

:)

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Gnatinator
Member #2,330
May 2002
avatar

No spaces, +, - etc in my files...

I am using Dev-c++ 5, but this also happens with the same code in Djgpp w/ RHIDE.

ERRORS:
1. cannot specify -o with -c or -S and multiple compilations

2. ../hello/main.o: No such file or directory

I know there are not any object files. Dosent Dev-c++ generate them for you?

The error also states that the file that it is getting the error in also is named: G_~1.EXE

My program is only one file and it is: main.cpp

Me wonders if I need to reinstall...:(

spellcaster
Member #1,493
September 2001
avatar

Just doens't give us any useful information. Avoid giving us the commandline supplied for the compiler at all costs.
It's way funnier if we try to guess what's happening.

Try to give us some hints which lead in different directions. You could try to mention VC and linux for example. Or that you don't understand why it does generate a core file instead of an .exe or something.

On the other hand, maybe you don't want a solution? And you just use this thread to chat about the problem? Like to release steam? Now then it's ok.

Quote:

Me wonders if I need to reinstall...:(

Re-install what? Windows? On the Linux partition of your iMac?

Maybe you should simply try to generate a new project in Dev-cpp and try again.

On the other hand reinstalling might be more fun. It also sounds better.

Make sure you print the docs to dev-cpp / the FAQ, etc. before you reinstall, so you have something to read during the installation process.

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Evert
Member #794
November 2000
avatar

What version of MinGW are you using (note: MinGW, the compiler, not Dev-C++, the IDE)?

Thomas Fjellstrom
Member #476
June 2000
avatar

Is DevC++ installed in C:\Program Files? If so, then there IS a space in your filenames ;)

[edit] w0w. Im full of nothing today. ;)

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Gnatinator
Member #2,330
May 2002
avatar

Ooops sorry bout that spellcaster.

Heres the compile log:

Compiler: Default compiler
Building Makefile: "C:\hello\Makefile.win"
Executing make...
make.exe -f "C:\hello\Makefile.win" all
g++.exe -c main.cpp -o ../hello/main.o -I"C:/DEVCPP/include" -I"C:/DEVCPP/include/c++" -I"C:/DEVCPP/include" C:\DevCpp\lib\liballeg.a

G__~1.EXE: cannot specify -o with -c or -S and multiple compilations

g++.exe ../hello/main.o -o "hello.exe" -L"C:/DEVCPP/lib" -I"C:/DEVCPP/include" -I"C:/DEVCPP/include/c++" -I"C:/DEVCPP/include" C:\DevCpp\lib\liballeg.a

G__~1.EXE: ../hello/main.o: No such file or directory

Execution terminated

EDIT
[
No Dev-c++ is not in Program files, its right here:
C:\devcpp

And I am using Mingw/GCC 3.2
]

spellcaster
Member #1,493
September 2001
avatar

You're specifying the allegro library in the compile call.
That won't work.

Make sure you put it in the lib section of the settings.

I don't know dev-cpp but I guess you should be able to find a link tab with a libs text entry field.

Oh: see how posting the cmd line helps?

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Gnatinator
Member #2,330
May 2002
avatar

Haha, cool now it works.
Thanks a lot spellcaster.

I was specifying the allegro library in the compile call.

spellcaster
Member #1,493
September 2001
avatar

Glad I could help. I'm also glad you didn't take my small rant above personally ;)

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Go to: