View Full Version : Project Builder Problems
Muffinking
2002.06.15, 03:20 PM
I re-wrote a bunch of my functions yesterday in a separate source file then backed up my original source then started to use the new one... but when I try and compile the build always fails, I haven't changed any settings or anything in PB but it keeps saying this:
...failed MasterObjectFile.Combine /Users/ferruslo/Desktop/Clever Carbon/build/Clever Carbon.build/Clever.build/Objects-normal/ProjectBuilderMasterObjectFile.o ...
any idea what this means?
I believe there is a file missing in the folder it specifies there.. but I have no idea how to fix this.. and it just happened out of the blue.. It was compiling fine two days ago...
any ideas?
Hank -
OneSadCookie
2002.06.15, 05:54 PM
The actual error that causes this failure will be higher up in the log. If you post the whole thing here we might be able to diagnose it for you, but you should be able to make a guess from reading it :)
Muffinking
2002.06.18, 11:56 PM
here is the full build log until , maybe it will be useful in diagnosing my problem. For reference I have little idea of what it means..
/usr/bin/jam -d1 JAMBASE=/Developer/Makefiles/pbx_jamfiles/ProjectBuilderJambase JAMFILE=- build ACTION=build _DEFAULT_GCC_VERSION=2.95.2 _GCC3_IS_IN_OFFICIAL_LOCATION=YES BUILD_STYLE=Development "CPP_HEADERMAP_FILE=/Users/ferruslo/Desktop/Clever Carbon/build/Clever Carbon.build/Clever.build/Clever.hmap" "SRCROOT=/Users/ferruslo/Desktop/Clever Carbon" "OBJROOT=/Users/ferruslo/Desktop/Clever Carbon/build" "SYMROOT=/Users/ferruslo/Desktop/Clever Carbon/build" "DSTROOT=/tmp/Clever Carbon.dst"
...updating 10 target(s)...
Cp /Users/ferruslo/Desktop/Clever Carbon/build/Clever.app/Contents/Info.plist
Cp /Users/ferruslo/Desktop/Clever Carbon/build/Clever.app/Contents/PkgInfo
BuildPhase <CopyResources>Clever.app
Completed phase <CopyResources> for <CopyResources>Clever.app
BuildPhase <DeriveAndCompileSources>Clever.app
Completed phase <DeriveAndCompileSources> for <DeriveAndCompileSources>Clever.app
MasterObjectFile.Combine /Users/ferruslo/Desktop/Clever Carbon/build/Clever Carbon.build/Clever.build/Objects-normal/ProjectBuilderMasterObjectFile.o
/usr/bin/ld: multiple definitions of symbol _player
/Users/ferruslo/Desktop/Clever Carbon/build/Clever Carbon.build/Clever.build/Objects-normal/ppc/graphics.o definition of _player in section (__DATA,__common)
/Users/ferruslo/Desktop/Clever Carbon/build/Clever Carbon.build/Clever.build/Objects-normal/ppc/game.o definition of _player in section (__DATA,__common)
/usr/bin/c++ -arch ppc -keep_private_externs -nostdlib -filelist "/Users/ferruslo/Desktop/Clever Carbon/build/Clever Carbon.build/Clever.build/Objects-normal/LinkFileListPrelink" -r -o "/Users/ferruslo/Desktop/Clever Carbon/build/Clever Carbon.build/Clever.build/Objects-normal/ProjectBuilderMasterObjectFile.o"
...failed MasterObjectFile.Combine /Users/ferruslo/Desktop/Clever Carbon/build/Clever Carbon.build/Clever.build/Objects-normal/ProjectBuilderMasterObjectFile.o ...
egats. I have no idea.
help?
Hank
OneSadCookie
2002.06.19, 02:45 AM
Here's your actual error:
/usr/bin/ld: multiple definitions of symbol _player
/Users/ferruslo/Desktop/Clever Carbon/build/Clever Carbon.build/Clever.build/Objects-normal/ppc/graphics.o definition of _player in section (__DATA,__common)
/Users/ferruslo/Desktop/Clever Carbon/build/Clever Carbon.build/Clever.build/Objects-normal/ppc/game.o definition of _player in section (__DATA,__common)
I'm surprised that at least "/usr/bin/ld: multiple definitions of symbol _player" didn't make it into the normal errors pane, but that's a side issue...
The problem is almost certainly that you have either a function or a global variable defined (rather than declared) in a header, which is now included in two source files (graphics.c & game.c by the looks).
The solution is to declare the variable/function in the header, by using the extern keyword, and to define it in one of the source files.
This is such a common question on these boards, anyone feel like writing a FAQ for the Wiki (http://macgamewiki.crissman.net)?
wally
2002.06.19, 08:23 PM
About PB acting up. Something I always do when PB throws crap at me is to close the project, remove the build/ directory and recompile. That usually causes things to go back to normal.
About the multiple definitions thing. Yes this is illegal and a bad practice. But the code should still link properly, which is why PB doesn't report the error. ld by default merges symbols that are defined in different object files, and issues a warning. Only if the the same symbol is duplicated in in the *same object file* you get an error.
This is not uncommon as lots of beginners don't know to extern their globals. This is definitely one of the most infuriating things that happens when trying to compile gcc code on CodeWarrior, as CW creates one big huge object file for all the source files in a target, so it can't normally merge things like ld does.
Muffinking
2002.06.19, 09:14 PM
I am not a newbie or beginner programmer thank you very much ;D
but I didn't understand what the build log was trying to tell me... I am new to Project Builder though..
Thanks for the help guys I am back on track.
I'm out.
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.