簡體   English   中英

在 Windows 10 上成功安裝后,如何讓 VSCode 找到 gmp.h?

[英]How can I get VSCode to find gmp.h after it has been successfully installed on Windows 10?

安裝並遵循GMP的說明(使用 mingw64,因為我在 Windows 上)並使用make check驗證安裝正確后,我嘗試使用命令g++ -g \\path\\file.cpp -lgmpxx -lgmp -o \\path\\file.exe在 VSCode 中運行以下代碼g++ -g \\path\\file.cpp -lgmpxx -lgmp -o \\path\\file.exe

#include <gmp.h>
#include <iostream>

using namespace std;

int main()
{
    mpz_class a,b,c;
    cout << "Hello World\n";
    a = 1234;
    b = "5678";
    c = a+b;
    return 0;
}

但是得到錯誤error: 'mpz_class' was not declared in this scope 所以VSCode中的include路徑設置不正確或者安裝亂了。 我想知道如何解決這個問題:這是 VSCode 的 includePath(未設置 compilerPath)、安裝問題(我無法確定 Windows 系統的默認安裝位置,因為我發現的所有內容都是針對 Linux 的),或者還有其他問題嗎?錯過了? 我看到./configure的標志是--enable-cxx但我想在運行make clean之前詢問並在打開該標志的情況下重試,因為它需要永遠。

我覺得這很簡單,因為我無法從谷歌搜索中找到任何幫助。

感謝您的任何幫助!

編輯:我試過運行不在 VSCode 中的代碼,但它仍然有同樣的問題,所以我不太確定它是 VSCode。

我對 GMP 一無所知,但您似乎包含了錯誤的標題。

#include <gmpxx.h>為我工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM