C++ and Mixer

I got SDL-1.0.0 and the latest mixer off the CVS and they both compile
without any problems. The example programs for both work great also.

But when I try link the mixer with a C++ program, I get an ‘undefines
reference to Mix_*****’ for any function that starts with Mix_. In
version 0.11.2 or below I never had this problem. Anyone know what I’m
doing wrong here?–
-= aaron p. matthews
-= rival entertainment
-= http://www.Nayzak.com/~jerryma/rival

You have declare the code as C code. Add the following lines to mixer.h

#ifdef __cplusplus
extern “C” {
#endif

normal mixer.h here

#ifdef __cplusplus
};
#endif

I had that problem,too. This solution works well for me.

Bye, KarlOn Die, 30 Nov 1999, you wrote:

%_I got SDL-1.0.0 and the latest mixer off the CVS and they both compile
without any problems. The example programs for both work great also.

But when I try link the mixer with a C++ program, I get an ‘undefines
reference to Mix_*****’ for any function that starts with Mix_. In
version 0.11.2 or below I never had this problem. Anyone know what I’m
doing wrong here?

You have declare the code as C code. Add the following lines to mixer.h

Oooh yeah :wink: Thanks, works great! Although I just put those lines in my main
C++ file around the ‘#include “mixer.h”’ instead of messing with the actual
mixer.h file.

-= aaron p. matthews
-= rival entertainment
-= http://www.Nayzak.com/~jerryma/rival

You have declare the code as C code. Add the following lines to mixer.h

Oooh yeah :wink: Thanks, works great! Although I just put those lines in my main
C++ file around the ‘#include “mixer.h”’ instead of messing with the actual
mixer.h file.

The mixer that will be released with 1.0 will work fine.

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec