Author Topic: g++ no input file  (Read 13632 times)

Offline Varz

  • Single posting newcomer
  • *
  • Posts: 9
g++ no input file
« on: January 21, 2008, 01:33:10 am »
Using build 4830 for Linux

I keep on getting this message after trying to compile anything.  Even after making a new console project in the project wizard and trying to compile it I get this message.  Does anyone know how to fix this?

-------------- Build: Release in fff ---------------

Compiling: main.cpp
g++: no input files
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
 

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: g++ no input file
« Reply #1 on: January 21, 2008, 09:36:59 am »
Certainly not without information.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Varz

  • Single posting newcomer
  • *
  • Posts: 9
Re: g++ no input file
« Reply #2 on: January 22, 2008, 04:03:35 am »
What else do you want?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9595
Re: g++ no input file
« Reply #3 on: January 22, 2008, 08:14:11 am »
What else do you want?
An example project would be nice. We are unable to reproduce otherwise as we don't know anything about what you are trying to compile.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: g++ no input file
« Reply #4 on: January 22, 2008, 11:19:01 am »
What else do you want?
Just a bit more than
Compiling: main.cpp
which doesn't tell anything really. In most cases, the full commandline can tell what's the problem.

Or better yet, a project file, like Morten said.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2252
Re: g++ no input file
« Reply #5 on: January 22, 2008, 04:03:41 pm »
Did you know:
Compiling: Settings -> Compiler and Debugger -> Tab "Other" -> Compiler logging = "Full command line".

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9595
Re: g++ no input file
« Reply #6 on: January 22, 2008, 07:19:11 pm »
Did you know:
Compiling: Settings -> Compiler and Debugger -> Tab "Other" -> Compiler logging = "Full command line".
Hey! Sig piracy detected! ;-) :lol: :lol: :lol:
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Varz

  • Single posting newcomer
  • *
  • Posts: 9
Re: g++ no input file
« Reply #7 on: January 23, 2008, 02:32:09 am »
Okay

-------------- Build: Release in consoletest ---------------

g++ -Wall -fexceptions  main.cpp     -c /home/mark/Documents/CB/consoletest/main.cpp -o obj/Release/main.o
g++: cannot specify -o with -c or -S with multiple files
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
 



[attachment deleted by admin]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9595
Re: g++ no input file
« Reply #8 on: January 23, 2008, 09:38:06 am »
g++ -Wall -fexceptions  main.cpp     -c /home/mark/Documents/CB/consoletest/main.cpp -o obj/Release/main.o
g++: cannot specify -o with -c or -S with multiple files
You see: Being able to see the project makes it clear:
Please remove "main.cpp" as compiler option :shock:. The file arguments are managed by C::B! That's why it's an IDE.... ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: g++ no input file
« Reply #9 on: January 23, 2008, 09:50:20 am »
Quote
g++: no input files
Quote
g++: cannot specify -o with -c or -S with multiple files
Ok, first of all, these are two entirely different error messages.
Regarding the last message (with full commandline provided), the message explains what is wrong, and the commandline shows that main.cpp appears twice. Since -o is given to specify the output file (Code::Blocks always does that), this is ambiguous. The compiler refuses to write two (different) files to the same output file.

Quote
Even after making a new console project in the project wizard and trying to compile it
I'm sorry, but you cannot be telling the truth. I looked at the wizard to rule out a bug in the wizard, and I created a console project which certainly compiles fine without any problems.
I am using rev 4836, which is identical to 4830 in respect of the involved components.

You added main.cpp as a compiler option after creating the console project, either via the "Build Options" menu, or by editing the project file by hand.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Varz

  • Single posting newcomer
  • *
  • Posts: 9
Re: g++ no input file
« Reply #10 on: January 24, 2008, 01:08:40 am »
Yeah that was the one i was stuffing around with to get working I forgot about that.

Offline Varz

  • Single posting newcomer
  • *
  • Posts: 9
Re: g++ no input file
« Reply #11 on: January 27, 2008, 02:44:15 am »
Now I'm having this problem with wx projects:

-------------- Build: Release in wxtest ---------------

g++ -I/usr/local/lib/wx/include/gtk2-ansi-release-2.8 -I/usr/local/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread  -Wall  -O2  'wx-config -cflags'    -c /home/mark/Documents/CB/wxtest/wxtestApp.cpp -o obj/Release/wxtestApp.o
g++: no input files
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
 
That is actually a new project I've attached if you can help.

[attachment deleted by admin]

Offline eranif

  • Regular
  • ***
  • Posts: 254
Re: g++ no input file
« Reply #12 on: January 27, 2008, 07:42:22 am »
Code: [Select]
'wx-config -cflags'Are these backticks? cause they dont seem like backticks to me.
Also, the above command will not work even when using backticks, since they should be writtern with two hyphens (--)
Try replace them with these:
Code: [Select]
`wx-config --cflags`
Another thing, if u r using `wx-config --cflags`, there is no need to add all the flags manually:

So this long compilation line:
Code: [Select]
g++ -I/usr/local/lib/wx/include/gtk2-ansi-release-2.8 -I/usr/local/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread  -Wall  -O2  'wx-config -cflags'    -c /home/mark/Documents/CB/wxtest/wxtestApp.cpp -o obj/Release/wxtestApp.ocan be changed to:
Code: [Select]
g++ -O2  `wx-config --cflags`    -c /home/mark/Documents/CB/wxtest/wxtestApp.cpp -o obj/Release/wxtestApp.o
Eran

Offline Varz

  • Single posting newcomer
  • *
  • Posts: 9
Re: g++ no input file
« Reply #13 on: January 27, 2008, 10:44:16 am »
I just added 'wx-config --cflags' to compiler options and 'wx-config --libs' to the linker options I didn't add them in manually.
Also if I use ` instead of ' it doesn't work at all.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7253
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: g++ no input file
« Reply #14 on: January 27, 2008, 11:05:45 am »
I just added 'wx-config --cflags' to compiler options and 'wx-config --libs' to the linker options I didn't add them in manually.
Also if I use ` instead of ' it doesn't work at all.

It can't work without backticks (`).

Your zipped project (wxtest.zip) works fine for me, no problems.

The error you described happens if you have 'wx-config -cflags' in the "Settings -> Compiler and debugger settings -> Global compiler settings -> GNU GCC Compiler -> Other options".
"g++" then searches for an input file named 'wx-config -cflags' and can't find it of course.

Remove all project-specific settings from Global Compiler settings if you are not 100% sure that you need them for all projects compiled with this compiler.
The wxWidgets specific settings should normally only be in the projects "Build options".