【问题标题】:MVCP100D.dll missing when running exe file generated by C++ code in Eclipse在 Eclipse 中运行由 C++ 代码生成的 exe 文件时缺少 MVCP100D.dll
【发布时间】:2016-09-29 20:40:38
【问题描述】:

我正在尝试使用 AMPL-APIAMPL 与 C/C++ 集成。我在 Eclipse 中创建了一个使用 MinGW CC 编译代码的 Makefile 项目。

这是我的 C++ 代码:

#include <iostream>
#include "ampl/ampl.h"

using namespace std;

int main() {
    ampl::AMPL ampl;

    // Read the model and data files.
    std::string modelDirectory = "models";
    ampl.read(modelDirectory + "/diet/diet.mod");
    ampl.readData(modelDirectory + "/diet/diet.dat");

    // Solve
    ampl.solve();

    // Get objective entity by AMPL name
    ampl::Objective totalcost = ampl.getObjective("total_cost");
    // Print it
    std::cout << "Objective is: " << totalcost.value() << std::endl;
}

以下是我的 Makefile:

CC = g++
CFLAGS = -O2 -g -Wall -fmessage-length=0
INCLUDES = -I "C:\\Local\\AMPL\\amplide.mswin32\\amplide.mswin32\\amplapi\\include"
OBJS = AMPL.o
LIBS =  -lampl1.2.2 
TARGET = AMPL.exe
$(TARGET):  $(OBJS)
    $(CC) -L "./" -o $(TARGET) $(OBJS) $(LIBS)
AMPL.o: AMPL.cpp
    $(CC) $(CFLAGS) $(INCLUDES) -c AMPL.cpp
all:    $(TARGET)
clean:
    rm -f $(OBJS) $(TARGET)

我的项目目录的内容是:

  • .settings/
  • 型号/
    • 饮食/
      • 饮食.dat
      • 饮食.mod
  • .cproject
  • .project
  • AMPL.cpp
  • AMPL.exe
  • AMPL.o
  • ampl1.2.2.lib
  • 生成文件

我有一台 32 位 Windows 7 机器,上面安装了 Eclipse Mars 2.0 和 Visual Studio 2015。每当我运行 exe 文件时,它都会说 MVCP100D.dll 丢失。我在网上查看,发现这个错误通常是在缺少 Visual C++ Redistributable 时出现的。但是我的系统上安装了可再发行组件。请帮我解决这个问题。

更新:我尝试在 Visual Studio 2015 上执行相同的代码,并且它也能够编译,但是我无法运行 *.exe 文件。它还说缺少 MVCP100D.dll。我不知道为什么会出现这个错误,请帮忙!!

更新: 下载更新版本在 Visual Studio 2015 中工作,但面临其他帖子中指定的单独问题:Undefined reference to (error) in C++ Eclipse but working in Visual Studio 2015

【问题讨论】:

  • MVCP100D.dll 是一个调试 dll(注意名称末尾的 D),与可再发行组件无关。您是在开发计算机上还是在另一台计算机上遇到此问题?更多详情:social.msdn.microsoft.com/Forums/en-US/…
  • 感谢 Richard 的及时回复!这仅在我的开发计算机上发生。

标签: c++ eclipse windows-7 visual-studio-2015 ampl


【解决方案1】:

这是AMPL C++ API 测试版中的一个错误。作为快速修复,可从http://ampl.com/products/api 下载的更新分发包包括这些 DLL。下一个更正版本中将提供永久修复。

【讨论】:

  • 当然。如果它回答了您的问题,请不要忘记投票/接受;-)
  • 我没有太多声誉来支持或接受答案。但我会提到+1 :) 我现在面临另一个问题。我的代码现在可以在 VS2015 上运行,但在 Eclipse 中会出错。我可以在这里发帖或开一个新帖子吗?
  • 我建议打开一个单独的问题。
猜你喜欢
  • 1970-01-01
  • 2020-12-25
  • 2021-09-05
  • 2019-01-21
  • 1970-01-01
  • 2021-01-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多