Sdl & C++ = Nogo?

Posts: 5
Joined: 2007.10
Post: #1
Hi there, I'm just having this annoying problem when I try compiling one of the SDL samples. The thing is this.

It compiles and runs well when it's compiled as c but as soon as I compile the same code as c++ something goes wrong. Everything compiles alright (almost) but when I try to run the app it crashes due to some link-error or other "ZeroLink: unknown symbol '__Z13Atlantis_Initv'" is what it prints.

I am compiling the standard openGL-template for SDL. Only thing changed is the ending on the main.c to main.cpp

My machine is running OS X 10.4.10 and xCode 2.4.1

I'm just just not that experienced working with advanced compiler enviorments, but c++ I know Wink

Thanks in advance, Mattias
Quote this message in a reply
Posts: 5,143
Joined: 2002.04
Post: #2
To get a useful error, disable ZeroLink in your target settings. Make sure to squish it, it's a tricky devil.

Beyond that, there's not much to say, except that your code is expecting a C++ function to be defined, and not finding it:

CookieJar:~ keith$ c++filt <<< '__Z13Atlantis_Initv'

That's possibly caused by a missing (or extra) extern "C", but without more information, it's impossible to say.
Quote this message in a reply
Posts: 5
Joined: 2007.10
Post: #3
Oh... yeah... Thank you very much. You just made me realize the errors were caused by me being an idiot, really.

The problem that didn't really exist is now solved. *bangs head on desk*

Thanks again, now I'm off to creating great games again Grin
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  GLSL geometry- and multipass-shaders (nogo?) mcMike 3 6,009 May 2, 2008 05:51 AM
Last Post: mcMike