Hi,

I'm having trouble using lp_solve and mingw at the same time.
I tried compiling a source file including lp_lib.h, and got many errors.

After that, I made a special file, as follows :

#include <lp_lib.h>

So that file only includes a lp_solve header.

when compiling, I get following errors (I cut parts of it, text is about 200 ligns long) :

Scanning dependencies of target lp_solve5
[  9%] Building CXX object src/lp_solve5/CMakeFiles/lp_solve5.dir/lp_solve5test.cpp.obj
In file included from c:\win16app\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/objbase.h:71:0,
                 from c:\win16app\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/ole2.h:9,
                 from c:\win16app\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/windows.h:114,
                 from D:\Lecourt\workspace\otawa\..\lp_solve_5.5/lp_types.h:5,
                 from D:\Lecourt\workspace\otawa\..\lp_solve_5.5/lp_lib.h:210,
                 from D:\Lecourt\workspace\otawa\src\lp_solve5\lp_solve5test.cpp:2:
c:\win16app\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/wtypes.h:97:16: error: expected unqualified-id before string constant
[...]
c:\win16app\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/oaidl.h:213:3: error: expected unqualified-id before string constant
c:\win16app\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/oaidl.h:228:3: error: expected unqualified-id before string constant
c:\win16app\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/oaidl.h:276:3: error: expected unqualified-id before string constant
c:\win16app\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/oaidl.h:290:3: error: expected unqualified-id before string constant
In file included from c:\win16app\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/ole2.h:11:0,
                 from c:\win16app\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/windows.h:114,
                 from D:\Lecourt\workspace\otawa\..\lp_solve_5.5/lp_types.h:5,
                 from D:\Lecourt\workspace\otawa\..\lp_solve_5.5/lp_lib.h:210,
                 from D:\Lecourt\workspace\otawa\src\lp_solve5\lp_solve5test.cpp:2:
c:\win16app\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/oleauto.h:210:44: error: expected identifier before string constant
c:\win16app\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/oleauto.h:210:44: error: expected ',' or '...' before string constant
c:\win16app\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/oleauto.h:211:51: error: expected identifier before string constant
[...]
mingw32-make[2]: *** [src/lp_solve5/CMakeFiles/lp_solve5.dir/lp_solve5test.cpp.obj] Error 1
mingw32-make[1]: *** [src/lp_solve5/CMakeFiles/lp_solve5.dir/all] Error 2
mingw32-make: *** [all] Error 2

I tried 3 versions of lp_solve (2 precompiled, one I compiled myself from source), so I'm thinking the problem lies between lp_solve and minGW, but I have no idea where to start, as mingw header files look fine.

Regards,

Maxime Lecourt