Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: lingiro on April 09, 2015, 12:58:21 pm

Title: problems in compiling/executing simple programs on Ubuntu 14.04
Post by: lingiro on April 09, 2015, 12:58:21 pm
Hello,

I'm not able to make the release 13.12 working on my system Ubuntu 14.04.
With previous codeblock-release/system (Ubuntu 12.04) no problems.
Now it seems that it doesn't find the object file in the designed directory. Probably it's only a problem of default path-setting, but I'm not able to see where to set it.
The followings are the results of compiling/executing a simple program in a C file (paroladentro.c):

Buid messages
||warning: -c: File o directory non esistente [enabled by default]|
||=== Build failed: 0 error(s), 1 warning(s) (0 minute(s), 0 second(s)) ===|

Build log
gcc -march=corei7 -Wshadow -Winit-self -Wredundant-decls -Wcast-align -Wundef -Wfloat-equal -Winline -Wunreachable-code -Wmissing-declarations -Wmissing-include-dirs -Wswitch-enum -Wswitch-default -Wmain -Wfatal-errors -Wextra -Wall -ansi -I/home/linoski/Cprogr -I/home/linoski/Cprogr -I -c /home/linoski/Cprogr/paroladentro.c -o /home/linoski/Cprogr/paroladentro.o

cc1: warning: -c: File o directory non esistente [enabled by default]
g++  -o /home/linoski/Cprogr/paroladentro /home/linoski/Cprogr/paroladentro.o 
/bin/sh: 1: g++: not found
 
Checking for existence: /home/linoski/Cprogr/paroladentro

At running
It seems that this file has not been built yet.
Do you want to build it now?
Process terminated with status 127 (0 minute(s), 0 second(s))
0 error(s), 1 warning(s) (0 minute(s), 0 second(s))

Further observations:
1) paraoladentro.c and paroladentro.o exist in /home/linoski/cprogr
2) all permissions are given

Thank You in advance.
Title: Re: problems in compiling/executing simple programs on Ubuntu 14.04
Post by: marcelinux on April 09, 2015, 04:26:48 pm
/bin/sh: 1: g++: not found
You need install build-essential in ubuntu.
But g++ is for c++ sources.
Try selecting C compiler at startup C::B project.

Regards.
Title: Re: problems in compiling/executing simple programs on Ubuntu 14.04
Post by: lingiro on April 09, 2015, 05:43:00 pm
Thanks, I'll try. But, Do you think it's better to remove the present installation and replace it with a new, one not by IDLE but directly by command line? Could the following  sequence be correct?
apt-get purge codeblocks 
apt-get codeblocks
Thank you again
Title: Re: problems in compiling/executing simple programs on Ubuntu 14.04
Post by: lingiro on April 09, 2015, 06:42:36 pm
I tried to install build-essential, but without good results.
I've just compiled the usual first program:
#include <stdio.h>
int main (void)
{
    printf ("hello");
    return 0;
    getchar();

}
And this is what appears:

||warning: -c: File o directory non esistente [enabled by default]|

/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o:/build/buildd/eglibc-2.19/csu/../sysdeps/x86_64/start.S|118|definito qui per la prima volta|
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o:/build/buildd/eglibc-2.19/csu/../sysdeps/x86_64/crti.S|64|definito qui per la prima volta|

||=== Build failed: 2 error(s), 1 warning(s) (0 minute(s), 0 second(s)) ===|

If You can suggest me other solutions... thank You in advance!
Best regards
Title: Re: problems in compiling/executing simple programs on Ubuntu 14.04
Post by: Jenna on April 09, 2015, 08:05:51 pm
I guess it's the empty "-I" with the followinh "-c" that leads to the error.
This might be a C::B bug.
Did you use the console-wizard or did you set up the project yourself.

Can you try a nightly build ?
If I remember correctly, the build from my debian repo works on Ubuntu 14.04 (not absolutely sure about this).

See my signature for a link.
Title: Re: problems in compiling/executing simple programs on Ubuntu 14.04
Post by: oBFusCATed on April 10, 2015, 12:42:24 am
Probably you've created a class using the class wizard. This is known to be broken in 13.12.