LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Compiling MikMod and Allegro togeteher (https://www.linuxquestions.org/questions/linux-software-2/compiling-mikmod-and-allegro-togeteher-372231/)

rylan76 10-12-2005 07:42 AM

Compiling MikMod and Allegro togeteher
 
Hi

Does anybody know of a way to compile Mikmod and Allegro in the same program?

I need to write a program that uses both, but I get a conflict in the program headers since both
Allegro and Mikmod define a "SAMPLE" structure... same name with different fields...

Any way I can get them to co-exist in the same program?

Thanks!

rylan76 10-15-2005 02:23 PM

FIXED

I contacted the author of MikMod and he suggested this in the headers to make Allegro and MikMod co-exists:

I know a hack for such situations. Define SAMPLE to MIK_SAMPLE while
including mikmod.

example:
<code>
#include "allegro.h" // SAMPLE is declared inside this file...

#define SAMPLE MIK_SAMPLE
#include "mikmod.h" /* what would have been declared as SAMPLE will be
MIK_SAMPLE */
#undef SAMPLE
</code>

If you need to use mikmod's version of SAMPLE, use MIK_SAMPLE.

This seems to work just fine for getting MikMod and Allegro to co-exist in the same build.


All times are GMT -5. The time now is 10:44 PM.