this is a known issue and I submitted a patch to Allegro github last November >https://github.com/liballeg/allegro5/commit/1d1cc0542c711afe15d4563bbd67f57554ed8d0f
you might want to review the 4.2 branch on Github as there are a
couple other fixes for compilation issues in there
I had installed Allegro from:<br></div><div><a target="_blank" href="http://www.delorie.com/pub/djgpp/current/v2tk/allegro/all422br2.zip">http://www.delorie.com/pub/djgpp/current/v2tk/allegro/all422br2.zip</a></div><div><a target="_blank" href="http://www.delorie.com/pub/djgpp/current/v2tk/allegro/all422ar2.zip">http://www.delorie.com/pub/djgpp/current/v2tk/allegro/all422ar2.zip</a><br></div><div>that seems they date from: 2007-09-08, which I guess is before the problem was known.<br></div></
While compiler kraptor game for DJGPP, I seems to get the same problem as: https://www.allegro.cc/forums/thread/617748
I tried to recompile the game with: -fgnu89-inline but I believe the library itself
would have to be recompile if using gcc newer than version 2.x.
Well, I have some doubts because I would have believe people would have discovered it before me.
Here is an extract of errors I get:
ld: obj/djgpp/captura.o:captura.c:(.text+0x110): multiple definition of `is_same_bitmap'; obj/djgpp/bomba.o:bomba.c:(.text+0x110): first defined here
ld: obj/djgpp/captura.o:captura.c:(.text+0x160): multiple definition of `is_linear_bitmap'; obj/djgpp/bomba.o:bomba.c:(.text+0x160): first defined here
ld: obj/djgpp/captura.o:captura.c:(.text+0x180): multiple definition of `is_planar_bitmap'; obj/djgpp/bomba.o:bomba.c:(.text+0x180): first defined here
ld: obj/djgpp/captura.o:captura.c:(.text+0x1a0): multiple definition of `is_memory_bitmap'; obj/djgpp/bomba.o:bomba.c:(.text+0x1a0): first defined here
ld: obj/djgpp/captura.o:captura.c:(.text+0x1c0): multiple definition of `is_screen_bitmap'; obj/djgpp/bomba.o:bomba.c:(.text+0x1c0): first defined here
ld: obj/djgpp/captura.o:captura.c:(.text+0x210): multiple definition of `is_video_bitmap'; obj/djgpp/bomba.o:bomba.c:(.text+0x210): first defined here
ld: obj/djgpp/captura.o:captura.c:(.text+0x220): multiple definition of `is_system_bitmap'; obj/djgpp/bomba.o:bomba.c:(.text+0x220): first defined here
ld: obj/djgpp/captura.o:captura.c:(.text+0x240): multiple definition of `is_sub_bitmap'; obj/djgpp/bomba.o:bomba.c:(.text+0x240): first defined here
ld: obj/djgpp/captura.o:captura.c:(.text+0x260): multiple definition of `acquire_bitmap'; obj/djgpp/bomba.o:bomba.c:(.text+0x260): first defined here
ld: obj/djgpp/captura.o:captura.c:(.text+0x280): multiple definition of `release_bitmap'; obj/djgpp/bomba.o:bomba.c:(.text+0x280): first defined here
ld: obj/djgpp/captura.o:captura.c:(.text+0x2a0): multiple definition of `acquire_screen'; obj/djgpp/bomba.o:bomba.c:(.text+0x2a0): first defined here
ld: obj/djgpp/captura.o:captura.c:(.text+0x2d0): multiple definition of `release_screen'; obj/djgpp/bomba.o:bomba.c:(.text+0x2d0): first defined here
ld: obj/djgpp/captura.o:captura.c:(.text+0x300): multiple definition of `is_inside_bitmap'; obj/djgpp/bomba.o:bomba.c:(.text+0x300): first defined here
ld: obj/djgpp/captura.o:captura.c:(.text+0x370): multiple definition of `get_clip_rect'; obj/djgpp/bomba.o:bomba.c:(.text+0x370): first defined here
ld: obj/djgpp/captura.o:captura.c:(.text+0x3a0): multiple definition of `set_clip_state'; obj/djgpp/bomba.o:bomba.c:(.text+0x3a0): first defined here
ld: obj/djgpp/captura.o:captura.c:(.text+0x3b0): multiple definition of `get_clip_state'; obj/djgpp/bomba.o:bomba.c:(.text+0x3b0): first defined here
ld: obj/djgpp/captura.o:captura.c:(.text+0x3c0): multiple definition of `makecol15'; obj/djgpp/bomba.o:bomba.c:(.text+0x3c0): first defined here
ld: obj/djgpp/captura.o:captura.c:(.text+0x400): multiple definition of `makecol16'; obj/djgpp/bomba.o:bomba.c:(.text+0x400): first defined here
...
ld: obj/djgpp/combo.o:combo.c:(.text+0x56c): multiple definition of `getg15'; obj/djgpp/bomba.o:bomba.c:(.text+0x560): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x589): multiple definition of `getb15'; obj/djgpp/bomba.o:bomba.c:(.text+0x580): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x5a6): multiple definition of `getr16'; obj/djgpp/bomba.o:bomba.c:(.text+0x5a0): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x5c3): multiple definition of `getg16'; obj/djgpp/bomba.o:bomba.c:(.text+0x5c0): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x5e0): multiple definition of `getb16'; obj/djgpp/bomba.o:bomba.c:(.text+0x5e0): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x5fd): multiple definition of `getr24'; obj/djgpp/bomba.o:bomba.c:(.text+0x600): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x615): multiple definition of `getg24'; obj/djgpp/bomba.o:bomba.c:(.text+0x620): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x62d): multiple definition of `getb24'; obj/djgpp/bomba.o:bomba.c:(.text+0x640): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x645): multiple definition of `getr32'; obj/djgpp/bomba.o:bomba.c:(.text+0x660): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x65d): multiple definition of `getg32'; obj/djgpp/bomba.o:bomba.c:(.text+0x680): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x675): multiple definition of `getb32'; obj/djgpp/bomba.o:bomba.c:(.text+0x6a0): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x68d): multiple definition of `geta32'; obj/djgpp/bomba.o:bomba.c:(.text+0x6c0): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x6a5): multiple definition of `getpixel'; obj/djgpp/bomba.o:bomba.c:(.text+0x6e0): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x6c9): multiple definition of `putpixel'; obj/djgpp/bomba.o:bomba.c:(.text+0x6f0): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x6ee): multiple definition of `_allegro_vline'; obj/djgpp/bomba.o:bomba.c:(.text+0x700): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x719): multiple definition of `_allegro_hline'; obj/djgpp/bomba.o:bomba.c:(.text+0x710): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x744): multiple definition of `line'; obj/djgpp/bomba.o:bomba.c:(.text+0x720): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x772): multiple definition of `fastline'; obj/djgpp/bomba.o:bomba.c:(.text+0x730): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x7a0): multiple definition of `rectfill'; obj/djgpp/bomba.o:bomba.c:(.text+0x740): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x7ce): multiple definition of `triangle'; obj/djgpp/bomba.o:bomba.c:(.text+0x750): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x7ff): multiple definition of `polygon'; obj/djgpp/bomba.o:bomba.c:(.text+0x760): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x827): multiple definition of `rect'; obj/djgpp/bomba.o:bomba.c:(.text+0x780): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x858): multiple definition of `circle'; obj/djgpp/bomba.o:bomba.c:(.text+0x7a0): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x886): multiple definition of `circlefill'; obj/djgpp/bomba.o:bomba.c:(.text+0x7c0): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x8b4): multiple definition of `ellipse'; obj/djgpp/bomba.o:bomba.c:(.text+0x7e0): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x8e5): multiple definition of `ellipsefill'; obj/djgpp/bomba.o:bomba.c:(.text+0x800): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x916): multiple definition of `arc'; obj/djgpp/bomba.o:bomba.c:(.text+0x820): first defined here
ld: obj/djgpp/combo.o:combo.c:(.text+0x94a): multiple definition of `spline'; obj/djgpp/bomba.o:bomba.c:(.text+0x840): first defined here
...
ld: obj/djgpp/partic.o:partic.c:(.text+0x719): multiple definition of `_allegro_hline'; obj/djgpp/bomba.o:bomba.c:(.text+0x710): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0x744): multiple definition of `line'; obj/djgpp/bomba.o:bomba.c:(.text+0x720): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0x772): multiple definition of `fastline'; obj/djgpp/bomba.o:bomba.c:(.text+0x730): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0x7a0): multiple definition of `rectfill'; obj/djgpp/bomba.o:bomba.c:(.text+0x740): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0x7ce): multiple definition of `triangle'; obj/djgpp/bomba.o:bomba.c:(.text+0x750): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0x7ff): multiple definition of `polygon'; obj/djgpp/bomba.o:bomba.c:(.text+0x760): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0x827): multiple definition of `rect'; obj/djgpp/bomba.o:bomba.c:(.text+0x780): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0x858): multiple definition of `circle'; obj/djgpp/bomba.o:bomba.c:(.text+0x7a0): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0x886): multiple definition of `circlefill'; obj/djgpp/bomba.o:bomba.c:(.text+0x7c0): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0x8b4): multiple definition of `ellipse'; obj/djgpp/bomba.o:bomba.c:(.text+0x7e0): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0x8e5): multiple definition of `ellipsefill'; obj/djgpp/bomba.o:bomba.c:(.text+0x800): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0x916): multiple definition of `arc'; obj/djgpp/bomba.o:bomba.c:(.text+0x820): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0x94a): multiple definition of `spline'; obj/djgpp/bomba.o:bomba.c:(.text+0x840): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0x972): multiple definition of `floodfill'; obj/djgpp/bomba.o:bomba.c:(.text+0x860): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0x99a): multiple definition of `polygon3d'; obj/djgpp/bomba.o:bomba.c:(.text+0x880): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0x9c8): multiple definition of `polygon3d_f'; obj/djgpp/bomba.o:bomba.c:(.text+0x8a0): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0x9f6): multiple definition of `triangle3d'; obj/djgpp/bomba.o:bomba.c:(.text+0x8c0): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0xa27): multiple definition of `triangle3d_f'; obj/djgpp/bomba.o:bomba.c:(.text+0x8e0): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0xa58): multiple definition of `quad3d'; obj/djgpp/bomba.o:bomba.c:(.text+0x900): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0xa8c): multiple definition of `quad3d_f'; obj/djgpp/bomba.o:bomba.c:(.text+0x920): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0xac0): multiple definition of `draw_sprite'; obj/djgpp/bomba.o:bomba.c:(.text+0x940): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0xb0e): multiple definition of `draw_sprite_v_flip'; obj/djgpp/bomba.o:bomba.c:(.text+0x990): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0xb33): multiple definition of `draw_sprite_h_flip'; obj/djgpp/bomba.o:bomba.c:(.text+0x9a0): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0xb58): multiple definition of `draw_sprite_vh_flip'; obj/djgpp/bomba.o:bomba.c:(.text+0x9b0): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0xb7d): multiple definition of `draw_trans_sprite'; obj/djgpp/bomba.o:bomba.c:(.text+0x9c0): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0xbcb): multiple definition of `draw_lit_sprite'; obj/djgpp/bomba.o:bomba.c:(.text+0xa10): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0xbf6): multiple definition of `draw_gouraud_sprite'; obj/djgpp/bomba.o:bomba.c:(.text+0xa20): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0xc2a): multiple definition of `draw_character_ex'; obj/djgpp/bomba.o:bomba.c:(.text+0xa40): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0xc58): multiple definition of `rotate_sprite'; obj/djgpp/bomba.o:bomba.c:(.text+0xa50): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0xccc): multiple definition of `rotate_sprite_v_flip'; obj/djgpp/bomba.o:bomba.c:(.text+0xaa0): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0xd40): multiple definition of `rotate_scaled_sprite'; obj/djgpp/bomba.o:bomba.c:(.text+0xaf0): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0xdcc): multiple definition of `rotate_scaled_sprite_v_flip'; obj/djgpp/bomba.o:bomba.c:(.text+0xb60): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0xe58): multiple definition of `pivot_sprite'; obj/djgpp/bomba.o:bomba.c:(.text+0xbd0): first defined here
ld: obj/djgpp/partic.o:partic.c:(.text+0xeab): multiple definition of `pivot_sprite_v_flip'; obj/djgpp/bomba.o:bomba.c:(.text+0xc20): first defined her
I now think that adding "external" before declarations in .h is the
correct solution.
If they were not mark static already, it is that the value is expected
to be shared (being global).
The solution is *I now think* to add external, and have the real
declaration in a unique place, like in main.c.
Using -fcommon is certainly not the correct correction (but could be a workaround for old programs with a lot of occurence of this problem),
but adding extern or static depending on if the variable should be
shared or not is better.
I now think that adding "external" before declarations in .h is the correct solution.
If they were not mark static already, it is that the value is expected to be shared (being global).
The solution is *I now think* to add external, and have the real declaration in a unique place, like in main.c.
</div><div>I can now confirm this is a change in GCC 10 ( from <a target="_blank" href="https://gcc.gnu.org/gcc-10/changes.html">https://gcc.gnu.org/gcc-10/changes.html</a> ):<br></div><div>"GCC now defaults to <code>-fno-common</code>. As a result,global
</div><div><br></div><div>I noted these parameters that can seems usefull for FreeDOS and less for DJGPP:<br></div><div><br></div><dt><code>-remap</code><br></dt><dd><p>Enable special code to work around file systems which only permit veryshort file names, such as MS-DOS.<br></p></dd><dt><code>-fexec-charset=<var>charset</var></code><br></dt><dd><p>Set the execution character set, used for string and character
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 365 |
Nodes: | 16 (2 / 14) |
Uptime: | 79:39:09 |
Calls: | 7,775 |
Calls today: | 1 |
Files: | 12,911 |
Messages: | 5,750,056 |