Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

cplex concert with Visual Studio Community 2015

Archive User

Archive UserMon January 23, 2017 06:30 PM

  • 1.  cplex concert with Visual Studio Community 2015

    Posted Sun December 06, 2015 08:35 PM

    Originally posted by: Roni.Mohammad


    Hi,

    Does anybody has trouble with configuring cplex (1262)  c++ concert with Visual Studio Community 2015 or visual studio professional 2015? My question is -Does cplex C++ concert technology support visual studio 2015?  All of my current cplex  project  is in visual studio 2013. 


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: cplex concert with Visual Studio Community 2015

    Posted Mon December 07, 2015 02:43 AM

    Visual Studio 2015 is not directly supported by CPLEX yet. In order to use the Visual Studio 2015 development environment, you can use these instructions to switch it to using VS2013 compiler.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: cplex concert with Visual Studio Community 2015

    Posted Thu December 17, 2015 04:04 AM

    Originally posted by: Eddie Breeveld


    Thanks Xavier, Do you know when a version will be released that does support the VS 2015 C++ compiler?

    All the best, Eddie


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: cplex concert with Visual Studio Community 2015

    Posted Tue January 05, 2016 03:53 AM

    We plan to add support for VS2015 before the end of 2016.


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: cplex concert with Visual Studio Community 2015

    Posted Fri April 08, 2016 03:22 AM

    Originally posted by: FritsFredrick


    We (Actemium Belgium) are also interested in a CPLEX release ported to VS 2015 C++.


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: cplex concert with Visual Studio Community 2015

    Posted Wed January 11, 2017 10:08 PM

    Originally posted by: BayanB


    Hi Xavier,

    I am wondering if visual Studio 2015 is now supported by CPLEX?

    Regards,

    Bayan


    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: cplex concert with Visual Studio Community 2015

    Posted Thu January 12, 2017 01:02 AM


  • 8.  Re: cplex concert with Visual Studio Community 2015

    Posted Thu January 12, 2017 04:58 PM

    Originally posted by: BayanB


    Hi Alex,

     

    Thanks for the response. I have CPLEX 12.6 that I need to upgrade it to 12.7 then.

     

    Best regards


    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: cplex concert with Visual Studio Community 2015

    Posted Mon January 23, 2017 06:30 PM

    Originally posted by: BayanB


    Hi,

     

    I have Visual studio  2015, I also downloaded CPLEX 12.7. I try to configure MS Visual Studio 2015 to use CPLEX 12.7. To set up the project properties I used the link below:

     

    http://www.leandro-coelho.com/how-to-configure-ms-visual-studio-to-use-ibm-cplex-concert/

     But I am getting lots of mismatches and errors.

    Can anyone tell me how I should setup my project properties for this version? If you have any link that explained the configuration of this version please let me know.

     

    Regards.


    #CPLEXOptimizers
    #DecisionOptimization


  • 10.  Re: cplex concert with Visual Studio Community 2015

    Posted Mon January 23, 2017 06:49 PM

    In your CPLEX installation directory you should find a readmeWindows.html file (just open that file in your browser).  From there you can link to c_cpp.html.  If you follow the instructions under "Building your own project which links with CPLEX" (exactly), you should be able to get your environment set up.  If you still have problems after that, you might want to start a new topic in the forum (this has drifted away from the original topic here).


    #CPLEXOptimizers
    #DecisionOptimization


  • 11.  Re: cplex concert with Visual Studio Community 2015

    Posted Mon January 23, 2017 10:30 PM

    Originally posted by: BayanB


    Thanks Rkersh.


    #CPLEXOptimizers
    #DecisionOptimization


  • 12.  Re: cplex concert with Visual Studio Community 2015

    Posted Tue January 31, 2017 10:49 AM

    Originally posted by: Ozgu


    Hi,

    I have applied the steps in c_cpp.html exactly for my Cplex 12.7 and Visual Studio 2015 (Community version); and I got the following error when I want to run a previously working .cpp file:

     

    LINK : fatal error LNK1257: code generation failed

     

    Is there something that I am missing?


    #CPLEXOptimizers
    #DecisionOptimization


  • 13.  Re: cplex concert with Visual Studio Community 2015

    Posted Tue January 31, 2017 07:55 PM

    @Ozgu, earlier today you had a slightly different error.  When I saw that it made me think that you might be missing ​<CONCERTDIR>\lib\x64_windows_vs2015\stat_mda in your linker section.  Did you fix that?

    With regards to your new error, is it possible that you have references to x64_windows_vs2013 instead of x64_windows_vs2015?

    Otherwise, I haven't had time to test anything yet, but I'll try to take a closer look tomorrow.

    Also, in case you missed it, there is a related thread here.  The suggestion there, to compare your project settings with those in the example projects is a good one.


    #CPLEXOptimizers
    #DecisionOptimization


  • 14.  Re: cplex concert with Visual Studio Community 2015

    Posted Tue January 31, 2017 09:01 PM

    Originally posted by: OzguTr


    @rkersh

    Yes Ryan, it was previously a different error; and as you guessed I was able to fix it. However I am still  stuck with this last one b/c I double checked if  "Additional Library Directories" of my Linker is correctly referring to 2015 and can conclude that  this does not seem to be the reason. Thanks for informing about the the other discussion, but I am not sure which example folder being referred in the discussion. Although the 'examples' folder inside my '..CPLEX_Studio127/cplex' folder seems to contain several VC++ project files,  source file is "C" type rather than C++ in all of them. I checked the properties of one example project for release-x64 configuration, and observed that most of them are different from the steps defined in "c_cpp.html". DO you still suggest and apply the same properties to my project?


    #CPLEXOptimizers
    #DecisionOptimization


  • 15.  Re: cplex concert with Visual Studio Community 2015

    Posted Wed February 01, 2017 01:47 PM

    Although, I didn't run into your exact error, I did find a few typos and omissions in the c_cpp.html file that was shipped with 12.7.  I've attached a corrected version.  Please try again with the instructions in "Building your own project which links with CPLEX".

     

    With regards to the examples, you should find the Visual Studio 2015 C++ examples under cplex\examples\x64_windows_vs2015\stat_mda in your CPLEX 12.7 installation directory (e.g., ilolpex2.vcxproj).  One way to compare your .vcxproj project file with the example is to use a textual diff tool like WinMerge instead of trying to eyeball the differences within the Visual Studio GUI.  You can edit the .vcxproj file directly in a text editor but you have to be careful (it's best to use this technique when your project is in source code control so you can revert your changes if necessary).


    #CPLEXOptimizers
    #DecisionOptimization


  • 16.  Re: cplex concert with Visual Studio Community 2015

    Posted Thu February 02, 2017 12:47 PM

    Originally posted by: Ozgu


    @rkersh 7a1ce5ff-8650-4ae4-a67f-69adbfe5e2f6 ​Thanks for the updates Ryan, but it seems my installation have deeper issues. When I want to open a sample  .vcxproj (particularly admipex1.c was the one that I tried) from the folder you indicated, my Visual Studio 2015 exited with code 0. No solve etc. I don't know what the substantial problem about it.


    #CPLEXOptimizers
    #DecisionOptimization


  • 17.  Re: cplex concert with Visual Studio Community 2015

    Posted Thu February 02, 2017 04:25 PM

    I wasn't very explicit about this above (sorry about that), but the C++ examples usually all start with "ilo".  So, admipex1 is the C version of the example and iloadmipex1 is the C++ version.  It sounds like the example compiled and when you executed it, it just exited immediately with the usage statement (this happens very quickly from within the Visual Studio IDE).  You can set command line options in Visual Studio by going to Project Menu > Properties > Debugging section > Command Arguments.  For admipex1 or iloadmipex1 you need to pass in the path to a model file like mexample.mps (which can be found in the cplex\examples\data folder).  The program can still execute so quickly that you still don't see anything.  So, you either have to set a break point in Visual Studio or simply run the admipex1.exe file from the command line so you can see all of the output.


    #CPLEXOptimizers
    #DecisionOptimization


  • 18.  Re: cplex concert with Visual Studio Community 2015

    Posted Wed April 19, 2017 01:48 PM

    Originally posted by: istenc


    Hi,

    I need to link Cplex 12.51 to VS 2015 but I fail. Is there any service pack or some method to be able to link them?

    Thanks.


    #CPLEXOptimizers
    #DecisionOptimization


  • 19.  Re: cplex concert with Visual Studio Community 2015

    Posted Wed April 19, 2017 03:01 PM

    No, you'll need to upgrade to CPLEX 12.7 to get VS 2015 support. See the detailed system requirements here.

    On the other hand, if you only want to use the VS 2015 IDE, I believe you can use it with a VS 2012 project (i.e., with the old compiler).  You should double check that, though.

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 20.  Re: cplex concert with Visual Studio Community 2015

    Posted Tue December 05, 2017 05:58 AM

    Originally posted by: Noussa31


    I have Visual studio  2010, I also downloaded CPLEX 12.7. I try to configure MS Visual Studio 2010 to use CPLEX 12.7. To set up the project properties I used the link below:

     

    https://edisciplinas.usp.br/pluginfile.php/1995427/mod_resource/content/3/c_cpp.html

     But I am getting a mistake in the last step which is "Build solution"

    The error is the following :" Main.cpp
    1>..\..\..\..\..\Desktop\Code_blocking_Sum_Cj_AVF\Main.cpp(1): fatal error C1083: Cannot open include file: 'ilocplex.h': No such file or directory
    1>
    1>Build FAILED."

    Can anyone tell me how I should correct this error? If you have any link that explained the configuration of this version please let me know.

     

    Best Regards Ines.


    #CPLEXOptimizers
    #DecisionOptimization


  • 21.  Re: cplex concert with Visual Studio Community 2015

    Posted Tue December 05, 2017 08:21 AM

    It seems your "Additional Include Directories" item is missing the correct directories. Please double check what you have there and post the setting of this item here if the problem persists.


    #CPLEXOptimizers
    #DecisionOptimization


  • 22.  Re: cplex concert with Visual Studio Community 2015

    Posted Tue December 05, 2017 08:40 AM

    Originally posted by: Noussa31


     

    In the "Additional Include Directories", I set the following directories 

    C:\Program Files\IBM\ILOG\CPLEX_Studio_Community127\cplex\include

    C:\Program Files\IBM\ILOG\CPLEX_Studio_Community127\concert\include


    #CPLEXOptimizers
    #DecisionOptimization


  • 23.  Re: cplex concert with Visual Studio Community 2015

    Posted Tue December 05, 2017 09:22 AM

    Then I suspect that in your code you wrote

    #include <ilocplex.h>

    while you should write

    #include <ilcplex/ilocplex.h>

    in your source code (take a look at the examples shipped with CPLEX, they should have the correct include directive).


    #CPLEXOptimizers
    #DecisionOptimization


  • 24.  Re: cplex concert with Visual Studio Community 2015

    Posted Thu December 07, 2017 06:05 AM

    Originally posted by: Noussa31


    Thank you Mr  @DanielJunglas 548c249b-bb6b-42f6-99b8-f0376c80829e for your interest 

     

     It is right in my code i wrote : #include <ilocplex.h>

    I changed it to  : #include <ilcplex/ilocplex.h>

     

    but it always the same problem in the build step there is an error : "1>LINK : fatal error LNK1181: cannot open input file 'cplex127.lib'
    1>
    1>Build FAILED.
    1>
    1>Time Elapsed 00:00:04.51
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped =========="

    - Have you an available versiion of the Cplex 12.6.0 please?

     

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 25.  Re: cplex concert with Visual Studio Community 2015

    Posted Fri December 08, 2017 07:02 AM

    If cplex127.lib cannot be found then you either do not have CPLEX 12.7.1 installed or your configuration of the 'Additional Library Directories' is wrong.

    Note that the c_cpp.html file you pointed to is for version 12.6.2. If you installed 12.7.1 then you should find a c_cpp.html file for that version in the top-level cplex/ installation directory. Follow the instructions in that file rather than those for 12.6.2.


    #CPLEXOptimizers
    #DecisionOptimization