gcc installed successfully but its Command not found

I have install gcc successfully using: lang/gcc44

And I also tried also:
pkg install gcc

But when I try to use it the following appears:
Code:
gcc: Command not found.
When I issue pkg install gcc it shows:
Code:
Updating repository catalogue
gcc-4.6.4 already installed

I am using FreeBSD 10.0.
 
It'll be gcc44 to prevent clashes with gcc46 and gcc48.
 
There will never be a command gcc. If you really need one just create an alias: alias gcc gcc44.
 
SirDice said:
There will never be a command gcc. If you really need one just create an alias: alias gcc gcc44.

The issue is I am trying to compile a program source using gmake, it always shows these errors:

gmake: g++: Command not found
gmake: *** [monitor_client.o] Error 127
 
Then it seems either something is going haywire with your search path or your base system is messed up. Because those commands are normally part of the base system (do keep in mind that I'm mostly referring to FreeBSD 9.x here, I am confident the same applies for FreeBSD 10 but I haven't experimented with that release yet).

So first of all try using this command: echo $PATH and see what it says. If /usr/bin is mentioned then the problem lies elsewhere. Check /usr/bin. Under normal circumstances it should have commands such as gcc, cc, g++ and so on.

Is it possible that you rebuild your base system yourself and tweaked things in src.conf?

Edit:

Forgot to mention; obviously if /usr/bin isn't mentioned in the PATH output then that's the cause of your problems. Make sure /usr/bin gets included and everything should work normally once again.
 
ShelLuser said:
Then it seems either something is going haywire with your search path or your base system is messed up. Because those commands are normally part of the base system (do keep in mind that I'm mostly referring to FreeBSD 9.x here, I am confident the same applies for FreeBSD 10 but I haven't experimented with that release yet).

So first of all try using this command: echo $PATH and see what it says. If /usr/bin is mentioned then the problem lies elsewhere. Check /usr/bin. Under normal circumstances it should have commands such as gcc, cc, g++ and so on.

Is it possible that you rebuild your base system yourself and tweaked things in src.conf?

Edit:

Forgot to mention; obviously if /usr/bin isn't mentioned in the PATH output then that's the cause of your problems. Make sure /usr/bin gets included and everything should work normally once again.

gcc is not part of FreeBSD 10 so the commands won't be there. I'm guessing that's what the OP is using.
 
If the compiler is called gcc44 (or g++44 for C++) you have tell devel/gmake and the related utilities that the compiler is called something else than the usual.

gmake CC=gcc44 CXX=g++44 CPP="gcc44 -E"

If it still doesn't work I'd guess that the Makefile you have hardcodes the name to gcc (stupid practice but I've seen it done).
 
On FreeBSD 10.0 gcc is no more part of the system, all gcc version installed from ports are versioned, that is gcc 4.6 is installed as gcc46, g++46, etc., so creating a symlink in /usr/local/bin should be fine (as root)

# cd /usr/local/bin
# ln -s gcc46 gcc
# ln -s g++46 g++


I think there are no side effects
 
ph0enix said:
gcc is not part of FreeBSD 10 so the commands won't be there. I'm guessing that's what the OP is using.
True, but Clang is part of the system. I don't know about g++ but from what I've been reading I get the impression that commands like cc should still be normally available, but instead of firing up GCC it's now using Clang. But then again I think that also differs per architecture (think i386 vs. amd64 for example).
 
Back
Top