I have been sent code for a program built in C that uses a reinforcement learning algorithm. I need to modify it, yet I am having difficulties with compiling the code in the first place. Here are the outputs in CodeBlocks.
All errors come from one line of code in a header file, which is part of the IBM CPLEX include directory (includecplexcpxconst.h)
The line of code in question is as follows.
define CPXDEPRECATEDAPI(version) __declspec(dllimport deprecated)
error messages are multiple types of syntax errors such as: error: expected identifier or '(' before ')' token
Each error has notes: to multiple lines of code in the file ilcplexcplex.h
I am using CodeBlocks in Windows 10
CPLEX version is 12.9.0
FULL ERROR MESSAGE
||=== Build: Release in SWEM2020 (compiler: GNU GCC Compiler) ===|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected ')' before 'deprecated'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1194|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected identifier or '(' before ')' token|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1194|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected ')' before 'deprecated'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1200|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected identifier or '(' before ')' token|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1200|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected ')' before 'deprecated'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1231|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:UsersTingleOneDriveDocumentsCodingSWEM2020swemextras.h|16|error: conflicting types for 'trunc'|
c:mingwincludemath.h|820|note: previous declaration of 'trunc' was here|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected ')' before 'deprecated'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1194|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected identifier or '(' before ')' token|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1194|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected ')' before 'deprecated'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1200|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected identifier or '(' before ')' token|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1200|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected ')' before 'deprecated'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1231|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected identifier or '(' before ')' token|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1231|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected ')' before 'deprecated'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1237|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected identifier or '(' before ')' token|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1237|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected ')' before 'deprecated'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1242|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected identifier or '(' before ')' token|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1242|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected ')' before 'deprecated'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1597|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected identifier or '(' before ')' token|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1597|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_genetic1.c||In function 'GeneticAlgorithm1':|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_genetic1.c|64|warning: too many arguments for format [-Wformat-extra-args]|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_genetic1.c|67|warning: unused variable 'lostLoad' [-Wunused-variable]|
C:UsersTingleOneDriveDocumentsCodingSWEM2020dlist.c|137|error: conflicting types for 'InsertInOrder_dlist'|
C:UsersTingleOneDriveDocumentsCodingSWEM2020dlist.h|19|note: previous declaration of 'InsertInOrder_dlist' was here|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected identifier or '(' before ')' token|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1231|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected ')' before 'deprecated'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1237|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected identifier or '(' before ')' token|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1237|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected ')' before 'deprecated'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1242|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected identifier or '(' before ')' token|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1242|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected ')' before 'deprecated'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1597|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcpxconst.h|243|error: expected identifier or '(' before ')' token|
C:Program FilesIBMILOGCPLEX_Studio_Community129cplexincludeilcplexcplex.h|1597|note: in expansion of macro 'CPXDEPRECATEDAPI'|
C:UsersTingleOneDriveDocumentsCodingSWEM2020swemextras.h|16|error: conflicting types for 'trunc'|
c:mingwincludemath.h|820|note: previous declaration of 'trunc' was here|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c||In function 'RFAlgorithm1':|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c|183|warning: too many arguments for format [-Wformat-extra-args]|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c|185|warning: unused variable 'lostLoad' [-Wunused-variable]|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c||In function 'Alg_MERwFirms_MustRun':|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c|466|warning: unused variable 'lostLoad' [-Wunused-variable]|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c||In function 'Alg_MERwFirms':|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c|727|warning: too many arguments for format [-Wformat-extra-args]|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c|729|warning: unused variable 'lostLoad' [-Wunused-variable]|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c||In function 'Alg_MERwFirmsSoftmax':|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c|934|warning: too many arguments for format [-Wformat-extra-args]|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c|936|warning: unused variable 'lostLoad' [-Wunused-variable]|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c||In function 'Alg_ERSpilloverwFirms':|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c|1179|warning: too many arguments for format [-Wformat-extra-args]|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c|1181|warning: unused variable 'lostLoad' [-Wunused-variable]|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c||In function 'Alg_ERSpilloverwFirmsSoftmax':|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c|1393|warning: too many arguments for format [-Wformat-extra-args]|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c|1395|warning: unused variable 'lostLoad' [-Wunused-variable]|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c||In function 'RFAlgorithm':|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c|1573|warning: too many arguments for format [-Wformat-extra-args]|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c|1575|warning: unused variable 'lostLoad' [-Wunused-variable]|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c||In function 'RFAlgorithmM':|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c|1784|warning: too many arguments for format [-Wformat-extra-args]|
C:UsersTingleOneDriveDocumentsCodingSWEM2020alg_rf.c|1786|warning: unused variable 'lostLoad' [-Wunused-variable]|
||=== Build failed: 27 error(s), 17 warning(s) (0 minute(s), 2 second(s)) ===|
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…