久久久久久久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 中的編譯器標志)
主站蜘蛛池模板: 狠狠干在线 | 免费视频99 | 欧美美女爱爱视频 | 九色91视频 | 99精品视频网 | 国产美女一区二区 | 婷婷去俺也去 | 日韩精品免费一区 | 综合久 | 国产成人在线一区二区 | 欧美色综合网 | 最新高清无码专区 | 精品视频一区二区三区四区 | 中文字字幕一区二区三区四区五区 | 四虎影 | 国产日韩欧美一区 | 精品一区二区三区在线观看 | 欧美日韩中文字幕 | 欧美一区二区三区免费在线观看 | 国产免费一区二区 | 国产精品综合一区二区 | 在线2区 | 我爱操 | 99成人免费视频 | 国产人成精品一区二区三 | 久热久热| 天天干夜夜拍 | 精品一区二区在线观看 | 91视频在线| 天堂中文av | 成人精品| 国产精品美女久久久久久免费 | 无码日韩精品一区二区免费 | 久久这里只有精品首页 | 天天影视色综合 | 草逼网站| 国产这里只有精品 | 在线视频一区二区三区 | 亚洲狠狠丁香婷婷综合久久久 | 亚洲国产高清高潮精品美女 | 青青草中文字幕 |