在C ++和Visual Studio中编写TCP代码时需要哪些包含文件.例如,按F1并查看类TCPClient不会显示必须使用哪些帮助文件.当我搜索: +#include" +"c ++" +"Visual Studio" 我的优缺点和报价似乎被完全忽略了,而退货却没有我需要的东西. (您要使用哪个词组进行搜索?) 我不确定我需要使用什么,但这是winsockets,TCPClient和TCPListener的某种组合,也许还有其他一些优点. 因此,编写使用TCP/IP的代码时使用什么包含文件?
What include files are required when writing TCP code in C++ and Visual Studio. Pressing F1 and looking at class TCPClient, for example, does not show what help files must be used. When I search for: +"#include" +"c++" +"visual studio" my pluses and quotes seem to be flatly ignored and the returns don''t have what I need. (What phrase would you use for this search?) I am not sure yet what I need to use but it is some combination of winsockets, TCPClient, and TCPListener and maybe some other goodies. So, What include files do you use when writing code that uses TCP/IP?
推荐答案尝试使用托管的TCP/IP库 [ ^ ]. 我使用的搜索是 c ++ tcp/ip . Try Using managed TCP/IP Libraries[^] from here on CP. The search I used was c++ tcp/ip.
由于您正尝试通过C ++/CLI使用托管类,因此无需#include任何文件.相反,您可以添加对适当程序集的引用,然后为了方便起见在顶部放置using namespace 声明. 在这种情况下,您需要的程序集是System.dll(您可能已经有了引用).命名空间为System.Net.Sockets. Since you are trying to use managed classes via C++/CLI, you don''t need to #include any files. Instead you add a reference to the appropriate assemblies and then put using namespace declarations on top for convenience. In this case the assembly you need is System.dll (you probably have a reference already). The namespace is System.Net.Sockets.
下载代码并构建后,Visual Studio会提供警告和错误.错误是: After downloading the code and building Visual studio provides a warning and an error. The error is: Error 2 Command line error D8016 : '/Gm' and '/clr:oldsyntax' command-line options are incompatible I don't have a clue why it says "lang="vb" becuase it looks like C. I searched within Tools-Options and was uable to find anything that looks like /clr:oldsyntax Do you know where to look in Visual Studio 2008 to resolve this problem? Thank you for taking the time to reply.
更多推荐
Visual Studio包含TCP的文件
发布评论