Author Topic: Can't compile on Gentoo  (Read 7682 times)

Offline Leo.J90

  • Multiple posting newcomer
  • *
  • Posts: 30
  • Programming & Reverse Engineering
Can't compile on Gentoo
« on: November 24, 2010, 11:31:09 am »
I'm trying to compile and get this on build log:
Quote
Checking 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"

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Can't compile on Gentoo
« Reply #1 on: November 24, 2010, 11:39:21 am »
Why do you think compilation does not work ?
I can see nothing about that in your build log snippet.

Do you have xterm installed ?

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Can't compile on Gentoo
« Reply #2 on: November 24, 2010, 12:33:11 pm »
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."

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Can't compile on Gentoo
« Reply #3 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?
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!]

Offline Leo.J90

  • Multiple posting newcomer
  • *
  • Posts: 30
  • Programming & Reverse Engineering
Re: Can't compile on Gentoo
« Reply #4 on: November 24, 2010, 02:24:20 pm »
Well, that's true i forgot to install xterm. :?

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

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Can't compile on Gentoo
« Reply #5 on: November 24, 2010, 05:25:41 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."

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Can't compile on Gentoo
« Reply #6 on: November 25, 2010, 12:10:53 am »
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.