0

I'm trying to compile a project written in C++ and using Allegro 4.2.3 library using Open Watcom C/C++ 2.0 compiler. The OS I'm targetting is MS-DOS.

I'm getting the same errors when using CMake in CLion IDE, and when using Open Watcom IDE (compiler in CMake I was using was wcl386.exe and ninja.exe build tool). I've followed this post to try to fix these errors.

I can build other projects written in C, but not C++

Open Watcom IDE build log:

cd D:\Pulpit\cdostest
wmake -f D:\Pulpit\cdostest\noname.mk -h -e
wpp386 main.cpp -i="C:\WATCOM/h" -i="D:\allegro_lib\include" -w4 -e25 -zq -od -s -d2 -3s -bt=dos -fo=.obj -mf -xs -xr
D:\allegro_lib\include\allegro/internal/alconfig.h(397): Error! E498: col(5) syntax error before 'addr'; probable cause: incorrectly spelled type name
D:\allegro_lib\include\allegro/internal/alconfig.h(397): Note! N393: col(5) included from D:\allegro_lib\include\allegro/base.h(41)
D:\allegro_lib\include\allegro/internal/alconfig.h(397): Note! N393: col(5) included from D:\allegro_lib\include\allegro.h(25)
D:\allegro_lib\include\allegro/internal/alconfig.h(397): Note! N393: col(5) included from main.cpp(2)
D:\allegro_lib\include\allegro/internal/alconfig.h(404): Error! E498: col(5) syntax error before 'addr'; probable cause: incorrectly spelled type name
D:\allegro_lib\include\allegro/base.h(44): Error! E121: col(4) syntax error
D:\allegro_lib\include\allegro/platform/al386wat.h(110): Error! E029: col(4) symbol '_set_errno_erange' has not been declared
D:\allegro_lib\include\allegro/platform/al386wat.h(130): Error! E029: col(4) symbol '_set_errno_erange' has not been declared
D:\allegro_lib\include\allegro/platform/al386wat.h(159): Error! E029: col(4) symbol '_set_errno_erange' has not been declared
D:\allegro_lib\include\allegro/platform/al386wat.h(199): Error! E029: col(4) symbol '_set_errno_erange' has not been declared
D:\allegro_lib\include\allegro/platform/al386wat.h(237): Error! E029: col(4) symbol '_set_errno_erange' has not been declared
D:\allegro_lib\include\allegro/inline/fix.inl(25): Error! E135: col(13) 'friend', 'virtual' or 'inline' modifiers may only be used on functions
D:\allegro_lib\include\allegro/inline/fix.inl(25): Error! E336: col(13) declaration specifiers are required to declare 'fix'
D:\allegro_lib\include\allegro/inline/fix.inl(25): Error! E006: col(13) syntax error; probable cause: missing ';'
D:\allegro_lib\include\allegro/platform/aldos.h(37): Error! E336: col(38) declaration specifiers are required to declare 'KEYBOARD_DRIVER'
D:\allegro_lib\include\allegro/platform/aldos.h(37): Error! E006: col(37) syntax error; probable cause: missing ';'
D:\allegro_lib\include\allegro/platform/aldos.h(43): Error! E336: col(41) declaration specifiers are required to declare 'TIMER_DRIVER'
D:\allegro_lib\include\allegro/platform/aldos.h(43): Error! E006: col(40) syntax error; probable cause: missing ';'
D:\allegro_lib\include\allegro/platform/aldos.h(44): Error! E006: col(43) syntax error; probable cause: missing ';'
D:\allegro_lib\include\allegro/platform/aldos.h(53): Error! E336: col(39) declaration specifiers are required to declare 'MOUSE_DRIVER'
D:\allegro_lib\include\allegro/platform/aldos.h(53): Error! E006: col(38) syntax error; probable cause: missing ';'
D:\allegro_lib\include\allegro/platform/aldos.h(54): Error! E006: col(36) syntax error; probable cause: missing ';'
D:\allegro_lib\include\allegro/platform/aldos.h(55): Error! E006: col(38) syntax error; probable cause: missing ';'
D:\allegro_lib\include\allegro/platform/aldos.h(56): Error! E006: col(36) syntax error; probable cause: missing ';'
D:\allegro_lib\include\allegro/platform/aldos.h(57): Error! E006: col(36) syntax error; probable cause: missing ';'
D:\allegro_lib\include\allegro/platform/aldos.h(99): Error! E336: col(43) declaration specifiers are required to declare 'JOYSTICK_DRIVER'
D:\allegro_lib\include\allegro/platform/aldos.h(99): Error! E006: col(42) syntax error; probable cause: missing ';'
D:\allegro_lib\include\allegro/platform/aldos.h(100): Error! E006: col(39) syntax error; probable cause: missing ';'
D:\allegro_lib\include\allegro/platform/aldos.h(101): Error! E133: col(41) too many errors: compilation aborted
Error(E42): Last command making (D:\Pulpit\cdostest\main.obj) returned a bad status
Error(E02): Make execution terminated
Execution complete
  • A brief search reveals that this "Open Watcom C/C++" compiler was written a very long time ago, back when dinosaurs roamed the Earth. The likelyhood of that compiler being able to compile current C++ code, like Allegro is approximately zero, sorry. You'll need a compiler that supports modern C++. – Sam Varshavchik Aug 18 '22 at 21:50
  • But it's not my code, it's allegro lib that throws errors. Also lib supports open watcom, and dos platform up to 4.2.3 which i'm using. Also good luck finding a modern compiler for dos. Imo open watcom c/c++ 2.0 is most recent compiler that targets dos (1.9 came out in 2010, and 2.0 beta in 2015) – nolemretaW Aug 18 '22 at 21:55

0 Answers0