LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-06-2003, 05:08 PM   #1
inprogress
LQ Newbie
 
Registered: May 2003
Posts: 6

Rep: Reputation: 0
Question Setting environmental variables in mandrake


I have been trying to install several programs but I keep getting an error to do with the C compiler.

These are two of the common errors i get:
1. "installation or configuration problem: C compiler cannot create executables."

2. "gcc: installation problem, cannot exec `cpp0': No such file or directory
*** The command 'gcc -o conftest -O2 conftest.c' failed.
*** You must set the environment variable CC to a working compiler."

As the second message indicates, it has to do with an environmental variable not being set.
I would like to know if anyone can tell how to set environmental variables in mandrake.

thanks,
-inprogress
 
Old 06-06-2003, 06:16 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
What happens if you just type
Code:
gcc --version
which gcc
If you actually have it installed and it doesn't
pick it up you can set your environment
variables in bash as follows
CC=/path/to/compiler
export $CC

Cheers,
Tink
 
Old 06-06-2003, 07:24 PM   #3
inprogress
LQ Newbie
 
Registered: May 2003
Posts: 6

Original Poster
Rep: Reputation: 0
Thanx for your response,

When i type in the code i get version 2.96

When i type
CC=/path/to/compiler
export $CC

i get the error message:
"bash: export: "path i entered":not a valid identifier"

I tried the following paths:
CC="/usr/bin/gcc-2.96.exe"
CC=/usr/bin/gcc-2.96.exe
CC="/usr/bin/"
CC=/usr/bin/

None of those ways worked.

Do you know why?

-inprogress
 
Old 06-07-2003, 12:48 AM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Hmmm ... odd.

But exe isn't anything that linux
knows/cares about ...


Cheers,
Tink
 
Old 06-07-2003, 08:03 AM   #5
blix5
LQ Newbie
 
Registered: Jun 2003
Distribution: Mandrake 9.1
Posts: 3

Rep: Reputation: 0
to set the path for the current session:
export PATH=$PATH:/my/new/path

to have the path set every time that you log on, go to your home directory and look for the file .bash_profile.
edit/insert a line like:
PATH=$PATH:/my/new/path

however, it doesn't sound like bash is complaining about not being able to find executable files, such as the gcc compiler. i think something else may be wrong.

you could also try to compile as root (su).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Environmental Variables danglingpointer Slackware 13 01-06-2005 12:36 AM
environmental variables msound Programming 0 08-21-2004 07:06 PM
environmental variables? blackzone Linux - General 1 08-06-2004 03:44 AM
how to set environmental variables chakkerz Linux - Newbie 8 07-01-2004 03:06 AM
environmental variables mbhenry Linux - General 6 09-18-2003 11:41 AM


All times are GMT -5. The time now is 05:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration