国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Win+MinGW不能用gdb調(diào)試C++編譯的exe
巴扎黑
巴扎黑 2017-05-16 13:28:15
0
1
969

系統(tǒng)是Windows10 x64,已經(jīng)安裝好MinGW,版本是:
mingw32-gcc 5.3.0-3
mingw32-gcc-g++ 5.3.0-3
mingw32-gdb 7.6.1-1
現(xiàn)在我嘗試編譯并調(diào)試一個(gè)cpp代碼test1.cpp:

#include <iostream>
using namespace std;
int main()
{
    int a;
    cout<<"HelloWorld!"<<endl;
    cin>>a;
}

然后使用g++編譯:

g++ -g test1.cpp -o test1.exe

通過,得到test1.exe,然后使用gdb調(diào)試:

gdb test1.exe
得到錯(cuò)誤:
GNU gdb (GDB) 7.6.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
http://www.gnu.org/software/g......
"D:CppProjects/test1.exe": not in executable format: File format not recognized
(gdb)

請(qǐng)問如何解決?

巴扎黑
巴扎黑

全部回復(fù)(1)
過去多啦不再A夢(mèng)

后來發(fā)現(xiàn)之前用Anaconda裝過舊版的MinGW,為了編譯一些Python包。
先把環(huán)境變量刪除,然后conda uninstll mingw,重啟后重裝MinGW,然后再設(shè)置環(huán)境變量?,F(xiàn)在可以用了。

最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板