Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How can use codeblocks like a normal user? (Can't compile)
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Yczo
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2011
Posts: 135

PostPosted: Thu Aug 30, 2012 1:14 pm    Post subject: How can use codeblocks like a normal user? (Can't compile) Reply with quote

Hello.

I can't use codeblocks without being root (well realy I can't compile). 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
Back to top
View user's profile Send private message
DaggyStyle
Advocate
Advocate


Joined: 22 Mar 2006
Posts: 4929

PostPosted: Thu Aug 30, 2012 1:46 pm    Post subject: Re: How can use codeblocks like a normal user? (Can't compil Reply with quote

Yczo wrote:
Hello.

I can't use codeblocks without being root (well realy I can't compile). I know that this is dangerous.

why and how on earth are you trying to run codeblocks as root?

Yczo wrote:
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++?


you do know C and C++ are languages and codeblocks is an IDE right? you absolutely don't need codeblocks to program in either C nor C++.
you can use nano, vi, anuja, kdevelop, codelite or whatever IDE you want to ease your programming experience but you don't need them to start.
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
ProjectFootball
Back to top
View user's profile Send private message
Yczo
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2011
Posts: 135

PostPosted: Thu Aug 30, 2012 2:15 pm    Post subject: Reply with quote

Yes, I know that, but is very comfortable compile and execute the programs directly from the Ide. I don't know if I can directly compile from the other GUIS. In the other hand, i found atractive codeblocks.

I only want debug and compile the code directly from IDE

Regards and thank you for answer.
Back to top
View user's profile Send private message
DaggyStyle
Advocate
Advocate


Joined: 22 Mar 2006
Posts: 4929

PostPosted: Thu Aug 30, 2012 3:45 pm    Post subject: Reply with quote

Yczo wrote:
Yes, I know that, but is very comfortable compile and execute the programs directly from the Ide. I don't know if I can directly compile from the other GUIS. In the other hand, i found atractive codeblocks.

I only want debug and compile the code directly from IDE

Regards and thank you for answer.

so your real question is why I cannot run codeblocks as normal user/
what is your error msg?
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
ProjectFootball
Back to top
View user's profile Send private message
Yczo
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2011
Posts: 135

PostPosted: Thu Aug 30, 2012 4:44 pm    Post subject: Reply with quote

Ok, the problem is that I'm not alowed to compile with gcc from codeblocks. How can give permissions to my user
for copile with codeblocks using gcc? ...permission to use gcc only with codeblocks.

This is the output:
Compiling: /home/enigma/... /general-delay.c
gcc-config: error: could not run/locate 'gcc'
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
Back to top
View user's profile Send private message
wjb
Guru
Guru


Joined: 10 Jul 2005
Posts: 355
Location: Fife, Scotland

PostPosted: Thu Aug 30, 2012 6:11 pm    Post subject: Reply with quote

Is gcc configured in codeblocks?

Settings -> Compiler and Debugger

What is set up as the selected compiler? "GNU GCC Compiler"? And do the executables listed on the "Toolchain Executables" tab look ok (gcc, g++, etc)
Back to top
View user's profile Send private message
XavierMiller
Moderator
Moderator


Joined: 23 Jul 2004
Posts: 5542
Location: ~Brussels - Belgique

PostPosted: Thu Aug 30, 2012 6:26 pm    Post subject: Reply with quote

Hello,

As user, you also need to call eselect wxwidgets to select a wxwidgets implementation.
_________________
Xavier Miller
(FR) Merci de respecter les règles du forum.
http://www.xaviermiller.be
Back to top
View user's profile Send private message
DaggyStyle
Advocate
Advocate


Joined: 22 Mar 2006
Posts: 4929

PostPosted: Thu Aug 30, 2012 6:27 pm    Post subject: Reply with quote

what is the output of:
Code:

gcc -v
which gcc
gcc-config -l

?
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
ProjectFootball
Back to top
View user's profile Send private message
Yczo
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2011
Posts: 135

PostPosted: Thu Aug 30, 2012 9:43 pm    Post subject: Reply with quote

Hello. In first place, thanks for answer.

Yes, i have gcc selected on system settings from codeblocks

Loged like user I obtained the next results:

$ eselect wxwidgets list
Available wxWidgets profiles:
[1] gtk2-unicode-release-2.8

$ gcc -v
gcc-config: error: could not run/locate 'gcc' //I don't have permisions for use gcc on my user.

$ which gcc
/usr/bin/gcc

$ gcc-config -l
[1] avr-4.4.5 *

[2] x86_64-pc-linux-gnu-4.5.4 *

I don't know how to set permissions to allow at my user the use of gcc. The user does not must have permission for compile and install programs from portage

Regards.
Back to top
View user's profile Send private message
DaggyStyle
Advocate
Advocate


Joined: 22 Mar 2006
Posts: 4929

PostPosted: Fri Aug 31, 2012 8:21 am    Post subject: Reply with quote

Yczo wrote:
Hello. In first place, thanks for answer.

Yes, i have gcc selected on system settings from codeblocks

Loged like user I obtained the next results:

$ eselect wxwidgets list
Available wxWidgets profiles:
[1] gtk2-unicode-release-2.8

$ gcc -v
gcc-config: error: could not run/locate 'gcc' //I don't have permisions for use gcc on my user.

$ which gcc
/usr/bin/gcc

$ gcc-config -l
[1] avr-4.4.5 *

[2] x86_64-pc-linux-gnu-4.5.4 *

I don't know how to set permissions to allow at my user the use of gcc. The user does not must have permission for compile and install programs from portage

Regards.

this isn't codeblocks issue, there is a problem in your system.
run gcc-config 2 and see if the output of gcc -v has changed.
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
ProjectFootball
Back to top
View user's profile Send private message
XavierMiller
Moderator
Moderator


Joined: 23 Jul 2004
Posts: 5542
Location: ~Brussels - Belgique

PostPosted: Fri Aug 31, 2012 8:32 am    Post subject: Reply with quote

Hello,

You don't have a user profile for wxwidgets.

Please select the profile 1 as user:
Code:
eselect wxwidgets set 1

_________________
Xavier Miller
(FR) Merci de respecter les règles du forum.
http://www.xaviermiller.be
Back to top
View user's profile Send private message
wjb
Guru
Guru


Joined: 10 Jul 2005
Posts: 355
Location: Fife, Scotland

PostPosted: Sat Sep 01, 2012 8:53 am    Post subject: Reply with quote

Yczo wrote:

$ gcc -v
gcc-config: error: could not run/locate 'gcc' //I don't have permisions for use gcc on my user.

I think a question is: why don't you have permissions to use gcc? (despite you appearing to be able to log in as root??)
Back to top
View user's profile Send private message
Yczo
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2011
Posts: 135

PostPosted: Sun Sep 02, 2012 6:44 pm    Post subject: Reply with quote

Ok, I did all your recommendations. I have the next results now

Usando especificaciones internas.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.4/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.4/lto-wrapper
Objetivo: x86_64-pc-linux-gnu
Configurado con: /var/tmp/portage/sys-devel/gcc-4.5.4/work/gcc-4.5.4/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.4 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --without-ppl --without-cloog --disable-lto --enable-nls --without-included-gettext --with-system-zlib --enable-obsolete --disable-werror --enable-secureplt --enable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/python --enable-checking=release --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-targets=all --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.5.4 p1.0, pie-0.4.7'
Modelo de hilos: posix
gcc versión 4.5.4 (Gentoo 4.5.4 p1.0, pie-0.4.7)

$ eselect wxwidgets list
Available wxWidgets profiles:
[1] gtk2-unicode-release-2.8 *

but i continue without can buld my programs.

all this was run as root.

if I try to obtain the verbose info of gcc like my user, obtain this

$ gcc -v
gcc-config: error: could not run/locate 'gcc'

$ gcc-config 2
* gcc-config: need write access to /

Must my user be added to a special group? How can give permissions?

Greetings.
Back to top
View user's profile Send private message
DaggyStyle
Advocate
Advocate


Joined: 22 Mar 2006
Posts: 4929

PostPosted: Sun Sep 02, 2012 7:14 pm    Post subject: Reply with quote

Yczo wrote:
Ok, I did all your recommendations. I have the next results now

Usando especificaciones internas.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.4/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.4/lto-wrapper
Objetivo: x86_64-pc-linux-gnu
Configurado con: /var/tmp/portage/sys-devel/gcc-4.5.4/work/gcc-4.5.4/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.4 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --without-ppl --without-cloog --disable-lto --enable-nls --without-included-gettext --with-system-zlib --enable-obsolete --disable-werror --enable-secureplt --enable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/python --enable-checking=release --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-targets=all --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.5.4 p1.0, pie-0.4.7'
Modelo de hilos: posix
gcc versión 4.5.4 (Gentoo 4.5.4 p1.0, pie-0.4.7)

$ eselect wxwidgets list
Available wxWidgets profiles:
[1] gtk2-unicode-release-2.8 *

but i continue without can buld my programs.

all this was run as root.

if I try to obtain the verbose info of gcc like my user, obtain this

$ gcc -v
gcc-config: error: could not run/locate 'gcc'

$ gcc-config 2
* gcc-config: need write access to /

Must my user be added to a special group? How can give permissions?

Greetings.
su -c "gcc-config 2"
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
ProjectFootball
Back to top
View user's profile Send private message
Yczo
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2011
Posts: 135

PostPosted: Tue Sep 04, 2012 5:31 pm    Post subject: Reply with quote

No way!

I did it, but continues without want compile like user :(
codeblocks say : gcc-config: error: could not run/locate 'gcc'

But thank you for all your help
Back to top
View user's profile Send private message
DaggyStyle
Advocate
Advocate


Joined: 22 Mar 2006
Posts: 4929

PostPosted: Tue Sep 04, 2012 5:45 pm    Post subject: Reply with quote

Yczo wrote:
No way!

I did it, but continues without want compile like user :(
codeblocks say : gcc-config: error: could not run/locate 'gcc'

But thank you for all your help

what is the output of gcc -v?
also avr-4.4.5 is a cross compiler
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
ProjectFootball
Back to top
View user's profile Send private message
Yczo
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2011
Posts: 135

PostPosted: Tue Sep 04, 2012 6:13 pm    Post subject: Reply with quote

like root, this:

# gcc -v
Usando especificaciones internas.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.4/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.4/lto-wrapper
Objetivo: x86_64-pc-linux-gnu
Configurado con: /var/tmp/portage/sys-devel/gcc-4.5.4/work/gcc-4.5.4/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.4 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --without-ppl --without-cloog --disable-lto --enable-nls --without-included-gettext --with-system-zlib --enable-obsolete --disable-werror --enable-secureplt --enable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/python --enable-checking=release --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-targets=all --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.5.4 p1.0, pie-0.4.7'
Modelo de hilos: posix
gcc versión 4.5.4 (Gentoo 4.5.4 p1.0, pie-0.4.7)

like user:

$ gcc -v
gcc-config: error: could not run/locate 'gcc'

salutes.
Back to top
View user's profile Send private message
wjb
Guru
Guru


Joined: 10 Jul 2005
Posts: 355
Location: Fife, Scotland

PostPosted: Tue Sep 04, 2012 6:13 pm    Post subject: Reply with quote

its worth checking the actual permissions
Code:

$ ls -l /usr/bin/gcc
Back to top
View user's profile Send private message
Yczo
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2011
Posts: 135

PostPosted: Tue Sep 04, 2012 6:39 pm    Post subject: Reply with quote

ls -l /usr/bin/gcc
-rwxr-xr-x 1 root root 10384 ago 22 21:54 /usr/bin/gcc

Seems like i have permisions for execute. Humm. when I use codeblocks, I select project, and gcc chosing a directory on my /home/user. Not idea.


Last edited by Yczo on Tue Sep 04, 2012 6:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
DaggyStyle
Advocate
Advocate


Joined: 22 Mar 2006
Posts: 4929

PostPosted: Tue Sep 04, 2012 6:45 pm    Post subject: Reply with quote

Yczo wrote:
ls -l /usr/bin/gcc
-rwxr-xr-x 1 root root 10384 ago 22 21:54 /usr/bin/gcc

what is the output of groups on your user?
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
ProjectFootball
Back to top
View user's profile Send private message
Yczo
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2011
Posts: 135

PostPosted: Tue Sep 04, 2012 6:49 pm    Post subject: Reply with quote

enigma@minienigma ~ $ groups
tty lp wheel uucp audio cdrom video games cdrw usb android enigma
Back to top
View user's profile Send private message
DaggyStyle
Advocate
Advocate


Joined: 22 Mar 2006
Posts: 4929

PostPosted: Tue Sep 04, 2012 7:04 pm    Post subject: Reply with quote

add yourself to portage group and try again
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
ProjectFootball
Back to top
View user's profile Send private message
Yczo
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2011
Posts: 135

PostPosted: Tue Sep 04, 2012 7:35 pm    Post subject: Reply with quote

Added, but no luck :(

$ groups
tty lp wheel uucp audio cdrom video games cdrw usb portage android enigma
Back to top
View user's profile Send private message
DaggyStyle
Advocate
Advocate


Joined: 22 Mar 2006
Posts: 4929

PostPosted: Tue Sep 04, 2012 8:31 pm    Post subject: Reply with quote

Yczo wrote:
Added, but no luck :(

$ groups
tty lp wheel uucp audio cdrom video games cdrw usb portage android enigma

ok, what is avr-4.4.5?
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
ProjectFootball
Back to top
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 9009

PostPosted: Wed Sep 05, 2012 12:49 am    Post subject: Reply with quote

My user is not in the portage group and I have never had problems invoking gcc from my user account. What does strace say about the failure?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum