简体   繁体   English

在Eclipse中运行由C ++代码生成的exe文件时,MVCP100D.dll丢失

[英]MVCP100D.dll missing when running exe file generated by C++ code in Eclipse

I am trying to integrate AMPL with C/C++ using AMPL-API . 我正在尝试使用AMPL-APIAMPL与C / C ++集成。 I created a Makefile project in Eclipse which uses MinGW CC to compile the code. 我在Eclipse中创建了一个Makefile项目,它使用MinGW CC来编译代码。

Here is my C++ code: 这是我的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;
}

Following is my Makefile: 以下是我的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)

Contents of my project directory are: 我的项目目录的内容是:

  • .settings/ .settings /
  • models/ 楷模/
    • diet/ 饮食/
      • diet.dat diet.dat
      • diet.mod diet.mod
  • .cproject .cproject
  • .project 。项目
  • AMPL.cpp AMPL.cpp
  • AMPL.exe AMPL.exe
  • AMPL.o AMPL.o
  • ampl1.2.2.lib ampl1.2.2.lib
  • Makefile Makefile文件

I am having a 32-bit Windows 7 machine which have both Eclipse Mars 2.0 and Visual Studio 2015 installed on it. 我有一台32位Windows 7机器,它上面安装了Eclipse Mars 2.0和Visual Studio 2015。 Whenever I run exe file, it says MVCP100D.dll is missing. 每当我运行exe文件时,它都说MVCP100D.dll丢失了。 I looked on web and found that this error generally comes when Visual C++ Redistributable are missing. 我查看了网络,发现当错过Visual C ++ Redistributable时,通常会出现此错误。 But my system has redistributable installed on it. 但是我的系统上安装了可再发行组件。 Please help me with this. 请帮我解决一下这个。

Update: I tried to execute same code over Visual Studio 2015 and there also it is able to compile, however, I am unable to run *.exe file. 更新:我尝试在Visual Studio 2015上执行相同的代码,并且还能够编译,但是,我无法运行* .exe文件。 It also says MVCP100D.dll is missing. 它还说MVCP100D.dll丢失了。 I am not sure why this error is coming, please help!! 我不确定为什么会出现这个错误,请帮助!!

Update: Downloading the updated version works in Visual Studio 2015 but facing a separate problem specified in other post: Undefined reference to (error) in C++ Eclipse but working in Visual Studio 2015 更新:下载更新的版本适用于Visual Studio 2015,但面临其他帖子中指定的单独问题: C ++ Eclipse中未定义的(错误)引用但在Visual Studio 2015中工作

This is a bug in the beta version of the AMPL C++ API. 这是AMPL C ++ API测试版中的一个错误。 As a quick fix, the updated distribution available for download from http://ampl.com/products/api includes these DLLs. 作为快速修复,可从http://ampl.com/products/api下载的更新版本包括这些DLL。 A permanent fix will be available in the next corrective release. 永久性修复将在下一个纠正版本中提供。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在其他计算机上打开exe需要什么文件mvcp100d - what file needed to open exe in other computer mvcp100d needed 从另一台PC / VS生成/运行项目时,缺少MSVCR100D.dll - MSVCR100D.dll is missing when build/running project from another PC/VS 错误:在MS Visual Studio 2015中使用Python运行C ++代码时出现“ python35_d.dll丢失” - Error: 'python35_d.dll is missing' while running C++ code with Python in MS Visual Studio 2015 MSVCP100D.dll 在您的计算机调试模式中丢失 Visual C++ 2012 - MSVCP100D.dll is missing on your computer debug mode Visual C++ 2012 在另一台计算机上运行.exe文件时,“缺少MSCVP140.dll”和“缺少VCRUNTIME140.dll” - “Missing MSCVP140.dll” and “Missing VCRUNTIME140.dll” when running an .exe-File on another computer C.Winapi在.exe文件中包含DLL - C++ Winapi Including DLL in the .exe file 我试图运行在eclipse(其.exe)中制作的C ++应用程序,并显示“ libgcc_s_dw2-1.dll丢失,请尝试重新安装 - I tried to run a c++ application I made in eclipse (its .exe) and it says "libgcc_s_dw2-1.dll is missing and Try to reinstall 计算机中缺少文件MSVCP100D.dll - The file MSVCP100D.dll is missing from the computer 在带有VS2010的Windows Server 2008平台上进行远程调试C ++; MSVCP100D.dll丢失 - Remote debugging C++ on the Windows Server 2008 platform with VS2010; MSVCP100D.dll missing 使用Eclipse运行C代码的.exe文件 - Run .exe file of C code using Eclipse
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM