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 (include\cplex\cpxconst.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 ilcplex\cplex.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 Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected ')' before 'deprecated'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1194|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected identifier or '(' before ')' token| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1194|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected ')' before 'deprecated'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1200|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected identifier or '(' before ')' token| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1200|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected ')' before 'deprecated'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1231|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\swemextras.h|16|error: conflicting types for 'trunc'| c:\mingw\include\math.h|820|note: previous declaration of 'trunc' was here| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected ')' before 'deprecated'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1194|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected identifier or '(' before ')' token| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1194|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected ')' before 'deprecated'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1200|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected identifier or '(' before ')' token| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1200|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected ')' before 'deprecated'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1231|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected identifier or '(' before ')' token| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1231|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected ')' before 'deprecated'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1237|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected identifier or '(' before ')' token| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1237|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected ')' before 'deprecated'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1242|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected identifier or '(' before ')' token| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1242|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected ')' before 'deprecated'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1597|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected identifier or '(' before ')' token| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1597|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_genetic1.c||In function 'GeneticAlgorithm1':| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_genetic1.c|64|warning: too many arguments for format [-Wformat-extra-args]| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_genetic1.c|67|warning: unused variable 'lostLoad' [-Wunused-variable]| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\dlist.c|137|error: conflicting types for 'InsertInOrder_dlist'| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\dlist.h|19|note: previous declaration of 'InsertInOrder_dlist' was here| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected identifier or '(' before ')' token| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1231|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected ')' before 'deprecated'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1237|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected identifier or '(' before ')' token| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1237|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected ')' before 'deprecated'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1242|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected identifier or '(' before ')' token| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1242|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected ')' before 'deprecated'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1597|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cpxconst.h|243|error: expected identifier or '(' before ')' token| C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\include\ilcplex\cplex.h|1597|note: in expansion of macro 'CPXDEPRECATEDAPI'| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\swemextras.h|16|error: conflicting types for 'trunc'| c:\mingw\include\math.h|820|note: previous declaration of 'trunc' was here| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c||In function 'RFAlgorithm1':| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c|183|warning: too many arguments for format [-Wformat-extra-args]| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c|185|warning: unused variable 'lostLoad' [-Wunused-variable]| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c||In function 'Alg_MERwFirms_MustRun':| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c|466|warning: unused variable 'lostLoad' [-Wunused-variable]| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c||In function 'Alg_MERwFirms':| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c|727|warning: too many arguments for format [-Wformat-extra-args]| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c|729|warning: unused variable 'lostLoad' [-Wunused-variable]| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c||In function 'Alg_MERwFirmsSoftmax':| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c|934|warning: too many arguments for format [-Wformat-extra-args]| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c|936|warning: unused variable 'lostLoad' [-Wunused-variable]| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c||In function 'Alg_ERSpilloverwFirms':| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c|1179|warning: too many arguments for format [-Wformat-extra-args]| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c|1181|warning: unused variable 'lostLoad' [-Wunused-variable]| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c||In function 'Alg_ERSpilloverwFirmsSoftmax':| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c|1393|warning: too many arguments for format [-Wformat-extra-args]| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c|1395|warning: unused variable 'lostLoad' [-Wunused-variable]| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c||In function 'RFAlgorithm':| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c|1573|warning: too many arguments for format [-Wformat-extra-args]| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c|1575|warning: unused variable 'lostLoad' [-Wunused-variable]| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c||In function 'RFAlgorithmM':| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c|1784|warning: too many arguments for format [-Wformat-extra-args]| C:\Users\Tingle\OneDrive\Documents\Coding\SWEM2020\alg_rf.c|1786|warning: unused variable 'lostLoad' [-Wunused-variable]| ||=== Build failed: 27 error(s), 17 warning(s) (0 minute(s), 2 second(s)) ===|