Using g++ from MinGW trying to compile some programme causes errors.
MWE:
#include <cstdlib>
#define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
CPXDEPRECATEDAPI(12040000) void CPXopenCPLEX();
using namespace std;
int main(int argc, char** argv) {
return 0;
}
Then compiling with
g++ -c -g -MMD -MP -MF "build/Debug/MinGW-Windows/main.o.d" -o build/Debug/MinGW-Windows/main.o main.cpp
gives the error messages
(g++ version 5.3.0 from MinGW_w64):
main.cpp:2:56: error: expected ')' before 'deprecated'
#define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^
main.cpp:4:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000) void CPXopenCPLEX();
^
main.cpp:2:56: error: expected ')' before 'deprecated'
#define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^
main.cpp:4:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000) void CPXopenCPLEX();
^
main.cpp:4:46: error: declaration does not declare anything [-fpermissive]
CPXDEPRECATEDAPI(12040000) void CPXopenCPLEX();
or with g++ version 4.7.2 from MinGW (32 bit):
main.cpp:4:1: error: expected ')' before 'deprecated'
main.cpp:4:1: error: expected ')' before 'deprecated'
main.cpp:4:1: error: 'deprecated' does not name a type
Why do I get these errors? How to get rid of them?
MWE:
#include <cstdlib>
#define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
CPXDEPRECATEDAPI(12040000) void CPXopenCPLEX();
using namespace std;
int main(int argc, char** argv) {
return 0;
}
Then compiling with
g++ -c -g -MMD -MP -MF "build/Debug/MinGW-Windows/main.o.d" -o build/Debug/MinGW-Windows/main.o main.cpp
gives the error messages
(g++ version 5.3.0 from MinGW_w64):
main.cpp:2:56: error: expected ')' before 'deprecated'
#define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^
main.cpp:4:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000) void CPXopenCPLEX();
^
main.cpp:2:56: error: expected ')' before 'deprecated'
#define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
^
main.cpp:4:1: note: in expansion of macro 'CPXDEPRECATEDAPI'
CPXDEPRECATEDAPI(12040000) void CPXopenCPLEX();
^
main.cpp:4:46: error: declaration does not declare anything [-fpermissive]
CPXDEPRECATEDAPI(12040000) void CPXopenCPLEX();
or with g++ version 4.7.2 from MinGW (32 bit):
main.cpp:4:1: error: expected ')' before 'deprecated'
main.cpp:4:1: error: expected ')' before 'deprecated'
main.cpp:4:1: error: 'deprecated' does not name a type
Why do I get these errors? How to get rid of them?
Last edited: