Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Using CPLEX in MS VC++ 2008

    Posted 05/11/10 07:59 PM

    Originally posted by: Jaeyoung


    I'm new to CPLEX. My environment is Windows XP, MSVC++ 2008 with MFC application with "using namespace std;"
    I recently added CPLEX in my project. I've added Libs, additional including paths in the project setting.

    1) Initial try (just followed examples in CPLEX folder)
    Added the followings in my source file "myFile.cpp"
    #include <ilcplex/ilocplex.h>
    ILOSTLBEGIN

    Then, I've got an error "c:\ilog\concert29\include\ilconcert\ilosys.h(382) : fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory"
    2) 2nd try
    "#define ILO_STL" <= I added
    #include <ilcplex/ilocplex.h>
    ILOSTLBEGIN

    Then I've got 47 link errors saying "conflict with already existing libraries (MSVCRT)"
    3) 3rd try
    Changed the Runtime Library setting from "Multi-threaded Debug" to "Multi-threaded DLL Debug"
    and added "#define _AFXDLL" in stdafx.h
    Then no errors, but still getting "warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library"

    Trying (3) is right? Could anyone help me?
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Using CPLEX in MS VC++ 2008

    Posted 05/12/10 02:25 AM

    Originally posted by: SystemAdmin


    I am not an expert in this but from looking at the source code I'd suggest that in your 2nd attempt you also (or only?) define ILOUSESTL:
    #define ILOUSESTL
    #include <ilcplex/ilocplex.h>
    

    Does this help?
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Using CPLEX in MS VC++ 2008

    Posted 05/12/10 03:20 PM

    Originally posted by: Jaeyoung


    Hi Daniel,

    I've added "ILOUSESTL", blocked "ILOSTLBEGIN", and reset the Runtime Lib from "Multi-threaded DLL" to "Multi-threaded".

    #define ILOUSESTL
    #include <ilcplex/ilocplex.h>

    but it is still showing the same 47 link errors in 2nd attempt. I guess the key is setting "Multi-threaded DLL" in Runtime Library.
    Actually 3rd attempt works (in Debug Mode) whatever I put "ILOUSESTL" or "ILO_STL", but it still show two warnings.

    Anyway, thanks for your help!! :)

    Jaeyoung
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Using CPLEX in MS VC++ 2008

    Posted 05/12/10 08:08 PM

    Originally posted by: RodrigoLinfati


    Hi, see the document http://www.slideshare.net/rlinfati/primer-programa-en-ilog-cplex-concert

    is in spanish, but have a lor of images... if still need help, i can re-write it in english.

    Bye.
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Using CPLEX in MS VC++ 2008

    Posted 05/12/10 08:30 PM

    Originally posted by: GuangFeng


    A few quick hints:
    1. Debug version of runtime libraries are not supported. You also need to add IL_STD to the Preprocessor list. You can find more information in <CPLEX_dir>/c_cpp.html
    2. Your program and libraries need to be compiled with a consistent choice of runtime libraries. For example, if some of libraries are compiled with debug version of runtime libraries and the others are not or if you choose to compile your application with a different kind of runtime libraries from the one used to build the libraries, you are likely to see this error. So when you change the choice of runtime libraries, you are suggested to recompile all the libraries or find the version that is consistent with your new choice.
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Using CPLEX in MS VC++ 2008

    Posted 05/13/10 05:20 PM

    Originally posted by: Jaeyoung


    RodrigoLinfati and GuangFeng

    Thanks it would be a great help. I didn't know even I have the "c_cpp.html" in my CPLEX folder.

    On release mode, everything is fine except "warning LNK4199: /DELAYLOAD:OleAcc.dll ignored; no imports found from OleAcc.dll", but i don't think that warning is related with CPLEX.

    Best,

    Jaeyoung
    #CPLEXOptimizers
    #DecisionOptimization