2016-06-07 144 views
3

我有一個最小的MinGW(nuwen)從isocpp.org 'Get started'設置窗口(nuwen),這是編譯爲窗口入門ISOCPP.net C++構建

gcc版本6.1.0,這是我的代碼

#include <stdio.h> 
#include <string> 

int main (int argc, char* argv[]) { 
    printf ("hello world\n"); 

    std::string mystring {"my string"}; 

} 

我不斷收到以下錯誤(等等)

C:\util\MinGW\proj>gcc main.cpp

C:\Users\gmyer\AppData\Local\Temp\ccXSjGdh.o:main.cpp:(.text+0x2e): undefined reference to `std::allocator::allocator()' collect2.exe: error: ld returned 1 exit status

我做了什麼

  • 檢查該字符串文件中存在包括目錄 CPLUS_INCLUDE_PATH = C:\ UTIL \ MinGW的\包括; C:\ UTIL \ MinGW的\包括\對FreeType2 C_INCLUDE_PATH = C:\ UTIL \ MinGW的\包括; C:\ UTIL \ MinGW的\包括\對FreeType2
  • 檢查了分配器在「串」文件

我是否需要添加另一個包含文件,使其工作存在?

回答