News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

simple problem with path maybe?

Started by noidian, July 31, 2012, 05:55:22 PM

Previous topic - Next topic

noidian

Hi,

I have installed the codeblocks 10.05. on ubuntu lucid.

The problem is the hello world startup throws error:

Compiling: main.cpp
execvp(g++ -Wall -fexceptions  -O2     -c /media/Data/pcie_driver/main.cpp -o /media/Data/pcie_driver/obj/Release/main.o) failed with error 2!
Process terminated with status 255 (0 minutes, 0 seconds)
0 errors, 0 warnings

I have tried changing the  Project->properties and modifying the settings etc.

The command works fine by itself in bash shell.

Any help would be great.

Jenna

Do you have the g++-package installe ?
If yes, what happens, if you use the same command in a console ?

MortenMacFly

Quote from: jens on July 31, 2012, 08:57:16 PM
If yes, what happens, if you use the same command in a console ?
Quote from: noidian on July 31, 2012, 05:55:22 PM
The command works fine by itself in bash shell.

Did you select a different shell in C::B - other than the bash you used fore testing?
Did you use a different parametrisation of the same shell in C::B and for testing?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Jenna

Quote from: MortenMacFly on July 31, 2012, 09:20:46 PM
Quote from: jens on July 31, 2012, 08:57:16 PM
If yes, what happens, if you use the same command in a console ?
Quote from: noidian on July 31, 2012, 05:55:22 PM
The command works fine by itself in bash shell.

Did you select a different shell in C::B - other than the bash you used fore testing?
Did you use a different parametrisation of the same shell in C::B and for testing?

??? Totally overread that, sorry.
What is the compilers masterpath of the toolchain ?

You can try to put the env command in the projects prebuild steps to see, whether the PATH-variable is correct, so g++ can be run.

The return value of 2 of execvp means ENOENT as far as I know.
ENOENT = no such file or directory

noidian

Hi,

Thanks for the responses.

QuoteDid you select a different shell in C::B - other than the bash you used fore testing?
I assume the C::B uses the bash shell by default.  So I am not sure how to go about changing that.


QuoteDid you use a different parametrisation of the same shell in C::B and for testing?
I guess no, since I have no exact idea of how to change out of the bash shell in C::B.

QuoteWhat is the compilers masterpath of the toolchain ?
I went to -> Settings->Compiler and..-> Toolchan exec

in that for g++ is /usr/bin

which I presume is the compiler masterpath, your asking for.

QuoteYou can try to put the env command in the projects prebuild steps to see, whether the PATH-variable is correct, so g++ can be run.

I tried adding /usr/bin to the bash as PATH=$PATH:/usr/bin/g++ , export PATH
Adding that path to the prebuild in Project- > build options, still throws an error 2.
(Is this what you meant?)






Jenna

The masterpath is not correct, there is a red note in the toolchain executables tab, that says, that the master path is the path without the bin !

Just put env in your prebuild step to see what path is used.
/usr/bin should be automatically in path anyways.

What output do you get if you type g++ --version on a console ?

noidian

#6
The masterpath is /usr alone. I have also attached a print screen of the toolchain window.

Adding "env" to the prebuild path gave me this

Running target pre-build steps
env
GDM_KEYBOARD_LAYOUT=us
GNOME_KEYRING_PID=1387
USER=venkak2
HOME=/home/venkak2
XDG_SESSION_COOKIE=74d71d281f69a358b940af214fec4118-1343832244.477641-747832526
DESKTOP_SESSION=gnome
GTK_MODULES=canberra-gtk-module
GNOME_KEYRING_CONTROL=/tmp/keyring-th4bcF
MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path
LOGNAME=venkak2
DEFAULTS_PATH=/usr/share/gconf/gnome.default.path
USERNAME=venkak2
GDM_LANG=en_US.UTF-8
PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/bin:/usr/games
DISPLAY=:0.0
LANG=en_US.UTF-8
XAUTHORITY=/var/run/gdm/auth-for-venkak2-rbxGCm/database
SHELL=/bin/bash
GDMSESSION=gnome
SPEECHD_PORT=7561
PWD=/home/venkak2
XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg
XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/
LIBGL_DRIVERS_PATH=/usr/lib/fglrx/dri:/usr/lib32/fglrx/dri
SSH_AUTH_SOCK=/tmp/keyring-th4bcF/ssh
SSH_AGENT_PID=1441
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-kV2H1bAoFK,guid=2510adacb591559824110b2c501940b4
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
SESSION_MANAGER=local/labroot:@/tmp/.ICE-unix/1405,unix/labroot:/tmp/.ICE-unix/1405
ORBIT_SOCKETDIR=/tmp/orbit-venkak2
G_FILENAME_ENCODING=UTF-8
LD_LIBRARY_PATH=

-------------- Build: Release in newtest ---------------

g++ -Wall -fexceptions  -O2      -c /home/venkak2/newtest/main.cpp -o /home/venkak2/newtest/obj/Release/main.o
execvp(g++ -Wall -fexceptions  -O2      -c /home/venkak2/newtest/main.cpp -o /home/venkak2/newtest/obj/Release/main.o) failed with error 2!
Process terminated with status 255 (0 minutes, 0 seconds)
0 errors, 0 warnings



>>g++ --version

op:  g++ (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3



[attachment deleted by admin]