I am trying to call CPLEX (a mathimatical optimizer) from .NET Visual Studio 2013 on win 7.

I have installed optimization.framework.

I have added

   using Optimization.Solver.Cplex;

in the code.

I try to run the example at:

http://www-01.ibm.com/support/docview.wss?uid=swg21400073&aid=1

I commented out

//using ILOG.Concert;
//using ILOG.CPLEX;

It can be built. But, I got error:

  Unable to load DLL 'cplex100.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

I change the DLL to cplex.dll but the same error. In

  using Optimization.Solver

when I typed ctrl+space , I can see that it includes many solvers, including CPLEX.

Why i got this error.

thanks

asked 31 Mar '15, 18:30

usa's gravatar image

usa
12
accept rate: 0%

edited 31 Mar '15, 18:31


You need to locate cplex100.dll in your installation and add an appropriate path to your project's linker properties – for your convenience: in detail described here.

link

answered 01 Apr '15, 04:17

fbahr's gravatar image

fbahr ♦
4.6k716
accept rate: 13%

edited 01 Apr '15, 04:17

@fbahr, I have never installed CPLEX100.dll in my machine. When I added "using Optimization.Solver.Cplex;", I thought that the CPLEX100.dll has been embedded in the visual studio. Now, I think I was wrong. I need to install CPLEX100.dll myself. visual studio only provides an interface for CPLEX100.dll, right ?

(01 Apr '15, 08:31) usa

You need to know where your dll is. Then you need to add it to your references. "Using" only applies to references added to your project.

(01 Apr '15, 09:00) JF Meier

Your procedure is correct, but the example "LPex1.cs" in provided link (http://www-01.ibm.com/support/docview.wss?uid=swg21400073&aid=1) is not. The correct example is here. There's no such thing as "cplex100.dll". An implementable DLL file for running CPLEX projects should comply with the FORMAT "CPLEX$.dll" in which the dollar sign stands for your CPLEX version. For example, "CPLEX1260.dll".

link

answered 01 Apr '15, 11:13

monash's gravatar image

monash
372411
accept rate: 0%

edited 03 Apr '15, 01:50

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×191
×7
×5
×2
×1

Asked: 31 Mar '15, 18:30

Seen: 2,433 times

Last updated: 03 Apr '15, 01:50

OR-Exchange! Your site for questions, answers, and announcements about operations research.