2012-07-17 93 views
0

我用內置Qt的VS2010。我試圖實現客戶端和服務器,使用UDP。 我從書Qt4編程GUI C++的例子。雖然包括QtNetwork,我得到了很多錯誤

的實現主要是基於Qt庫QtNetwork,但是當我把它給我收到了很多關於我的錯誤未知的喜歡:

Error 8 error C2653: 'System' : is not a class or namespace name ****\AssemblyInfo.cpp 3 
Error 9 error C2871: 'Reflection' : a namespace with this name does not exist ****AssemblyInfo.cpp 3 

我認爲錯誤是庫QtNetwork的結果沒有被列入正常。 你能請教我如何解決這個問題?!

我試圖用我的方式來解決這個問題,並採取以下措施:

  1. 在VS的:Qt \ Qt的項目設置\添加網絡庫,然後qmake -projectqmakenmake

  2. 在.pro文件中添加字符串QT += network,然後qmake -projectqmakenmake

他們倆都未能應對這個問題。

這是我得到的錯誤列表:

Error 8 error C2653: 'System' : is not a class or namespace name ***\AssemblyInfo.cpp 3 
Error 9 error C2871: 'Reflection' : a namespace with this name does not exist ***AssemblyInfo.cpp 3 
Error 10 error C2653: 'System' : is not a class or namespace name ***AssemblyInfo.cpp 4 
Error 11 error C2871: 'CompilerServices' : a namespace with this name does not exist ***AssemblyInfo.cpp 4 
Error 12 error C2653: 'System' : is not a class or namespace name ***AssemblyInfo.cpp 5 
Error 13 error C2871: 'InteropServices' : a namespace with this name does not exist ***AssemblyInfo.cpp 5 

回答

0

我想通了,這是問題! 1.我創建了單元測試,後來從項目中移除它們,但是t removed from folder as result lots of errors, which i presented here 2. I tried to include QtNetwork with < > , but it didn t沒有工作3.但是當我qmake -project,qmake,nmake和生成的.pro文件包含字符串QT + =網絡項目編譯成功時!