2014-01-22 58 views
1

對不起,我的英語。Qt + iperf3 = lconv尚未申報

我嘗試添加iperf3(如靜態鏈接庫)到我的Qt工程(QT版本4.8.5,OpenSuse當中13.1),並且有幾個錯誤:

g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I../lperftest -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I../lperf/include -I. -I../lperftest -I. -o main.o ../lperftest/main.cpp 
In file included from /usr/include/c++/4.8/x86_64-suse-linux/bits/c++locale.h:41:0, 
from /usr/include/c++/4.8/bits/localefwd.h:40, 
from /usr/include/c++/4.8/string:43, 
from /usr/include/QtCore/qstring.h:54, 
from /usr/include/QtCore/qobject.h:48, 
from /usr/include/QtCore/QObject:1, 
from ../lperftest/main.cpp:9: 
/usr/include/c++/4.8/clocale:53:11: error: '::lconv' has not been declared 
using ::lconv; 
^ 
/usr/include/c++/4.8/clocale:54:11: error: '::setlocale' has not been declared 
using ::setlocale; 
^ 
/usr/include/c++/4.8/clocale:55:11: error: '::localeconv' has not been declared 
using ::localeconv; 
^ 
In file included from /usr/include/c++/4.8/bits/localefwd.h:40:0, 
from /usr/include/c++/4.8/string:43, 
from /usr/include/QtCore/qstring.h:54, 
from /usr/include/QtCore/qobject.h:48, 
from /usr/include/QtCore/QObject:1, 
from ../lperftest/main.cpp:9: 
/usr/include/c++/4.8/x86_64-suse-linux/bits/c++locale.h:52:23: error: 'uselocale' was not declared in this scope 
extern "C" __typeof(uselocale) __uselocale; 
^ 
/usr/include/c++/4.8/x86_64-suse-linux/bits/c++locale.h:52:45: error: invalid type in declaration before ';' token 
extern "C" __typeof(uselocale) __uselocale; 
^ 
/usr/include/c++/4.8/x86_64-suse-linux/bits/c++locale.h: In function 'int std::__convert_from_v(__locale_struct* const&, char*, int, const char*, ...)': 
/usr/include/c++/4.8/x86_64-suse-linux/bits/c++locale.h:75:53: error: '__gnu_cxx::__uselocale' cannot be used as a function 
__c_locale __old = __gnu_cxx::__uselocale(__cloc); 
^ 
/usr/include/c++/4.8/x86_64-suse-linux/bits/c++locale.h:100:33: error: '__gnu_cxx::__uselocale' cannot be used as a function 
__gnu_cxx::__uselocale(__old); 
^ 
../lperftest/main.cpp: At global scope: 
../lperftest/main.cpp:11:5: warning: unused parameter 'argc' [-Wunused-parameter] 
int main(int argc, char *argv[]) 
^ 
../lperftest/main.cpp:11:5: warning: unused parameter 'argv' [-Wunused-parameter] 
make: *** [main.o] Error 1 

當我嘗試iperf3添加到只有C++項目都很好。這個錯誤只存在於Qt項目中。有什麼想法嗎?

+0

這似乎是問題如下:http://stackoverflow.com/a/17040165/1518921 但你不能如果您不發佈代碼,請確定知道。 –

回答

1

我有與iperf3和Qt相同的問題。基本上,你似乎必須使用類似的編譯iperf3庫和你的項目(gcc或g ++)。

讓我們知道它是如何發展的。如果已經完成,請分享您的解決方案

- 編輯 - 或做iperf_api.h

extern "C" { 
#include <iperf_api.h> 
}