LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Setting environmental variables in mandrake (https://www.linuxquestions.org/questions/linux-newbie-8/setting-environmental-variables-in-mandrake-64085/)

inprogress 06-06-2003 05:08 PM

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

Tinkster 06-06-2003 06:16 PM

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

inprogress 06-06-2003 07:24 PM

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

Tinkster 06-07-2003 12:48 AM

Hmmm ... odd.

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


Cheers,
Tink

blix5 06-07-2003 08:03 AM

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).


All times are GMT -5. The time now is 09:54 AM.