久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

C++“Hello World.exe"崩潰 - “Hello World.exe 已停止

C++ quot;Hello World.exequot; crashes - quot;Hello World.exe has stopped working.quot; when used in command prompt(C++“Hello World.exe崩潰 - “Hello World.exe 已停止工作.在命令提示符中使用時) - IT屋-程序員軟件開發技
本文介紹了C++“Hello World.exe"崩潰 - “Hello World.exe 已停止工作."在命令提示符中使用時的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我開始學習 C++ 并編寫了一個Hello World"程序.當我嘗試在命令提示符下運行它時,它崩潰并給我一條 Windows 消息,說Hello World.exe 已停止工作.".

I've started learning C++ and wrote a "Hello World"-Program. When i try to run it in command prompt, it crashes and gives me a windows message saying "Hello World.exe has stopped working.".

代碼:

#include <iostream>
#include <string>

int main()
{
    std::string response;

    std::cout << "Hallo Welt
";
    std::cin >> response;
    std::cout << "User: " << response;

    return(0);
}

我使用 Eclipse IDE 和 MinGW 作為編譯器.我已經在環境變量中設置了MinGW/bin的路徑.在我將 MinGW/bin 目錄中的所有 dll 復制到 Hello World.exe 的文件夾中后,程序運行順利.因此,似乎需要這些 dll 的任何東西都無法正確訪問它們.我想省去為我創建的每個項目復制 dll 的麻煩.有什么辦法可以解決這個問題嗎?

I'm using Eclipse IDE and MinGW as compiler. I've already set the path of MinGW/bin in the environment variables. After i copied all dll's form the MinGW/bin directory into the folder of the Hello World.exe the program worked smoothly. So it seems that whatever it is that needs those dll's cannot access them properly. I'd like to spare me the hassle of copying the dll's for every project i create. Is there any way i could work around that?

我對我的計算機和編程術語還不是很自信,所以描述可能有點粗略 - 仍然非常感謝幫助!

I'm not really confident about my computer and programming terminology yet so the description might seem a bit rough - help is still greatly appreciated!

干杯!

推薦答案

以下說明 為我完成了這項工作,因此我將它們添加到這里以供將來參考,因為這個問題需要相當長的時間.

The following instructions did the work for me so I add them here for future reference as this problem took quite some time.

先決條件

  • 應用了所有當前軟件更新的 Windows 7 64 位.
  • MinGW 0.5-beta–20120426–1 或更高版本.
  • Java JRE 1.7 或更高版本.
  • 日食

安裝步驟

  1. 從 Oracle 安裝 Java JRE.
  2. 安裝 MinGW.在選擇組件步驟中,選擇C++編譯器"和MSYS 基本系統"進行安裝.
  3. 為 C++ 開發人員下載 Eclipse.
  4. 解壓下載到您的下載文件夾的 Eclipse 存檔.
  5. 打開在提取的 Eclipse 中找到的 Eclipse 應用程序文件夾.[2]
  6. 通過從文件和新建菜單.
  7. 在項目的可執行文件下選擇Hello World C++ 項目"為您的新 C++ 項目的工具鏈鍵入和 MinGW GCC.類型一個項目名稱,然后單擊完成按鈕.
  8. 添加-static-libgcc -static-libstdc++"作為新的鏈接器標志項目.此文本應添加到 Linker flags 字段,該字段可以在Project中右鍵新建Project找到資源管理器并單擊屬性.在項目屬性下,展開 C/C++ Build 菜單并單擊 Settings.在工具下設置選項卡,展開 MinGW C++ 鏈接器菜單并單擊各種各樣的.將文本添加到 Linker flags 字段,然后單擊應用按鈕.
  9. 點擊 Project 菜單下的 Build Project,然后點擊運行菜單.
  10. 通過查看控制臺的輸出.

請注意,步驟 8 是解決問題的步驟.

Please note that step 8 is the one that solves the problem.

注意:您還應該將freeglut.dll復制到您的.exe所在的目錄中.

Note: You should also copy freeglut.dll in the directory where your .exe is located.

這篇關于C++“Hello World.exe"崩潰 - “Hello World.exe 已停止工作."在命令提示符中使用時的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How can I make a horizontal sliding calendar in android eclipse?(如何在 android eclipse 中制作水平滑動日歷?)
Eclipse CDT not building project on header file change(Eclipse CDT 沒有在頭文件更改時構建項目)
Eclipse C++ including header file from my source folder(Eclipse C++ 包括來自我的源文件夾的頭文件)
Eclipse C/C++ (CDT) import files into project - header file not found - include path(Eclipse C/C++ (CDT) 將文件導入項目 - 找不到頭文件 - 包含路徑)
How to generate JNI header file in Eclipse(如何在 Eclipse 中生成 JNI 頭文件)
Compiler flags in Eclipse(Eclipse 中的編譯器標志)
主站蜘蛛池模板: 青青草视频网 | 国产精品久久久久久福利一牛影视 | www.av在线| 亚洲综合大片69999 | 一区二区三区亚洲 | 一区二区日本 | 欧美一区二区久久 | 粉嫩在线| 欧美舔穴 | 欧洲在线视频 | 在线欧美小视频 | 久久久久黄 | 日韩淫片免费看 | 美女一级毛片 | 亚洲精品久久久9婷婷中文字幕 | 超碰免费在线 | 丝袜一区二区三区 | 国产一区二区三区日韩 | 欧美激情免费在线 | 欧美日韩中文在线 | 精品成人佐山爱一区二区 | 欧美电影在线观看网站 | 亚洲精品视频一区二区三区 | 国产有码 | 国产精品v | 视频一区中文字幕 | 日韩精品成人 | 毛片免费观看视频 | 欧美一区二区精品 | 二区不卡 | 久久久夜色精品亚洲 | 日韩在线视频一区 | 五月综合久久 | 999久久久| 久久久亚洲成人 | 亚洲区一| 欧美不卡 | 国产精品久久久久久高潮 | 成人黄色在线 | 欧美亚洲国产日韩 | 免费观看一级特黄欧美大片 |