-3

I am a beginner in C++. I would like to use C++/Concert technology to code an optimization model. I read some tutorials to set up CPLEX Concert with C++ on Windows. I tried both Release and Debug modes. Finally I settled with the Debug mode. My computer has a 64-bit OS, the installed Cplex version is 12.6.1. I am using Visual Studio 2013. To build solution, I selected Debug in the Active Solution and x64 for the new platform. After compiling, I faced with the following error:

https://i.stack.imgur.com/459us.png))".

The code is not mine, it is from tutorial file here pages 8-9.

error C2018: unknown character '0x3'

Can anyone help me to fix this error?

Chait
  • 1,052
  • 2
  • 18
  • 30
rezzz
  • 151
  • 1
  • 1
  • 8
  • Can you post the code fragment here or at least upload a decent picture? right now I see nothing but bunch of pixels. – serge_k Feb 25 '16 at 07:51
  • Thank you Serge! The code is not mine! I just use the example of one tutorial: – rezzz Feb 25 '16 at 14:27
  • @Serge, I changed the question and you can see the source program in the second link as well as the picture of the error that I have in the second one. Thank you again! – rezzz Feb 25 '16 at 14:49

2 Answers2

0

Cplex is 32-bit application so you should change x64 to x86 in the field next to Debug in the VS panel.

serge_k
  • 1,772
  • 2
  • 15
  • 21
  • I changed but still I have this error: "fatal error LNK1112: module machine type 'x86' conflicts with target machine type 'X64'". – rezzz Feb 25 '16 at 15:32
  • In the following link, they completely explained the steps, however I checked the steps and could not overcome it. http://stackoverflow.com/questions/3563756/fatal-error-lnk1112-module-machine-type-x64-conflicts-with-target-machine-typ .In linker the libraries that I added are as follows, do you think there is something wrong on these libraries? C:\Program Files (x86)\IBM\ILOG\CPLEX_Studio1261\cplex\lib\x86_windows_vs2013\stat_mdd; C:\Program Files (x86)\IBM\ILOG\CPLEX_Studio1261\concert\lib\x86_windows_vs2013\stat_mdd – rezzz Feb 25 '16 at 15:37
0

On page 7/20, step II.(e), the authors of the document advise to link with the cplex library: cplex121.lib, since they were using CPLEX 12.1. Please notice you should be entering cplex1261.lib instead. Also, there's no need to indicate the full path to the libraries there, you could use cplex1261.lib, concert.lib and ilocplex.lib instead.

I recommend you this tutorial on how to setup the C++ with CPLEX link, is simple and quite straightforward:

Chait
  • 1,052
  • 2
  • 18
  • 30
Jacko
  • 88
  • 12