sh: gcc-4.2: command not found

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

webhead
Posts: 0
Joined: Thu Jul 07, 2011 5:30 pm

sh: gcc-4.2: command not found

Post by webhead » Wed Nov 09, 2011 12:45 am

hey,

I've run in to this error building Blender on my imac g5, any ideas what causes this?

sh: gcc-4.2: command not found

Thanks!
Steve

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Post by stiv » Wed Nov 09, 2011 2:19 am

Looks like you are missing gcc - the Gnu C compiler. You will also need to install g++ if that is a separate package on your system.

webhead
Posts: 0
Joined: Thu Jul 07, 2011 5:30 pm

Post by webhead » Wed Nov 09, 2011 5:01 am

Hmm. shouldn't that be part of xcode? I have xcode 3 installed...

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Post by stiv » Wed Nov 09, 2011 5:09 am

I'm an innocent little lamb when it comes to OSX. You may have gcc installed, but that message says it was not in the PATH from wherever that command was run.

Note it was looking for gcc-4.2 specifically, and not just gcc.
Last edited by stiv on Wed Nov 09, 2011 5:20 am, edited 1 time in total.

Droghio
Posts: 0
Joined: Sun Nov 06, 2011 4:17 pm

Post by Droghio » Thu Nov 10, 2011 2:55 am

I have an iMac G5 myself, for xcode 3.1.4 the default complier is GCC 4.0, you probably just need to set the build parameter to GCC 4.0 instead of 4.2, if you need more help post a reply.

If you are using Cmake to generate the xcode file right clicking the the project and selecting "Get Info" in xcode should give you access to the build options.

Just a word of warning make sure you have changed the default compiling architecture to ppc if it is an iMac G5, it really stinks to wait 2 hours to compile then not be able to launch, I speak from first hand experience. :P

webhead
Posts: 0
Joined: Thu Jul 07, 2011 5:30 pm

Post by webhead » Thu Nov 10, 2011 3:00 pm

Droghio wrote:I have an iMac G5 myself, for xcode 3.1.4 the default complier is GCC 4.0, you probably just need to set the build parameter to GCC 4.0 instead of 4.2, if you need more help post a reply.

If you are using Cmake to generate the xcode file right clicking the the project and selecting "Get Info" in xcode should give you access to the build options.

Just a word of warning make sure you have changed the default compiling architecture to ppc if it is an iMac G5, it really stinks to wait 2 hours to compile then not be able to launch, I speak from first hand experience. :P

Thanks! I'll try again from scratch, I was using scons. so i'll let you know!

webhead
Posts: 0
Joined: Thu Jul 07, 2011 5:30 pm

Post by webhead » Thu Nov 10, 2011 6:50 pm

Ok, using Cmake I get this Error when I select configure.

The C compiler identification is unknown
CMake Error at /Applications/CMake 2.8-4.app/Contents/share/cmake-2.8/Modules/CMakeFindBinUtils.cmake:71 (MESSAGE):
Could not find install_name_tool, please check your installation.
Call Stack (most recent call first):
/Applications/CMake 2.8-4.app/Contents/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake:174 (INCLUDE)
CMakeLists.txt:97 (project)


CMake Error: Could not find cmake module file:/Users/boyzcomputer/blender-build/cmake/CMakeFiles/CMakeCCompiler.cmake
CMake Error: Could not find cmake module file:/Users/boyzcomputer/blender-build/cmake/CMakeFiles/CMakeCXXCompiler.cmake
Configuring incomplete, errors occurred!

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Post by stiv » Thu Nov 10, 2011 9:50 pm

Sounds like the easy path is to set the CC var in your user-config.py file.

webhead
Posts: 0
Joined: Thu Jul 07, 2011 5:30 pm

Post by webhead » Fri Nov 11, 2011 3:12 am

Alright! got past that error, looks as though I didn't do a full install of xcode, and that was the problem.

Building now, let you know if I run into another error. (yea just never know;))

webhead
Posts: 0
Joined: Thu Jul 07, 2011 5:30 pm

Post by webhead » Fri Nov 11, 2011 4:05 am

Ran into another error:

ld: in /Users/boyzcomputer/blender-build/build/darwin/lib/libbf_intern_guardedalloc.a, archive has no table of contents
collect2: ld returned 1 exit status
scons: *** [/Users/boyzcomputer/blender-build/build/darwin/makesdna] Error 1

know whats wrong here?
Thanks!

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Post by stiv » Fri Nov 11, 2011 6:52 am

archive has no table of contents
On some older brain-dead systems, after you add files to an archive (the .a file), you need to run 'ar' to update the archive's table of contents. (no, it's not a value judgment, just a statement of historical fact)

I have not seen this a long time, and suspect there is something else going on.

webhead
Posts: 0
Joined: Thu Jul 07, 2011 5:30 pm

Post by webhead » Fri Nov 11, 2011 5:33 pm

yea I don't understand this error, I've only been building for a short time. is this a problem with python? any ideas on what I could try?

SirDude
Posts: 233
Joined: Sun Oct 13, 2002 7:37 pm
Location: University of Minnesota (USA)
Contact:

Post by SirDude » Fri Nov 11, 2011 9:56 pm

webhead wrote:yea I don't understand this error, I've only been building for a short time. is this a problem with python? any ideas on what I could try?
No, as stiv said you want to try ar /Users/boyzcomputer/blender-build/build/darwin/lib/libbf_intern_guardedalloc.a

If that doesn't fix it you probably want to do a clean build and see if that doesn't fix it.

scons clean if your using scons, or if your using cmake I'd just rm -rf the build dir and start over.

webhead
Posts: 0
Joined: Thu Jul 07, 2011 5:30 pm

Post by webhead » Sat Nov 12, 2011 5:41 pm

ok, I'm familiar with Scons commands so thanks for clearing it up alittle, I entered the command you said:

ar /Users/boyzcomputer/blender-build/build/darwin/lib/libbf_intern_guardedalloc.a

and got this, Is that all I need to do? because it still fails after doing this:(.


Boyz-IMac:~ boyzcomputer$ ar /Users/boyzcomputer/blender-build/build/darwin/lib/libbf_intern_guardedalloc.a
usage: ar -d [-TLsv] archive file ...
ar -m [-TLsv] archive file ...
ar -m [-abiTLsv] position archive file ...
ar -p [-TLsv] archive [file ...]
ar -q [-cTLsv] archive file ...
ar -r [-cuTLsv] archive file ...
ar -r [-abciuTLsv] position archive file ...
ar -t [-TLsv] archive [file ...]
ar -x [-ouTLsv] archive [file ...]
Boyz-IMac:~ boyzcomputer$


how do you do a clean Scons? Thanks!

Droghio
Posts: 0
Joined: Sun Nov 06, 2011 4:17 pm

Post by Droghio » Sun Nov 13, 2011 3:38 am

I have no experience with scons, but with Cmake I was able to compile blender on my iMac g5, although it compiled it for i386 and I have not felt a desire to compile it or ppc it was still successful. If you need to build blender I suggest looking at Cmake to aid in building blender.

Post Reply