User forums > Help

Ubuntu 13.04, codeblocks would not compile.

<< < (3/5) > >>

Wyrm:

--- Quote from: vasilenko93 on August 19, 2013, 04:45:45 pm ---I went into Environment settings and tried changing "Shell to run commands with:" to /bin/bash. Here is the result after I clicked build.

--- Code: ---
-------------- Build: Debug in testProject (compiler: GNU GCC Compiler)---------------

g++ -Wall -fexceptions -g  -c /home/USER_NAME/Programing/testProject/main.cpp -o obj/Debug/main.o
/bin/bash: g++ -Wall -fexceptions -g  -c /home/USER_NAME/Programming/testProject/main.cpp -o obj/Debug/main.o: No such file or directory
Process terminated with status 127 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))

--- End code ---

Same thing happens with the default /bin/sh.

--- Code: ---
-------------- Build: Debug in testProject (compiler: GNU GCC Compiler)---------------

g++ -Wall -fexceptions -g  -c /home/USER_NAME/Programing/testProject/main.cpp -o obj/Debug/main.o
/bin/sh: 0: Can't open g++ -Wall -fexceptions -g  -c /home/USER_NAME/Programming/testProject/main.cpp -o obj/Debug/main.o
Process terminated with status 127 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))

--- End code ---

I tried clicking both Debug and Release, with both shell programs. Still shows this error message.

--- End quote ---

You see this message because path "obj/Debug/main.o" is invalid on Linux. You need to change your configuration to something like "./obj/Debug/main.o" or "/full/path/to/obj/Debug/main.o".

Jenna:

--- Quote from: Wyrm on August 20, 2013, 08:14:56 am ---
--- Quote from: vasilenko93 on August 19, 2013, 04:45:45 pm ---I went into Environment settings and tried changing "Shell to run commands with:" to /bin/bash. Here is the result after I clicked build.

--- Code: ---
-------------- Build: Debug in testProject (compiler: GNU GCC Compiler)---------------

g++ -Wall -fexceptions -g  -c /home/USER_NAME/Programing/testProject/main.cpp -o obj/Debug/main.o
/bin/bash: g++ -Wall -fexceptions -g  -c /home/USER_NAME/Programming/testProject/main.cpp -o obj/Debug/main.o: No such file or directory
Process terminated with status 127 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))

--- End code ---

Same thing happens with the default /bin/sh.

--- Code: ---
-------------- Build: Debug in testProject (compiler: GNU GCC Compiler)---------------

g++ -Wall -fexceptions -g  -c /home/USER_NAME/Programing/testProject/main.cpp -o obj/Debug/main.o
/bin/sh: 0: Can't open g++ -Wall -fexceptions -g  -c /home/USER_NAME/Programming/testProject/main.cpp -o obj/Debug/main.o
Process terminated with status 127 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))

--- End code ---

I tried clicking both Debug and Release, with both shell programs. Still shows this error message.

--- End quote ---

You see this message because path "obj/Debug/main.o" is invalid on Linux. You need to change your configuration to something like "./obj/Debug/main.o" or "/full/path/to/obj/Debug/main.o".

--- End quote ---

Sorry to say. but this is absolutely bullshit !!

What you mean is, that you have to prepend ./ to run executables from inside the folder they reside in.
This is not needed for the output or the input. Try e.g. redirecting with < or >.
This is also not needed if the exe is in a subfolder, in this case [relative_path_to_folder/[exe] is enough.
By the way. the single dot is just the relative path to the actual subfolder, so no difference to my last exampl.

Wyrm:
Jens, you are right you can use it.

That said, I am still reasonably sure that in his case either (a) his current working directory is wrong or (b) Debug directory doesn't exists before he calls it. Directories Debug or Release may not exist if he deletes them on "make clean". Current working directory may be wrong if he calls it from another script or chain of scripts/tools.

If my conjecture is correct, please right click on the project -> Properties -> Select "Build targets" tab. On this tab, for both debug and release targets change "Objects output dir.:" to "./" and "Execution working dir.:" to "./". Remember to do it for both targets or at least for the one that you intend to test. Save settings and try compiling again. I know Jens will probably object but I'd encourage you to give it a try.

Jenna:
Don't do that or you get debug and release object files mixed and this might or might not work.

Try the exact same command from exact same folder (projects root folder), if that works, check the user that C::B really runs as and make sure no non-ascii characters are in the path (not even in username) given to the compiler or all discussion here is just a waste of time.

vasilenko93:

--- Quote from: jens on August 20, 2013, 06:29:26 pm ---Don't do that or you get debug and release object files mixed and this might or might not work.

Try the exact same command from exact same folder (projects root folder), if that works, check the user that C::B really runs as and make sure no non-ascii characters are in the path (not even in username) given to the compiler or all discussion here is just a waste of time.

--- End quote ---

Running the same command from terminal gives no errors. And when it comes to the user that runs codeblocks, its me I think.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version