Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
  • 1.  Linking c++ and CPLEX

    Posted Fri December 13, 2013 06:42 AM

    Originally posted by: MauricioA


    Hi everyone:

    I am new to c++ and CPLEX. I am getting the following error when running a "Hello world" program in VS 2012 (running version 12.6 of CPLEX). I have followed the instructions provided by other users to link c++ and CPLEX. I have added all the libraries and settings in Projects>Properties (VS 2012) but I am still not able to run this little program. The build log from c++ is below. Any help is highly appreciated.

     

    1>------ Build started: Project: IloCplex, Configuration: Release Win32 ------
    1>codec++.obj : error LNK2001: unresolved external symbol "public: __thiscall IloEnvI::~IloEnvI(void)" (??1IloEnvI@@QAE@XZ)
    1>codec++.obj : error LNK2001: unresolved external symbol "public: __thiscall IloEnv::IloEnv(void)" (??0IloEnv@@QAE@XZ)
    1>c:\users\mauricio2\documents\visual studio 2012\Projects\IloCplex\Release\IloCplex.exe : fatal error LNK1120: 2 unresolved externals
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Linking c++ and CPLEX

    Posted Fri December 13, 2013 09:24 AM

    When you say you "followed the instructions provided by others", did you also check the file c_cpp.html that is shipped with the CPLEX distribution and gives detailed information about how to configure projects?

    Can you build any of the example projects that come with CPLEX? They come with preconfigured project files that should work out of the box?


    #CPLEXOptimizers
    #DecisionOptimization