Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

Cannot open include file 'ilcplex/cplex.h' in Visual C++ 2010

  • 1.  Cannot open include file 'ilcplex/cplex.h' in Visual C++ 2010

    Posted Wed September 24, 2014 05:23 AM

    Originally posted by: prasenjit mandal


    I tried to run a CPLEX-C program in Visual C++ 2010 in Windows 8 OS. When I am running it from the GUI itself, it is fine. But, when I tried to run it from command prompt, it showing me the error: "C1083: Cannot open include file 'ilcplex/cplex.h: so such fine and directory'".
     
    I used the the command "cl main.c". Further, I also tried to execute the command: "command "cl main.c cplex1251.lib"".
    However, I checked the 'PATH' environmental variable setting. The path "C:\Program Files\IBM\ILOG\CPLEX_Studio1251\cplex\bin\x86_win32;" is already included to the PATH' environmental variable setting. Also, I tried copy the cplex1251.dll to my current directory. But, the program is showing the same error.
     
    But, when I tried to execute a CPLEX-C++ program from command prompt using command: "cl /EHsc main.cpp", it is working fine.
     
    Could you please help me to figure out what should I do to compile and run a CPLEX-C program from command prompt. Also, why it is running fine when I am compiling a C++ program whereas the C program is showing me the error.

    #DecisionOptimization
    #MathematicalProgramming-General


  • 2.  Re: Cannot open include file 'ilcplex/cplex.h' in Visual C++ 2010

    Posted Thu September 25, 2014 12:33 AM

    You are missing lots of arguments on your command line. I am not an expert in the Visual Studio GUI but I think there is a way to see the full command line that it executes to build a problem (look in the build log or so). Look at this to see which flags you need to compile a CPLEX program.


    #DecisionOptimization
    #MathematicalProgramming-General