Code::Blocks

User forums => Help => Topic started by: Varz on January 21, 2008, 01:33:10 am

Title: g++ no input file
Post by: Varz 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
 
Title: Re: g++ no input file
Post by: thomas on January 21, 2008, 09:36:59 am
Certainly not without information.
Title: Re: g++ no input file
Post by: Varz on January 22, 2008, 04:03:35 am
What else do you want?
Title: Re: g++ no input file
Post by: MortenMacFly 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.
Title: Re: g++ no input file
Post by: thomas 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.
Title: Re: g++ no input file
Post by: Pecan on January 22, 2008, 04:03:41 pm
Did you know:
Compiling: Settings -> Compiler and Debugger -> Tab "Other" -> Compiler logging = "Full command line".
Title: Re: g++ no input file
Post by: MortenMacFly 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:
Title: Re: g++ no input file
Post by: Varz 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]
Title: Re: g++ no input file
Post by: MortenMacFly 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.... ;-)
Title: Re: g++ no input file
Post by: thomas 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.
Title: Re: g++ no input file
Post by: Varz 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.
Title: Re: g++ no input file
Post by: Varz 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]
Title: Re: g++ no input file
Post by: eranif 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
Title: Re: g++ no input file
Post by: Varz 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.
Title: Re: g++ no input file
Post by: jens 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".

Title: Re: g++ no input file
Post by: Varz on January 28, 2008, 02:32:19 am
I read somewhere to add 'wx-config --cflags' and 'wx-config --libs' to solve this problem:


-------------- 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  -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     -c /home/mark/Documents/CB/wxtest/wxtestApp.cpp -o obj/Release/wxtestApp.o
In file included from /home/mark/Documents/CB/wxtest/wxtestApp.cpp:10:
/home/mark/Documents/CB/wxtest/wxtestApp.h:13:20: error: wx/app.h: No such file or directory
In file included from /home/mark/Documents/CB/wxtest/wxtestApp.cpp:13:
/home/mark/Documents/CB/wxtest/wxtestMain.h:14:22: error: wx/sizer.h: No such file or directory
/home/mark/Documents/CB/wxtest/wxtestMain.h:15:25: error: wx/stattext.h: No such file or directory
/home/mark/Documents/CB/wxtest/wxtestMain.h:16:25: error: wx/statline.h: No such file or directory
/home/mark/Documents/CB/wxtest/wxtestMain.h:17:23: error: wx/button.h: No such file or directory
/home/mark/Documents/CB/wxtest/wxtestMain.h:18:23: error: wx/dialog.h: No such file or directory
/home/mark/Documents/CB/wxtest/wxtestApp.cpp:14:22: error: wx/image.h: No such file or directory
/home/mark/Documents/CB/wxtest/wxtestApp.h:16: error: expected class-name before ‘{’ token
/home/mark/Documents/CB/wxtest/wxtestApp.h:16: warning: ‘class wxtestApp’ has virtual functions but non-virtual destructor
/home/mark/Documents/CB/wxtest/wxtestMain.h:22: error: expected class-name before ‘{’ token
/home/mark/Documents/CB/wxtest/wxtestMain.h:25: error: expected `)' before ‘*’ token
/home/mark/Documents/CB/wxtest/wxtestMain.h:31: error: ‘wxCommandEvent’ has not been declared
/home/mark/Documents/CB/wxtest/wxtestMain.h:32: error: ‘wxCommandEvent’ has not been declared
/home/mark/Documents/CB/wxtest/wxtestMain.h:43: error: ISO C++ forbids declaration of ‘wxButton’ with no type
/home/mark/Documents/CB/wxtest/wxtestMain.h:43: error: expected ‘;’ before ‘*’ token
/home/mark/Documents/CB/wxtest/wxtestMain.h:44: error: ISO C++ forbids declaration of ‘wxStaticText’ with no type
/home/mark/Documents/CB/wxtest/wxtestMain.h:44: error: expected ‘;’ before ‘*’ token
/home/mark/Documents/CB/wxtest/wxtestMain.h:45: error: ISO C++ forbids declaration of ‘wxBoxSizer’ with no type
/home/mark/Documents/CB/wxtest/wxtestMain.h:45: error: expected ‘;’ before ‘*’ token
/home/mark/Documents/CB/wxtest/wxtestMain.h:46: error: ISO C++ forbids declaration of ‘wxButton’ with no type
/home/mark/Documents/CB/wxtest/wxtestMain.h:46: error: expected ‘;’ before ‘*’ token
/home/mark/Documents/CB/wxtest/wxtestMain.h:47: error: ISO C++ forbids declaration of ‘wxStaticLine’ with no type
/home/mark/Documents/CB/wxtest/wxtestMain.h:47: error: expected ‘;’ before ‘*’ token
/home/mark/Documents/CB/wxtest/wxtestMain.h:48: error: ISO C++ forbids declaration of ‘wxBoxSizer’ with no type
/home/mark/Documents/CB/wxtest/wxtestMain.h:48: error: expected ‘;’ before ‘*’ token
/home/mark/Documents/CB/wxtest/wxtestMain.h:51: error: ISO C++ forbids declaration of ‘DECLARE_EVENT_TABLE’ with no type
/home/mark/Documents/CB/wxtest/wxtestMain.h:52: error: expected ‘;’ before ‘}’ token
/home/mark/Documents/CB/wxtest/wxtestMain.h:52: error: expected `;' before ‘}’ token
/home/mark/Documents/CB/wxtest/wxtestApp.cpp:17: error: expected constructor, destructor, or type conversion before ‘;’ token
/home/mark/Documents/CB/wxtest/wxtestApp.cpp: In member function ‘virtual bool wxtestApp::OnInit()’:
/home/mark/Documents/CB/wxtest/wxtestApp.cpp:23: error: ‘wxInitAllImageHandlers’ was not declared in this scope
/home/mark/Documents/CB/wxtest/wxtestApp.cpp:26: error: no matching function for call to ‘wxtestDialog::wxtestDialog(int)’
/home/mark/Documents/CB/wxtest/wxtestMain.h:22: note: candidates are: wxtestDialog::wxtestDialog()
/home/mark/Documents/CB/wxtest/wxtestMain.h:22: note:                 wxtestDialog::wxtestDialog(const wxtestDialog&)
/home/mark/Documents/CB/wxtest/wxtestApp.cpp:27: error: ‘SetTopWindow’ was not declared in this scope
/home/mark/Documents/CB/wxtest/wxtestApp.cpp:28: error: ‘class wxtestDialog’ has no member named ‘ShowModal’
Process terminated with status 1 (0 minutes, 0 seconds)
32 errors, 1 warnings
 

Title: Re: g++ no input file
Post by: thomas on January 28, 2008, 08:49:44 am
This problem comes from not having the wxWidgets includes in the include path. It can be solved in several ways, one is inserting the output of wx-config into the build commandline as "extra option".
However, as eranif already pointed out, it will only work with backticks, not with quotes.
Title: Re: g++ no input file
Post by: Varz on January 28, 2008, 09:51:30 am
That last error message is from a new project with no options added and it has the output of wx-config --cflags already included in the build command:
-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
I'll just remove any options I added.

wx-config must be wrong because I looked in the directories it lists "/usr/local/lib/wx/include/gtk2-ansi-release-2.8" and "/usr/local/include/wx-2.8" and there is no app.h, sizer.h, stattext.h or any other file mentioned as being missing in the build log.

Does anyone know where these files are typically installed to?  I tried searching and I couldn't find them.


Title: Re: g++ no input file
Post by: Varz on January 29, 2008, 01:57:34 am
nvm it works now I installed it again, this time from the source.
Thx for your help.