iphone - Issue with Duplicate symbol in link phase of project build in Xcode -
i've been building game application ios. application working well, i've done large restructure today little more model-view-controller 'compliant'.
i've built main game engine in c++, use objective-c managing viewcontrollers, views etc.
now, when compile project, i'm getting error in link phase. details below:
ld: duplicate symbol applicationengine::onfingerup(vector2) in /users/dan/library/developer/xcode/deriveddata/blackholes-exrlidtstxzdtsbyjghgquhlsqul/build/intermediates/blackholes.build/debug-iphonesimulator/blackholes.build/objects-normal/i386/applicationengine.o , /users/dan/library/developer/xcode/deriveddata/blackholes-exrlidtstxzdtsbyjghgquhlsqul/build/intermediates/blackholes.build/debug-iphonesimulator/blackholes.build/objects-normal/i386/appdelegate.o architecture i386 collect2: ld returned 1 exit status command /developer/platforms/iphonesimulator.platform/developer/usr/bin/g++-4.2 failed exit code 1
onfingerup function within c++ applicationengine, , gets called viewcontroller.
is problem caused confusion in #includes / #imports?
my appdelegate file needs #include mainviewcontroller file set initial viewcontroller. mainviewcontroller in turn #includes applicationengine file instantiate class. applicationengine contains onfingerup method. onfingerup method called mainviewcontroller when touch input. sequence of includes causing duplicate?
i've noticed if temporarily remove onfingerup method app completely, same issue method within applicationengine.
there aren't errors or warnings individual files compile. i've tried clean , recompile, no joy.
does have suggestions how approach solving issue? thanks, dan.
i can think of 3 causes this: 1) accidentally #including .cpp file, 2) forgetting #ifndef guards in header file, 3) forgetting inline when writing method definition in header file.
Comments
Post a Comment