1
我想將一些代碼移植到最初寫在Microsoft Visual Studio中的Linux中。 代碼使用std::wstring
,當我嘗試編譯,我得到以下錯誤:Linux gcc 4.9 wstring undefined
undefined reference to `myFunc(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&)'
被聲明爲
myfunc(const std::wstring &str)
有一些額外的頭文件,我需要包括哪些內容?
您是否包含正確的頭文件和'wstring'應該位於std名稱空間下 – billz 2014-09-29 09:19:51
你確定你正在編譯和鏈接函數'myfunc(const std :: wstring&str)'的定義嗎? – Niall 2014-09-29 09:20:30
到目前爲止,這似乎不是一個gcc的問題。它抱怨說它找不到你的自己的函數你在哪裏定義了'myFunc'?你如何編譯和鏈接你的應用程序? – nos 2014-09-29 09:21:52