Topic
6 replies Latest Post - ‏2013-08-07T14:32:07Z by T_Prickett
MajidYazdani
MajidYazdani
3 Posts
ACCEPTED ANSWER

Pinned topic How should I connect CP optimizer to c++ test problems in src

‏2013-07-03T10:26:28Z |

Dear System admin :)

I think I have a problem with linking CP to your test problems. I used Microsoft visual studio 2008 .netframework and

I  added

H:\ILOG\CPLEX_Studio_Preview122\cpoptimizer\include;

H:\ILOG\CPLEX_Studio_Preview122\concert\include

to c/c++->general

and also :

wsock32.lib

H:\ILOG\CPLEX_Studio_Preview122\concert\lib\x86_windows_vs2008\stat_mda\concert.lib
H:\ILOG\CPLEX_Studio_Preview122\cpoptimizer\lib\x86_windows_vs2008\stat_mda\cp.lib

to Linker->input

but unfortunatelly there are too many bugs and errors telling me that I have done something wrong, I also changed the test problem but it didn't work.

maybe I don't know how to add CP to my project, could you please tell me how should I do that?

Attachments

Updated on 2013-07-03T18:37:58Z at 2013-07-03T18:37:58Z by MajidYazdani
  • PhilippeLaborie
    PhilippeLaborie
    28 Posts
    ACCEPTED ANSWER

    Re: How should I connect CP optimizer to c++ test problems in src

    ‏2013-07-04T07:25:47Z  in response to MajidYazdani

    Hello,

    It seems that you are at least missing the CPLEX library for linking. You can have a look at the delivered MSVC projects for cpoptimizer in your installation.

    On my installation (for 12.3 but that should be quite similar in 12.2) for the example color.cpp, I have the following options:
     

    For the compiler:

    /Ob1 /I "..\..\..\include" /I "..\..\..\..\concert\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "IL_STD" /D "ILOUSEMT" /D "_CRT_SECURE_NO_DEPRECATE" /GF /FD /EHsc /MD /Gy /Fp"./color.pch" /Fo"./" /Fd"./color" /W3 /nologo /c /errorReport:prompt

    For the linker:

    /OUT:"./color.exe" /INCREMENTAL:NO /NOLOGO /MANIFEST /MANIFESTFILE:".\color.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /PDB:"./color.pdb" /SUBSYSTEM:CONSOLE /DYNAMICBASE:NO /ERRORREPORT:PROMPT "..\..\..\lib\x86_windows_vs2008\stat_mda\cp.lib" "..\..\..\..\cplex\lib\x86_windows_vs2008\stat_mda\cplex123.lib" "..\..\..\..\concert\lib\x86_windows_vs2008\stat_mda\concert.lib" odbc32.lib odbccp32.lib wsock32.lib  kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

    As a side note: V12.2 is quite an old version for CPLEX Optimization Studio. Current version is 12.5.1.

    Philippe

     

    • This reply was deleted by MajidYazdani 2013-07-04T17:47:59Z. Reason for deletion: the same have been posted
    • This reply was deleted by MajidYazdani 2013-07-04T17:47:47Z. Reason for deletion: the same have been posted
    • MajidYazdani
      MajidYazdani
      3 Posts
      ACCEPTED ANSWER

      Re: How should I connect CP optimizer to c++ test problems in src

      ‏2013-07-04T17:37:34Z  in response to PhilippeLaborie

      Dear PhilippeLaborie

      Thanks for your reply, Here is a simple test problem I made myself in visual studio 2008 but since I know you may use VS 2012 I translated it to 2012 but my platform is still V90. you can easily change it to v11 or whatever you want in properties section. could you please check and tell me if I made any mistake in modifying the properties of my own simple project or not(in linker .. c,c++ include or whatever else you know ..)?

      I have made projects and added CPLEX optimzer for mixed integer and linear problems , my projects ran completely and there was no problem but I don't know what is the problem with my CP optimizer. I have heard its library is dll not static! I don't know what it really means and if it makes any difference in making my project or not!

      ..

      File is uploaded at: http://www.uploadmb.com/dw.php?id=1372959065

      Updated on 2013-07-04T17:46:14Z at 2013-07-04T17:46:14Z by MajidYazdani
  • PhilippeLaborie
    PhilippeLaborie
    28 Posts
    ACCEPTED ANSWER

    Re: How should I connect CP optimizer to c++ test problems in src

    ‏2013-07-05T07:33:58Z  in response to MajidYazdani

    Hello,

    Sorry, I do not have VS 2012 installed. Did you try building some executable examples from the delivery of CP Optimizer in cpoptimizer\examples\x86_windows_vs2008\stat_mda\examples.sln ? Does it work? If yes, I suggest you compare the properties of your project with the ones of the delivered projects. You can see the full command line for compiling and for linking respectively in Configuration Properties > C/C++ > Command Line and Configuration Properties > Linker > Command Line.

    Also, I see that you link with CP Optimizer libraries in "test-for implimenting cp\test1\", you should make sure that these really are the x86_windows_vs2008\stat_mda version of the  libraries.

    Philippe

    • T_Prickett
      T_Prickett
      2 Posts
      ACCEPTED ANSWER

      Re: How should I connect CP optimizer to c++ test problems in src

      ‏2013-08-07T13:15:39Z  in response to PhilippeLaborie

      Hello,

      I too am having difficulty linking IBM ILOG CP V1.6 with Microsoft Visual Studio 2012. I have followed the instructions supplied.

      This result in a large number of errors similar to:

      concert.lib(iloparami.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __cdecl std::_Mutex::_Lock(void)" (__imp_?_Lock@_Mutex@std@@QEAAXXZ

      Is it likely I am doing something stupid or are there issues related to using Microsoft Visual Studio 2012?

      Any ideas much appreciated.

      Tom

       

       

      Updated on 2013-08-07T13:18:00Z at 2013-08-07T13:18:00Z by T_Prickett
      • PhilippeLaborie
        PhilippeLaborie
        28 Posts
        ACCEPTED ANSWER

        Re: How should I connect CP optimizer to c++ test problems in src

        ‏2013-08-07T14:11:20Z  in response to T_Prickett

        Hello,

        I think your problem is different from the one mentioned by MajidYazdani in this thread. You are referring to IBM ILOG CP V1.6 which is the old generation of CP tools (a.k.a. ILOG Solver/Scheduler) whereas MajidYazdani was referring to CP Optimizer, one of the optimizers provided in IBM ILOG CPLEX Optimization Studio.

        IBM ILOG CP V1.6 is not ported on Microsoft Visual Studio 2012, it only provides libraries for Microsoft Visual Studio 2005 and 2008.

        Philippe

        • T_Prickett
          T_Prickett
          2 Posts
          ACCEPTED ANSWER

          Re: How should I connect CP optimizer to c++ test problems in src

          ‏2013-08-07T14:32:07Z  in response to PhilippeLaborie

          Thanks. That will explain it.

          Tom