30.2. Adding libraries to your project file

If you’re not using the Pop Framework, the first time you add the ::PlaySound call to your code and try and compile the code, you’ll get a compiler error that says something like PlaySound’ : undeclared identifier’. To get rid of this, you need to add the line #include <mmsystem.h> to the top of your file.

And now after you get past the compile, you’ll get a linker error, saying something like “PlaySound definition not found”. Actually it will have a bunch of gibberish attached to the PlaySound name; this is because C++ does ‘name-mangling’ which means attaching symbols to a function name so as to specify what types the function expects as its arguments.

When you get a linker error of this kind, this ...

Get Software Engineering and Computer Games now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.