0

I use Visual C++ 2010 express to create C++ programs. Now I need to work with CPLEX and I have download the 90 day trial from the IBM website. However, I don't get the cplex working.

I already followed the steps given on internet (http://hassanbaalbakiblog.blogspot.nl/2011/06/configure-visual-studio-c-2008-express.html). I also include the header files.

At the properties page I have changed the following:

  • C/C++ > Preprocessor > Preprocessor Definitions
    Here I add IL_STD

  • C/C++ > Code generation > Runtime Library
    set the value to Multi-threaded (/MT)

  • C/C++ > General > Additional Include Directories
    C:\Program Files\IBM\ILOG\CPLEX_Studio_Preview126\concert\include
    C:\Program Files\IBM\ILOG\CPLEX_Studio_Preview126\cplex\include

  • Linker > Input > Additional Depencdencies: C:\Program Files\IBM\ILOG\CPLEX_Studio_Preview126\cplex\lib\x64_windows_vs2010\stat_mta\cplex1260.lib
    C:\Program Files\IBM\ILOG\CPLEX_Studio_Preview126\cplex\lib\x64_windows_vs2010\stat_mta\ilocplex.lib
    C:\Program Files\IBM\ILOG\CPLEX_Studio_Preview126\concert\lib\x64_windows_vs2010\stat_mta\concert.lib

  • Configuration Set this to Active(Release)

When I don't create the ilo environment it is working, however, when I add the ilo environment I get the following error:

1>cplex_test.obj : error LNK2001: unresolved external symbol "public: __thiscall IloEnv::IloEnv(void)" (??0IloEnv@@QAE@XZ)

1>C:\Users\Michiel\Documents\Visual Studio 2010\Projects\cplex_test\Release\cplex_test.exe : fatal error LNK1120: 1 unresolved externals

How can I get the cplex working?

#include "stdafx.h"
#include <iostream>
#include "C:\Program Files\IBM\ILOG\CPLEX_Studio_Preview126\cplex\include\ilcplex\cplex.h"
#include "C:\Program Files\IBM\ILOG\CPLEX_Studio_Preview126\cplex\include\ilcplex\ilocplex.h"

using namespace std;

int main() {
  IloEnv env; //this line causes the error
  cin.get(); 
  return 0;
}
  • possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – πάντα ῥεῖ Aug 05 '14 at 11:37
  • Did you specify to link the library files accordingly? – πάντα ῥεῖ Aug 05 '14 at 11:37
  • I have add Additional Dependencies via Configuration Properties > Linker > Input > Additional Dependencies. C:\Program Files\IBM\ILOG\CPLEX_Studio_Preview126\cplex\lib\x64_windows_vs2010\stat_mta\cplex1260.lib C:\Program Files\IBM\ILOG\CPLEX_Studio_Preview126\cplex\lib\x64_windows_vs2010\stat_mta\ilocplex.lib C:\Program Files\IBM\ILOG\CPLEX_Studio_Preview126\concert\lib\x64_windows_vs2010\stat_mta\concert.lib – Michiel uit het Broek Aug 05 '14 at 11:41
  • 1
    What project configuration do you use? You need to use `Release` configuration for `x64` platform. – Holt Aug 05 '14 at 11:42
  • Yes I use Release. At the properties page this is indicated as Active(Release). – Michiel uit het Broek Aug 05 '14 at 11:53

0 Answers0