LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-12-2005, 07:42 AM   #1
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Rep: Reputation: 103Reputation: 103
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!
 
Old 10-15-2005, 02:23 PM   #2
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Original Poster
Rep: Reputation: 103Reputation: 103
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error using C++, allegro and VS 2003 poeta_boy Programming 0 06-12-2005 11:11 PM
Allegro probs -- I have rtfmed CamelofCamelot Programming 2 12-22-2003 08:34 AM
MikMod no worky :( NightShade737 Linux - Software 0 07-05-2003 08:44 AM
Allegro Trex005 Linux - General 6 09-06-2001 07:04 PM
ESS Allegro-1 johncla Linux - Software 1 02-19-2001 11:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration