1

我正在学习音乐会技术,我还处于起步阶段。我试图打开其中一个示例(Ilolpex1.ccp),但是当我运行它时,程序说:

#include <ilcplex/ilocplex.h> : cannot open this source file

我怎么解决这个问题?

4

3 回答 3

2

The message you are seeing is during compilation, not running the program. You need to add the concert and cplex include directories to your include path. The examples are in the directory

<cplex_root_dir>/cplex/examples/src/cpp/

The include files are in

<cplex_root_dir>/cplex/include
<cplex_root_dir>/concert/include
于 2012-09-11T01:32:48.780 回答
2

假设您的 C++11 编译器是 GCC(在 Linux 上),即g++命令,您可以运行它g++ -H以了解包含哪些标头,并且您应该添加适当-I的选项以提供相关的包含目录。

也许你只需要添加例如-I /usr/local/include

您可能需要添加库的开发人员包。(例如Debian 或 Ubuntu 上的一些libfoo包)-dev

在实践中,您最好在 中编辑一些变量Makefile,也许是一些CXXFLAGS

于 2012-09-10T16:42:27.550 回答
0

出现此问题的原因可能是您在64 位 Windows上安装了32 位版本的 IBM ILOG CPLEX Optimization Studio 。所以Visual Studio 找不到像“ilcplex”这样的相关头文件。

于 2015-10-10T10:32:15.663 回答