MSAFluid Errors

Hello all,
I’m new to OpenFrameworks and C++. As such, I was browsing through and trying out all the examples I could. I stumbled upon the ofxMSAFluid addon and tried to use it. I’m using Snow Leopard with XCode by the way.

I began by creating an empty project, copying the src from the ofxMSAFluid example folder into my project’s src folder. I then downloaded and installed all the necessary addons in the addons folder. It seems like I’ve done everything correctly, and it looks that way when I hit “Build and Run” as I see a whole bunch of files compiling. When it gets to the end of the files though, it pops up with two errors:

Command /Developer/usr/bin/g+±4.2 failed with exit code 1
Command /bin/sh failed with exit code 1

I did a little searching around, and found that someone had luck by changing the default compiler from g+±4.2 to g+±4.0. I tried doing that, but I get the same error basically:

Command /Developer/usr/bin/g+±4.0 failed with exit code 1
Command /bin/sh failed with exit code 1

At this point, I’m completely unsure of what I should do next. Any help you could offer would be greatly appreciated.


can you let us know, what is the error before these errors? these are just telling you that compile stopped, but don’t have the real info. Look what what it says before.

I suspect, if you just dragged in addons, you might have accidentally added “example” code from the addon, including another “main.cpp” and “testApp.cpp” and that the linker will be complaining about multiple definitions of “_main”. This happens at the link time.

can you check on what the error is and get back to us?


Oh I see, I didn’t notice the information before the error.
Yeah, there was an error about duplicate _main, so I went through the addons and removed any example folders. Doing that solved the issue, but now I have a new set of errors! This is what it says:

Undefined symbols:
“ParticleSystem::updateAndDraw()”, referenced from:
testApp::draw() in testApp.o
“ParticleSystem::ParticleSystem()”, referenced from:
testApp::testApp()in main.o
“ParticleSystem::addParticles(float, float, int)”, referenced from:
testApp::addToFluid(float, float, float, float, bool, bool)in testApp.o
ld: symbol(s) not found
collect2: ld returned 1 exit status


Edit: Also, is there another more efficient way to include the addons on the project? One that would prevent accidentally adding example code?

Edit#2: Oh my, I feel so stupid! I didn’t notice that under my src I had somehow only added main.cpp, testapp.cpp, and testapp.h. I was completely missing ParticleSystem.cpp, etc.

I’ve got it running now, thanks for your help!

cool – glad it’s working !!

it usually takes a few tries to get a hang of the compiler errors, but once you do you’ll see things that can help you understand.

some general notes on things you’ll see:

a) multiple definitions (_main, etc) means there are more then one .cpp file of the same name or missing an include guard

b) undefined symbols means compiler can find the .h files it needs, but your linker isn’t seeing all of the .cpp files (or libs)

most of the other errors are compiler related…

hope that helps!

Yeah, I’m starting to get the hang of it. Thanks for the advice!

Same error here.
Thanks for the advice! :slight_smile: