Author Topic: can't compile anything (please help a newbee!)[solved]  (Read 4587 times)

Offline pelyot

  • Single posting newcomer
  • *
  • Posts: 5
can't compile anything (please help a newbee!)[solved]
« on: September 01, 2007, 11:12:52 pm »
I can't compile any program, the same error occurs:
Code
-------------- Build: Debug in test ---------------
Compiling: main.cpp
/bin/sh: Syntax error: "(" unexpected
Process terminated with status 2 (0 minutes, 0 seconds)
0 errors, 0 warnings
 
Somebody knows what to do?
« Last Edit: September 02, 2007, 06:53:48 pm by pelyot »

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: can't compile anything (please help a newbee!)
« Reply #1 on: September 02, 2007, 12:22:28 am »
Which os? version or revision of C::B? Without that we don't know anything...
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline pelyot

  • Single posting newcomer
  • *
  • Posts: 5
Re: can't compile anything (please help a newbee!)
« Reply #2 on: September 02, 2007, 12:30:16 am »
sorru for the lack of detail:
I'm on kubuntu 7.04 and the CB build is the 4413;
Thanks for any help!

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9613
Re: can't compile anything (please help a newbee!)
« Reply #3 on: September 02, 2007, 12:49:22 pm »
sorru for the lack of detail:
Well - could you give as a minimal project that files? Could you enable full command line logging and post the log (see my sig)?
With regards, Morten.

Ps.: Imagine the following error report: "My windows does not work. It crashes. Can you help me?" What help would you expect?! ;-)
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 pelyot

  • Single posting newcomer
  • *
  • Posts: 5
Re: can't compile anything (please help a newbee!)
« Reply #4 on: September 02, 2007, 05:08:28 pm »
with the full command line logging, I get this message:
Code
-------------- Build: Debug in test ---------------
g++ -Wall -fexceptions -g  -I/usr/include  -c /home/pelyot/C++(devel)/myProjects/temp/test/main.cpp -o obj/Debug/main.o
/bin/sh: Syntax error: "(" unexpected
Process terminated with status 2 (0 minutes, 0 seconds)
0 errors, 0 warnings
 
(and this for every file, or every project I try to compile, even this basic console "hello world")

Offline raph

  • Almost regular
  • **
  • Posts: 242
Re: can't compile anything (please help a newbee!)
« Reply #5 on: September 02, 2007, 05:20:00 pm »
Rename folder C++(devel) to something without braces.

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: can't compile anything (please help a newbee!)
« Reply #6 on: September 02, 2007, 05:22:13 pm »
Code
-------------- Build: Debug in test ---------------
g++ -Wall -fexceptions -g  -I/usr/include  -c /home/pelyot/C++(devel)/myProjects/temp/test/main.cpp -o obj/Debug/main.o
/bin/sh: Syntax error: "(" unexpected
Process terminated with status 2 (0 minutes, 0 seconds)
0 errors, 0 warnings
 

Maybe if you remove the parenthesis from the folder C++(devel) it will work. Try using CPPDevel instead of C++(devel)

Offline pelyot

  • Single posting newcomer
  • *
  • Posts: 5
Re: can't compile anything (please help a newbee!)
« Reply #7 on: September 02, 2007, 05:32:02 pm »
Thanks, but I now get this: :(
Code
-------------- Build: Debug in test ---------------
g++ -Wall -fexceptions -g   -c /home/pelyot/C++Devel/myProjects/temp/test/main.cpp -o obj/Debug/main.o
/bin/sh: g++: not found
Process terminated with status 127 (0 minutes, 0 seconds)
0 errors, 0 warnings
 

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: can't compile anything (please help a newbee!)
« Reply #8 on: September 02, 2007, 05:35:24 pm »
you got to install GCC, search on synaptic for GCC or build essentials I think

Edit:
You can try on a console:
sudo apt-get install build-essential
« Last Edit: September 02, 2007, 05:37:44 pm by JGM »

Offline pelyot

  • Single posting newcomer
  • *
  • Posts: 5
Re: can't compile anything (please help a newbee!)
« Reply #9 on: September 02, 2007, 05:39:26 pm »
I thought g++ was already installed on kunbuntu...
But it now works very well :D. Thanks a lot!

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: can't compile anything (please help a newbee!)[solved]
« Reply #10 on: September 03, 2007, 10:42:25 am »
I'm surprised this doesn't work... () is not illegal in a path, is it?

Especially under Linux, where you can name a file foo*?bar.c too, if you think that it's a good idea (it is not, but you can do it). But seriously, no joking... files like foo-1.4.3-15(2).tar.gz aren't entirely uncommon, so the same thing should really work with Code::Blocks too :)

Maybe we need to quote filenames more rigorously, not only if they contain spaces. It seems that gcc calls sh for some of its work, and the shell believes it has to do something about the unquoted (). Does that seem about right? So... we should make sure it doesn't.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."