News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Can't compile on Gentoo

Started by Leo.J90, November 24, 2010, 11:31:09 AM

Previous topic - Next topic

Leo.J90

I'm trying to compile and get this on build log:
QuoteChecking for existence: /home/leo/Documents/AdPa/bin/Release/AdPa
Executing: xterm -T AdPa -e /usr/bin/cb_console_runner LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. /home/leo/Documents/AdPa/bin/Release/AdPa  (in /home/leo/Documents/AdPa/.)
Process terminated with status 255 (0 minutes, 0 seconds)

I don't understand what's the problem. From console if i do "g++ -Wall main.cpp Func.h -o AdPa" everything works fine.
"Don't think about the work, think about the benefit"

Jenna

Why do you think compilation does not work ?
I can see nothing about that in your build log snippet.

Do you have xterm installed ?

thomas

This 255 value comes from line 73 in consolerunner/main.cpp:
int ret = system(cmdline);.

man system(3) says: "The value returned is -1 on error (e.g. fork() failed), and the return status of the command otherwise". The valid xterm error codes are in the range [1,45], which rules out clause no. 2.

Which means that (assuming your computer isn't unable to fork() because it has a million processes running) in all likelihood you either don't have xterm installed at all or it is not in the path, or something the like.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

oBFusCATed

Thomas, Jens: Do you know if it is possible to make cb_console_runner to spit an error when terminal launching fails?
This problem is happening quite too often and there is no clue for the user how to fix it on his/her own.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Leo.J90

Well, that's true i forgot to install xterm. :?

Thanks!
"Don't think about the work, think about the benefit"

thomas

Quote from: oBFusCATed on November 24, 2010, 12:55:20 PM
Thomas, Jens: Do you know if it is possible to make cb_console_runner to spit an error when terminal launching fails?
Well, that'd be something like changing that line 73 to:
int ret;
if((ret = system(cmdline)) == -1) printf("Error: failed to launch xterm. Make sure xterm is installed on your system");


Should be as trivial as that, but I have no Linux system to test.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Jenna

Quote from: thomas on November 24, 2010, 05:25:41 PM
Quote from: oBFusCATed on November 24, 2010, 12:55:20 PM
Thomas, Jens: Do you know if it is possible to make cb_console_runner to spit an error when terminal launching fails?
Well, that'd be something like changing that line 73 to:
int ret;
if((ret = system(cmdline)) == -1) printf("Error: failed to launch xterm. Make sure xterm is installed on your system");


Should be as trivial as that, but I have no Linux system to test.

If the terminal does not exist (xterm in this case, but others can be configured), cb_console_runner will not be started, because cb_console_runner is executed inside the termnal and not vice-versa.

So the correct place to check for the return-value would be in CompilerGCC::OnJobEnd, but only if we tried to run the exe and not after compiling or whatever.
So it's not just as trivial as it looks at first time.