News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

How can I use codeblocks like a normal user in linux? (Can't compile with gcc)

Started by yczo, August 30, 2012, 04:19:54 PM

Previous topic - Next topic

yczo

Hello.

I can't use codeblocks without being root (well realy I can't compile with gcc). I know that this is dangerous. Would be someone so kind to tell me what must I do to use it like a normal user to start to learn c/c++?

Thanks in advance

Jenna

Keep the sources in a folder where you have read and write access (normally below your home-folder) and all should work well.

yczo

hello jens.

I did it, but i can't compile. codeblocks say : gcc-config: error: could not run/locate 'gcc'

regards


const451

Open the terminal, navigate to the folder where you source code is, and try to compile from the command line, tell us what happens.

g++ [source files]

yczo

Hi const451, that was a good idea

$ gcc -o counter.c
gcc-config: error: could not run/locate 'gcc'

Is not a problem of codeblocks.

$ ls -l  //I'm enigma, I'm allowed
-rwxr-xr-x 1 enigma enigma  733 dic 22  2011 counter.c

And on father directory

drwxr-xr-x 5 enigma enigma 4096 sep  7 22:11 example

regards

Radek

The problem concerns your gcc. Either you do not have gcc at all (if you can compile as a root, then you have gcc) or access rights to your gcc do not allow you a user access.

(1) check access rights of files concerning gcc.
(2) check access rights of directories that "leads" to gcc.

You need 'r' and 'x' everywhere. You can see your progress by attempting compiling counter.c from the commandline. When you reach success, try Code Blocks again.

Jenna

Did you ever search the web for the error ?

It seems to be a more or less common problem, that can happen on gentoo after updates.