zoukankan      html  css  js  c++  java
  • Translate_Windows_Program_via_C_____The How to Build Guide with VS 9.0/2008

    This module tries to show how to compile the Winsock program examples available at Tenouk.com using the Visual Studio with the CLR.

    This Visual IDE should be the newer version such as VS 2005 and 2008 (Express or full version). In this case we are going to use C++

    from Visual Studio 2008, Professional Edition. The version is shown in the following screenshot. The OS used is Win XP Pro SP2.

          这里尝试介绍怎样在Visual Studio上通过CLR来编译Tenouk.com上的关于Winsock的实例代码。VS的版本我们假定是V2005或者VS2008(Express或者

    完全安装版)。这里我们使用VS IDE环境是VS 2008的VC++ 2008 专业版。 关于IDE环境的详细信息如下截图所示。操作系统是WinXP SP2 Pro。

         The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation

    In compiling the Winsock program examples using newer version IDE, we are not just learning how to customize the project environment to suit our programming needs.

    As can be learned in the following sections, we are also will get familiar with the IDE environments.

    Okay, let start. Launch the VS 2008 > as usual, click File menu > click New menu > select Project sub menu.

       这里我们用新版本的IDE环境来编译winsock程序代码实例,我们不深入讨论怎样定制工程环境来适应不同的应用开发。在接下来的其他版块我们会详细讨论这个问题,这里

    我们的主要目的是为了熟悉IDE环境。

       恩,让我们开始我们的旅程,我们尝试建立一个工程,你可以这样做:首先和启动其他应用程序一样,启动IDE环境——》点击  File 菜单——》点击 New 菜单——》选择 

    Project 子菜单。如下图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 2

    In the following project templates page, select the Win32 Console Application. Select Visual C++ folder on the left pane (or Win32 under the Visual C++ folder) for the

     Project Types: > select the Win32 Console Application project template.

    Put the project and solution name in the Name: and Solution Name: fields respectively (in this case we use Winsock2sample for both fields). Change the Location: 

    if required. Click theOK button.

       在弹出的工程模板对话框中,选择Win32 控制台应用程序。 在左边的选择面板选择项目类型为:Visual C++(或者选择Visual C++下面的 Win32);接下来选择项目

    模板为: Win32控制台应用程序。

       在对话框的Name和solution name 文本输入域中输入项目的名称和解决方案的名称(这里两个输入域我们均输入:winsock2sample); 如果需要改变解决方案(项目)

    的存储路径那么就在Location输入文本域中改变,这里我们选择默认就行, 这些做完后点击 OK 按钮。

    如下图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 3

    In the first page of the Win32 Application Wizard page, click the Next button. This just to refine the Win32 project more.

    接下来会弹出Win32 应用程序向导对话框,点击 Next 按钮即可, 这里仅是描述一些关于新建的工程的信息。

    如下图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 4

    On the second page, make sure the following settings are selected: Console Application radio button for the Application type: 

    and an Empty Project for the Additional options: check box. At this stage, we try to exclude all the unnecessary items for our

    project environment. Then, click the Finish button.

     在第二对话框中确定我们选择的设定如下所述: 应用程序类型选择:控制台应用程序

                                                                 附加选项中点选: 空工程 复选框按钮。

     然后选择 Finish 按钮即可。

    这里这样选在目的是为了:去除工程中IDE环境将会生成的不是必须要的信息。 

    如下图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 5

    Now, we have been provided with an empty Win32 console mode application and we have 'disabled' the un-needed features.

    There are three folders provided for our project: Header Files,Resource Files and Source Files, same as the old plain C programming

    environment. Next, let add a source file, which suppose to be 'put' under the Source Files folder.

       经过上面的步骤后,我们已经建立了一个空的Win32控制台应用程序模板,而其我们禁用了一些不需的特性。在新建的工程里面有三个文件夹,就像用

    老版本的VS IDE环境开发的一样(例如 VC 6.0 ):  头文件文件夹、 资源文件文件夹河源文件文件夹。 

        接下来的工作就是在: 源文件文件夹下面添加源文件。

    如图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 6

    Click the Project menu > select Add New Item sub menu.

    点击   Project工程 菜单——》然后选择 Add New Item 子菜单。如下图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 6

    In the Add New Item page, select Visual C++ folder in the Categories: and select C++ File(.cpp) for the Templates:.

    Put the source file name (in this case we use Winsock2samplesrc as the source file name). The Location: should be defaulted

    to our project folder (in most cases, no need to change it). Click the Add button.

       在弹出的 增加新对象 的对话框中,在 类型标签页 下面选中: Visual C++ 文件夹

                                                   在 模板标签页中 选中 C++ 文件(.CPP),

                                                   输入源文件的文件名,这里我们输入的是:Winsock2samplesrc

                                                   在源文件存储路径下面选中默认的文件存储路径就行,在这里应该是默认的,并且在大多数的应用中不需要

    改变  。

         然后选择 Add 按钮即可。如下图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 7     

         The source file has been added properly under the Source Files folder. This empty file is shown on the right, else you need

    to double-click the source file under the Source Files folder (in this case, double-click the Winsock2samplesrc.cpp). Next,

    we are ready to do the coding or adding the codes.    

        源文件已经添加到我们的 源文件文件夹 下面,在IDE环境的右窗格中可以看到空的源文件,或者你需要在 源文件文件夹 下面双击源文件名

    来打开源文件,这里就是双击 Winsock2samplesrc.cpp。  接下来我们就需要添加或者编辑源代码了。

    如下图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 8

    We just copy and paste the code example taken from http://www.tenouk.com/Winsock/Winsock2example.html page.

    The code is shown below.

    这里我们不在编辑,而是从下面的链接上复制一份源代码:http://www.tenouk.com/Winsock/Winsock2example.html 。代码如下所示:

    // Run on Windows XP Pro machine, version 2002, SP 2
    // C++ from Visual Studio 2008 Pro Edition
    #include <stdio.h>
    #include <winsock2.h>
     
    int main()
    {
          WORD wVersionRequested;
        WSADATA wsaData;
        int wsaerr;
     
        // Using MAKEWORD macro, Winsock version request 2.2
          wVersionRequested = MAKEWORD(2, 2);
          wsaerr = WSAStartup(wVersionRequested, &wsaData);
         
          if (wsaerr != 0)
          {
                /* Tell the user that we could not find a usable */
                /* WinSock DLL.*/
                printf("The Winsock dll not found!\n");
                return 0;
          }
          else
          {
                printf("The Winsock dll found!\n");
                printf("The status: %s.\n", wsaData.szSystemStatus);
          }
     
          /* Confirm that the WinSock DLL supports 2.2.*/
          /* Note that if the DLL supports versions greater    */
          /* than 2.2 in addition to 2.2, it will still return */
          /* 2.2 in wVersion since that is the version we      */
          /* requested.                                        */
         
          if (LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 2 )
          {
                /* Tell the user that we could not find a usable */
                /* WinSock DLL.*/
                printf("The dll do not support the Winsock version %u.%u!\n", LOBYTE(wsaData.wVersion),HIBYTE(wsaData.wVersion));
                WSACleanup();
                return 0;
          }
          else
          {
                printf("The dll supports the Winsock version %u.%u!\n", LOBYTE(wsaData.wVersion),HIBYTE(wsaData.wVersion));
                printf("The highest version this dll can support: %u.%u\n", LOBYTE(wsaData.wHighVersion), HIBYTE(wsaData.wHighVersion));
          }
     
        /* More task... */
          return 0;
    }
    

      

    Next, let try building (compile and link) this solution. Click the Build menu > click the Build Solution sub menu.

    接下来就是 Buliding 我们的项目,点击 Build 菜单——》 选择 Build Solution 子菜单,如下图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 9

    Well, from the Output page, there are errors as shown in the following screenshot.

     从IDE环境的  Output 标签页中可以看到我们的代码编译出错信息,如下图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 10


    The details of the 'rubbish', has been re-produced in the following text. The failure is at the link time with two symbols could not be resolved as highlighted.

    编译错误信息我们已经重新处理成文本文件,出错原因是在链接期间有些符号(就是 标识符 )找不到链接对象信息,如下文本中高亮显示:

    1>------ Build started: Project: Winsock2sample, Configuration: Debug Win32 ------

    1>Compiling...

    1>Winsock2samplesrc.cpp

    1>Compiling manifest to resources...

    1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0

    1>Copyright (C) Microsoft Corporation.  All rights reserved.

    1>Linking...

    1>Winsock2samplesrc.obj : error LNK2019: unresolved external symbol __imp__WSACleanup@0 referenced in function _main

    1>Winsock2samplesrc.obj : error LNK2019: unresolved external symbol __imp__WSAStartup@8 referenced in function _main

    1>C:\networkdotnetproject\Winsock2sample\Debug\Winsock2sample.exe : fatal error LNK1120: 2 unresolved externals

    1>Build log was saved at "file://c:\networkdotnetproject\Winsock2sample\Winsock2sample\Debug\BuildLog.htm"

    1>Winsock2sample - 3 error(s), 0 warning(s)

    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


    Let invoke the project’s property page. Click the Project menu > select what_ever_your_project_name Properties sub menu.

    为了解决这个问题,我们首先查看工程的属性页, 点击 Project 菜单——》选择 工程属性子菜单。 如下图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 11

    We have to make sure that several settings are suited to our project type. First of all, make sure the compilation is

    for C code. Select the Configuration Properties folder > expand the C/C++subfolder > select the Advanced node.

    Make sure Compile as C Code (/TC) option was selected under the Compile As setting. You can skip this step if the

    setting is OK.

    我们需要确定工程属性里面的设置是适合我们的工程的。 首先 确保告诉编译器现在编译的是C语言代码,选择 Configuration Properties 文件夹 ——》 展开 C/C++ 文件

    夹 ——》选择 Advanced 节点。 确定 Complies AS 设定的属性值是: Compile as  C Code(/TC), 如果设定的值是: Compile as  C Code(/TC), 那么可以

     跳过这一步。 如下图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 12

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 13

    Next, rebuild the solution.

    接下来,重新编译链接我们的工程(解决方案)。如下图:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 14

    Well, same error generated.

    然而,不不幸的是,错误依旧。如下图:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 15

    The machine used to build this Win32 console mode application Winsock program, the Winsok2.h header files are found in various paths as shown below.

    Of course, yours should be different. In this machine we have installed several versions of the Visual Studio IDE which include the Express and full versions.

    What we want to confirm is that the winsock2.h header file is there.

     在我编译链接运这个Win32 控制台模板的Winsock应用程序的机器上, 头文件winsok2.h 可以在不同路径找到,如下图所示; 当然如果你的IDE的安装路径如果

    与我的不一样的话,这些路径不一定完全一样。 我的机器上安装了好几个版本VS IDE环境,包括Express版和FULL版,我们需要确应的是在机器上有winsock.h这个

    文件。

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 16

    And also for the Winsock2 library (WS2_32.lib) as shown in the following Figure. Remember that yours should be different. However the file names must be the same

    (Winsock2.h and WS2_32.lib). In this case, (multiple similar file) the concerned thing that we need to consider is the version of those files. As usual, the best thing is

    to use the latest one.

     同样在下面的图中,我们可以看到在我使用的机器上也安装了 winsock2 的库文件;当然,也许你的文件的路径可能与我的不一样,但是文件名一定要一样

    ((Winsock2.h and WS2_32.lib); 这里我们需要考虑的是文件的版本问题,通常做好的做法是: 无论何时都使用你的操作系统支持的最新的版本。

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 17

    Notice that, in the previous Figures for the Winsock2.h header and WS2_32.lib files, both are not available under the

     %Microsoft Visual Studio 9.0%, the folder for Visual xxxx 2008. To verify this, you can try searching those file in the

    folder shown in the following Figure. If those files are available there, then it is easier for us to use those files directly (and the

    previous build errors should not occurred in the first place).

    注意到: 前两幅图里面显示的winsock2.h 和 ws2_32.lib 文件的路径都不在%Microsoft Visual Studio 9.0%(VS XXXX 2008的安装路径)下面;

    为了改变这个设置,你可以尝试在VS IDE的安装路径下搜索这些文件,如下图所示。如果在你的机器上面有这些文件,那么我们就可以直接使用这些文件(同时

    上面Build时出现的错误就不会出现)。

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 18

    If those two files are available for Visual xxxx 2008, they should be found in the following subfolders. We found none.

    Ermmmm….we need to tell our VS 2008/ VC++ where to find the header and/or the library files implicitly or explicitly.

    如果这两个文件在VS xxxx 2008的安装路径下可以找到,那么在如下图所示的的文件夹里面应该可以找到,可惜的是我们没有找到。

    噢噢..........我们需要显示或者隐式的告诉VS 2008/VC++在哪里可以找到这两个文件。

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 19

    Before that, let verify our 'assumption' regarding the 'cannot find' winsock2 header and/or the library file. Re-open the project property page.

    Expand the Configuration Properties folder > expand the Linkers folder > select the General node. On the right pane, for the Show Progress: 

    setting, set to the Display All the Progress Messages (/VERBOSE).

    在这之前,我们来确认我们的 “假设”——IDE找不到上述两个文件。 再次打开我们的工程属性标签页(属性对话框),展开 Configuration Properties ——》Linkers

    ——>然后选择 General 节点, 在右边的面板上面, 将 Show Progress 属性设置为: Display All the Progress Messages (/VERBOSE). 如下图所示。

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 20

    Next, under the Configuration Properties folder > C/C++ folder > Advanced node, set Yes (/showincludes) for the Show Includes.

    Save the new settings and close the page by clicking the OK button. Both steps will tell the C++ compiler and linker to 'spit out' all the messages

    for what is 'she' doing during those processes (compiling and linking).

    然后再在 Configuration Properties ——》C/C++——》 Advanced 节点 上将 Show Includes.属性设置为Yes (/showincludes) 。 通过单击 OK 按钮

    来保存刚才的设定。这两步是要告诉IDE环境在编译和连接的过程中显示所有的编译和连接信息。如下图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 21

    If you build your program using the VC++ command line tools, the following Figure shows the options or switches that should be used for the same purpose.

    如果你用命令行的形式来编译连接你的程序,那么下图显示了在命令行编译连接过程中需要设定的选项和编译开关。如下图:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 22

    Next, rebuild the solution.

    我们重新编译连接;运行我们的程序;如下图:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 23

    Verify all the messages generated in the Output window. If the Output window is not docked in the IDE GUI,

    invoke it from the View > Output menu.

    编译后确认所有的编译和连接信息在 IDE环境的 Output 标签页中显示出来了,如果IDE环境没有显示 Output 标签页;那么通过下面的方式

    View > Output 。 如图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 24

    In our case, the winsok2.h header file was found and used under the

    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h

    Depending on the VS version that you use, the path may be different, however the file name should be the same. The following is a complete dump of the output.

    在这里, Winsock2.h 文件可以在下面的路径中找到:C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h

    当然与你使用的的IDE环境的版本有关,这个路径可能不一样,但是必须保证文件名一样。 下面是在output标签页中输出的完整的编译连接信息:

    1>------ Rebuild All started: Project: Winsock2sample, Configuration: Debug Win32 ------
    1>Deleting intermediate and output files for project 'Winsock2sample', configuration 'Debug|Win32'
    1>Compiling...
    1>Winsock2samplesrc.cpp
    1>Note: including file: C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h
    1>Note: including file:  C:\Program Files\Microsoft Visual Studio 9.0\VC\include\crtdefs.h
    1>Note: including file:   C:\Program Files\Microsoft Visual Studio 9.0\VC\include\sal.h
    1>Note: including file:    c:\program files\microsoft visual studio 9.0\vc\include\codeanalysis\sourceannotations.h
    1>Note: including file:   C:\Program Files\Microsoft Visual Studio 9.0\VC\include\crtassem.h
    1>Note: including file:   C:\Program Files\Microsoft Visual Studio 9.0\VC\include\vadefs.h
    1>Note: including file:  C:\Program Files\Microsoft Visual Studio 9.0\VC\include\swprintf.inl
    1>Note: including file: C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h
    1>Note: including file:  C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\windows.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\sdkddkver.h
    1>Note: including file:   C:\Program Files\Microsoft Visual Studio 9.0\VC\include\excpt.h
    1>Note: including file:    C:\Program Files\Microsoft Visual Studio 9.0\VC\include\crtdefs.h
    1>Note: including file:   C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdarg.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\windef.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winnt.h
    1>Note: including file:     C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ctype.h
    1>Note: including file:      C:\Program Files\Microsoft Visual Studio 9.0\VC\include\crtdefs.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\specstrings.h
    1>Note: including file:      C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\specstrings_adt.h
    1>Note: including file:      C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\specstrings_strict.h
    1>Note: including file:       C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\specstrings_undef.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\basetsd.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\guiddef.h
    1>Note: including file:      C:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h
    1>Note: including file:       C:\Program Files\Microsoft Visual Studio 9.0\VC\include\crtdefs.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack4.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:     c:\program files\microsoft sdks\windows\v6.0a\include\pshpack4.h
    1>Note: including file:     c:\program files\microsoft sdks\windows\v6.0a\include\pshpack2.h
    1>Note: including file:     c:\program files\microsoft sdks\windows\v6.0a\include\poppack.h
    1>Note: including file:     c:\program files\microsoft sdks\windows\v6.0a\include\pshpack2.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack2.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:     c:\program files\microsoft sdks\windows\v6.0a\include\poppack.h
    1>Note: including file:     c:\program files\microsoft sdks\windows\v6.0a\include\pshpack8.h
    1>Note: including file:     c:\program files\microsoft sdks\windows\v6.0a\include\poppack.h
    1>Note: including file:     c:\program files\microsoft sdks\windows\v6.0a\include\poppack.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ktmtypes.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winbase.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winerror.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\wingdi.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack1.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack2.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack2.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack4.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack4.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winuser.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack2.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\tvout.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winnls.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\wincon.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winver.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winreg.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\reason.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winnetwk.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\cderr.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\dde.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ddeml.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\dlgs.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\lzexpand.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\mmsystem.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack1.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\nb30.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\rpc.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\rpcdce.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\rpcdcep.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\rpcnsi.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\rpcnterr.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\rpcasync.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\shellapi.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack1.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winperf.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack8.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\wincrypt.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\bcrypt.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ncrypt.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\bcrypt.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winefs.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winscard.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\wtypes.h
    1>Note: including file:     c:\program files\microsoft sdks\windows\v6.0a\include\rpcndr.h
    1>Note: including file:      C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack8.h
    1>Note: including file:      C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\rpcnsip.h
    1>Note: including file:      C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\rpcsal.h
    1>Note: including file:      C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:     c:\program files\microsoft sdks\windows\v6.0a\include\guiddef.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winioctl.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack1.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack1.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack1.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack1.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack1.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack1.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:    c:\program files\microsoft sdks\windows\v6.0a\include\winsmcrd.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winspool.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\prsht.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack4.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ole2.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack8.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objbase.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack8.h
    1>Note: including file:     C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdlib.h
    1>Note: including file:      C:\Program Files\Microsoft Visual Studio 9.0\VC\include\crtdefs.h
    1>Note: including file:      C:\Program Files\Microsoft Visual Studio 9.0\VC\include\limits.h
    1>Note: including file:       C:\Program Files\Microsoft Visual Studio 9.0\VC\include\crtdefs.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\unknwn.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\guiddef.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\cguid.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\urlmon.h
    1>Note: including file:      c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h
    1>Note: including file:      c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h
    1>Note: including file:      c:\program files\microsoft sdks\windows\v6.0a\include\msxml.h
    1>Note: including file:       c:\program files\microsoft sdks\windows\v6.0a\include\oaidl.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\propidl.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\oleauto.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack8.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\commdlg.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\prsht.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\pshpack1.h
    1>Note: including file:    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\poppack.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\stralign.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsvc.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\mcx.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\imm.h
    1>Note: including file:  C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2def.h
    1>Note: including file:   C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\inaddr.h
    1>Note: including file:  C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\qos.h
    1>Compiling manifest to resources...
    1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
    1>Copyright (C) Microsoft Corporation.  All rights reserved.
    1>Linking...
    1>Starting pass 1
    1>Processed /DEFAULTLIB:uuid.lib
    1>Processed /DEFAULTLIB:MSVCRTD
    1>Processed /DEFAULTLIB:OLDNAMES
    1>Searching libraries
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\kernel32.lib:
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\user32.lib:
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\gdi32.lib:
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\winspool.lib:
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\comdlg32.lib:
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\advapi32.lib:
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\shell32.lib:
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\ole32.lib:
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\oleaut32.lib:
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\uuid.lib:
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\odbc32.lib:
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\odbccp32.lib:
    1>    Searching C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\MSVCRTD.lib:
    1>      Found __imp__printf
    1>        Referenced in Winsock2samplesrc.obj
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found ___security_cookie
    1>        Referenced in Winsock2samplesrc.obj
    1>        Loaded MSVCRTD.lib(gs_cookie.obj)
    1>      Found @__security_check_cookie@4
    1>        Referenced in Winsock2samplesrc.obj
    1>        Loaded MSVCRTD.lib(secchk.obj)
    1>      Found @_RTC_CheckStackVars@8
    1>        Referenced in Winsock2samplesrc.obj
    1>        Loaded MSVCRTD.lib(_stack_.obj)
    1>      Found __RTC_Shutdown
    1>        Referenced in Winsock2samplesrc.obj
    1>        Loaded MSVCRTD.lib(_init_.obj)
    1>      Found _mainCRTStartup
    1>        Loaded MSVCRTD.lib(crtexe.obj)
    1>      Found __IMPORT_DESCRIPTOR_MSVCR90D
    1>        Referenced in MSVCRTD.lib(MSVCR90D.dll)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found ___report_gsfailure
    1>        Referenced in MSVCRTD.lib(secchk.obj)
    1>        Loaded MSVCRTD.lib(gs_report.obj)
    1>      Found "void __cdecl _RTC_Failure(void *,int)" (?_RTC_Failure@@YAXPAXH@Z)
    1>        Referenced in MSVCRTD.lib(_stack_.obj)
    1>        Loaded MSVCRTD.lib(_error_.obj)
    1>      Found __RTC_SetErrorFuncW
    1>        Referenced in MSVCRTD.lib(_init_.obj)
    1>        Loaded MSVCRTD.lib(_userapi_.obj)
    1>      Found __CRT_RTC_INITW
    1>        Referenced in MSVCRTD.lib(_init_.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found ___CxxSetUnhandledExceptionFilter
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(unhandld.obj)
    1>      Found __imp___configthreadlocale
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found ___globallocalestatus
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(xthdloc.obj)
    1>      Found __setdefaultprecision
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(fp8.obj)
    1>      Found __imp____setusermatherr
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found __matherr
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(merr.obj)
    1>      Found __setargv
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(dllargv.obj)
    1>      Found __RTC_Initialize
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(_initsect_.obj)
    1>      Found __adjust_fdiv
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(adjustfd.obj)
    1>      Found __imp___adjust_fdiv
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found __commode
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(xncommod.obj)
    1>      Found __imp____p__commode
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found __fmode
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(xtxtmode.obj)
    1>      Found __imp____p__fmode
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found ___onexitbegin
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(atonexit.obj)
    1>      Found __imp___encode_pointer
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Referenced in MSVCRTD.lib(atonexit.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found __imp____set_app_type
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found __amsg_exit
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found __imp____getmainargs
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found __dowildcard
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(wildcard.obj)
    1>      Found __newmode
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(_newmode.obj)
    1>      Found ___security_init_cookie
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(gs_support.obj)
    1>      Found __imp___exit
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found __XcptFilter
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found __imp___cexit
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found __imp__exit
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found __imp____initenv
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found __imp___CrtSetCheckCount
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found __IsNonwritableInCurrentImage
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(pesect.obj)
    1>      Found __imp___CrtDbgReportW
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found __initterm
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found ___xc_a
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(cinitexe.obj)
    1>Processed /DEFAULTLIB:kernel32.lib
    1> Processed /DISALLOWLIB:libc.lib
    1> Processed /DISALLOWLIB:libcd.lib
    1> Processed /DISALLOWLIB:libcmt.lib
    1> Processed /DISALLOWLIB:libcmtd.lib
    1> Processed /DISALLOWLIB:msvcrt.lib
    1>      Found __initterm_e
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found ___native_startup_state
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded MSVCRTD.lib(natstart.obj)
    1>      Found __except_handler4
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Referenced in MSVCRTD.lib(_error_.obj)
    1>        Referenced in MSVCRTD.lib(atonexit.obj)
    1>        Referenced in MSVCRTD.lib(pesect.obj)
    1>        Loaded MSVCRTD.lib(chandler4gs.obj)
    1>      Found __NULL_IMPORT_DESCRIPTOR
    1>        Referenced in MSVCRTD.lib(MSVCR90D.dll)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found MSVCR90D_NULL_THUNK_DATA
    1>        Referenced in MSVCRTD.lib(MSVCR90D.dll)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found __crt_debugger_hook
    1>        Referenced in MSVCRTD.lib(gs_report.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found "int __cdecl _RTC_GetSrcLine(unsigned char *,wchar_t *,unsigned long,int *,wchar_t *,unsigned long)" (?_RTC_GetSrcLine@@YAHPAEPA_WKPAH1K@Z)
    1>        Referenced in MSVCRTD.lib(_error_.obj)
    1>        Loaded MSVCRTD.lib(_pdblkup_.obj)
    1>      Found "void __cdecl terminate(void)" (?terminate@@YAXXZ)
    1>        Referenced in MSVCRTD.lib(unhandld.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found __controlfp_s
    1>        Referenced in MSVCRTD.lib(fp8.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found __invoke_watson
    1>        Referenced in MSVCRTD.lib(fp8.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found __unlock
    1>        Referenced in MSVCRTD.lib(atonexit.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found ___dllonexit
    1>        Referenced in MSVCRTD.lib(atonexit.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found __lock
    1>        Referenced in MSVCRTD.lib(atonexit.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found __imp___onexit
    1>        Referenced in MSVCRTD.lib(atonexit.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found __imp___decode_pointer
    1>        Referenced in MSVCRTD.lib(atonexit.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>      Found __except_handler4_common
    1>        Referenced in MSVCRTD.lib(chandler4gs.obj)
    1>        Loaded MSVCRTD.lib(MSVCR90D.dll)
    1>    Searching C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\OLDNAMES.lib:
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\kernel32.lib:
    1>      Found __imp__InterlockedExchange@8
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__Sleep@4
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__InterlockedCompareExchange@12
    1>        Referenced in MSVCRTD.lib(crtexe.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__TerminateProcess@8
    1>        Referenced in MSVCRTD.lib(gs_report.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__GetCurrentProcess@0
    1>        Referenced in MSVCRTD.lib(gs_report.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__UnhandledExceptionFilter@4
    1>        Referenced in MSVCRTD.lib(gs_report.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__SetUnhandledExceptionFilter@4
    1>        Referenced in MSVCRTD.lib(gs_report.obj)
    1>        Referenced in MSVCRTD.lib(unhandld.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__IsDebuggerPresent@0
    1>        Referenced in MSVCRTD.lib(gs_report.obj)
    1>        Referenced in MSVCRTD.lib(_error_.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__RaiseException@16
    1>        Referenced in MSVCRTD.lib(_error_.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__DebugBreak@0
    1>        Referenced in MSVCRTD.lib(_error_.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__WideCharToMultiByte@32
    1>        Referenced in MSVCRTD.lib(_error_.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__MultiByteToWideChar@24
    1>        Referenced in MSVCRTD.lib(_error_.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__lstrlenA@4
    1>        Referenced in MSVCRTD.lib(_error_.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__GetProcAddress@8
    1>        Referenced in MSVCRTD.lib(_error_.obj)
    1>        Referenced in MSVCRTD.lib(_pdblkup_.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__LoadLibraryA@4
    1>        Referenced in MSVCRTD.lib(_error_.obj)
    1>        Referenced in MSVCRTD.lib(_pdblkup_.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__QueryPerformanceCounter@4
    1>        Referenced in MSVCRTD.lib(gs_support.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__GetTickCount@0
    1>        Referenced in MSVCRTD.lib(gs_support.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__GetCurrentThreadId@0
    1>        Referenced in MSVCRTD.lib(gs_support.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__GetCurrentProcessId@0
    1>        Referenced in MSVCRTD.lib(gs_support.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__GetSystemTimeAsFileTime@4
    1>        Referenced in MSVCRTD.lib(gs_support.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__HeapFree@12
    1>        Referenced in MSVCRTD.lib(_pdblkup_.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__HeapAlloc@12
    1>        Referenced in MSVCRTD.lib(_pdblkup_.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__GetProcessHeap@0
    1>        Referenced in MSVCRTD.lib(_pdblkup_.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__GetModuleFileNameW@12
    1>        Referenced in MSVCRTD.lib(_pdblkup_.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__VirtualQuery@12
    1>        Referenced in MSVCRTD.lib(_pdblkup_.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __imp__FreeLibrary@4
    1>        Referenced in MSVCRTD.lib(_pdblkup_.obj)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found __IMPORT_DESCRIPTOR_KERNEL32
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>      Found KERNEL32_NULL_THUNK_DATA
    1>        Referenced in kernel32.lib(KERNEL32.dll)
    1>        Loaded kernel32.lib(KERNEL32.dll)
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\user32.lib:
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\gdi32.lib:
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\winspool.lib:
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\comdlg32.lib:
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\advapi32.lib:
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\shell32.lib:
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\ole32.lib:
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\oleaut32.lib:
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\uuid.lib:
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\odbc32.lib:
    1>    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\odbccp32.lib:
    1>    Searching C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\MSVCRTD.lib:
    1>    Searching C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\OLDNAMES.lib:
    1>Finished searching libraries
    1>Finished pass 1
    1>Generating non-SAFESEH image.
    1>Invoking CVTRES.EXE:
    1> /machine:x86
    1> /verbose
    1> /out:"C:\DOCUME~1\MIKERI~1\LOCALS~1\Temp\lnk1B6.tmp"
    1> /readonly
    1> ".\Debug\Winsock2sample.exe.embed.manifest.res"
    1>Microsoft (R) Windows Resource To Object Converter Version 9.00.21022.08
    1>Copyright (C) Microsoft Corporation.  All rights reserved.
    1>adding resource. type:MANIFEST, name:1, language:0x0409, flags:0x30, size:2048
    1>Winsock2samplesrc.obj : error LNK2019: unresolved external symbol __imp__WSACleanup@0 referenced in function _main
    1>Winsock2samplesrc.obj : error LNK2019: unresolved external symbol __imp__WSAStartup@8 referenced in function _main
    1>C:\networkdotnetproject\Winsock2sample\Debug\Winsock2sample.exe : fatal error LNK1120: 2 unresolved externals
    1>Build log was saved at "file://c:\networkdotnetproject\Winsock2sample\Winsock2sample\Debug\BuildLog.htm"
    1>Winsock2sample - 3 error(s), 0 warning(s)
    ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
     
    

      

    However, the Winsok2 library (WS2_32.lib) was not found and loaded! So we have to solve this problem.

    The generated output such as where to find the header files, libraries, the path search order, where to put the intermediary files and many more are based on the settings

    set in the project’sOptions page. The page can be invoked from the Tools > Options menu as shown below.

    从上面的编译信息可以看出,Winsock2库文件没有找到,并且没有正确的被加载,因此我们需要解决这个问题。

    output输出的信息显示工程的 options 属性标签页面中设定的诸如: 在哪里 搜索头文件、库文件,以及搜索顺序,以及在哪里输出编译生成的obj文件和可执行文件。 

    通过下面的方式可以访问 options 属性页:Tools > Options 。 如下图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 25

    Most of the time the default settings given (set during the installation) are appropriate for most of the common development tasks.

    So, 'most of the time', the option settings are not customized or refined by developer. However, for advanced developer with 'advanced application',

    this part should be their best 'assistant'. An example situation on refining the project’s option is when you want to include the third party libraries.

    The following Figures show several Options settings for VC++ that will be enforced on and affect to all the C++ project. In this case, we do nothing in the Options page.

    通常在  options 属性页中默认的设置就可以适应大多数的应用,因此在大多数的应用中 options 属性标签页里面的设置不需要进行改变; 然后对于高级的开发应用这里需要

    根据实际应用进行改变。 一个例子就是当你想要在你的工程中应用第三方的库文件和头文件时,你就需要进行定制 options 属性标签页的设置。

    下图显示了 设置了几个 Options 属性标签页中的设置,将会影响所有的C++工程。这里我们不需要进行改变。

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 26

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 27

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 28

    Next, let have a peek on the Winsock2.h header file version. In our case, we see different Winsock2.h header file versions,

    installed and available from different paths based on the file Sizeand Date Modified properties as seen from the explorer.

    If you cannot find yours, that mean you are missing some modules during the installation and need to do the installation.

    In most cases, you need to install the Platform SDK module that will provide related specific resources such as libraries etc.

    for Windows platform application development. The file’s property page can also be accessed from the Properties context menu shown below.

    接下来, 我们来检查winsock2.h文件的版本信息。在我机器上通过 资源管理器 选择 大小和 最后修改时间 查看方式可以看到有很多不同版本的

    winsock2.h文件,并且这些文件有不同的路径。 如果在你的机器上不能找到这些文件,就说明在你安装VS IDE环境的过程中丢失了部分文件,你需要

    重新安装你的IDE环境。在大多数的情况下你需要为Windows应用程序开发安装平台SDK软件包,通过安装 平台SDK软件包,可以提供相关的资源例如

    库文件等等。同样你可以在资源管理其中通过 文件属性来查看文件的相关信息,如下图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 29

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 30

    From the following screenshot, the file size’s is 108 KB and modified date is 9/27/2007.

    如下图所示: 文件的大小是108KB,最后修改时间是 2007年9月27日

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 31

    From the following screenshot, the file size’s is 105 KB and modified date is 4/14/2005.

    下图所示文件的信息为: 大小 105KB,最后修改时间为 2005年4月14日

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 32

    From the following screenshot, the file size’s is 105 KB but the modified date is 3/3/2006.

    如下截图所示文件: 大小 105KB,最后修改 时间为 2006年3月3日

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 33

    Then, from the Output messages, we know that the Winsok2.h header file used was the latest version for our VS 2008 as re-produced below.

    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h

    Next, let add the 'missing' WS2_32.lib to our project. We already knew that the W2_32.lib file is there and the latest version should be from the same

    path as the Winsock2.h file as can be seen from the search result and re-produced below.

    C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib

    In this case, we have confirmed that VS C++ 2008 already knew the path, but not the file, so we just tell 'her' which library file she need to find.

    我们查看 output的信息 我们知道,上面的编译过程在vs 2008里面使用的winsock2.h 文件是最新的版本, 如下所示:

               C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h

    接下来让我来设置以使IDE环境中我们的工程可以找到  WS2_32.lib, 我们已经知道 WS2_32.lib文件 在计算机中是存在的,并且与我们的头文件具有相同

    的路径。如下所示:

                C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib

    前面我们已经确认VS C++ 2008已经知道这个路径:  C:\Program Files\Microsoft SDKs\Windows\v6.0A\,但是找不到库文件,因此我们只要

    告诉 IDE环境在哪里找到这个文件就可以了。如下图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 34

    Re-open the project’s property page.

    重新打开工程的 属性标签页,如下图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 35

    Expand the Configuration Properties folder > expand the Linker subfolder > select the Input node. For the Additional Dependencies setting,

    click the empty field on the right > click the ellipses.

    展开  Configuration Properties——>  Linker——》选择 Input 节点。 选择Additional Dependencies 右边的  ellipses. 按钮,如下图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 36

    Type the library name, WS2_32.lib manually in the top empty text box of the Additional Dependencies page.

    Click the OK button to save the setting and close the Additional Dependencies page.

    在弹出的 Additional Dependencies 对话框的文本输入框中输入:WS2_32.lib; 然后点击 OK 按钮保存设定。如下图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 37

    Click OK button to save and close the project’s property page.

    点击 OK 按钮来保存 工程属性的设定值。如下托所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 38

    Next, rebuild our solution.

    接下来,Rebuild 工程;如下图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 39

    Notice that, from the verbose Output window, the WS2_32.lib was searched, found and included in the project.

    在IDE环境的 output 窗口, WS2_32.lib文件已经被搜索到,并且已经包含到我们的工程中。

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 40

    And we successfully, build (compile and link) our project this time.

    并且我们成功编译和链接我们的程序, 如下图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 41

    Next, the fun time. Run our project.

    最后,激动人心的时刻到了,那就是运行我们的工程(程序),如下图所示:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 42

    The following shows the output.

    下图显示我们的运行结果:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 43

    下面的就不翻译了, 嘿嘿,大家自己看吧。

    By following the same 'related previous steps' we try the second program example taken from http://www.tenouk.com/Winsock/Winsock2example1.html.

    The code re-produced below. In this code we have to replace the SOCKET m_socket; declaration at the top part of the source file.

    This indicate the restrictness settings for the project which can be customized through the project's property page and/or the Options page as shown previously.

    #include <stdio.h>
    #include <winsock2.h>
    int main()
    {
          WORD wVersionRequested;
          WSADATA wsaData;
          int wsaerr;
          //////////Create a socket////////////////////////
          //Create a SOCKET object called m_socket.
          SOCKET      m_socket;
         
          // Using MAKEWORD macro, Winsock version request 2.2
          wVersionRequested = MAKEWORD(2, 2);
          wsaerr = WSAStartup(wVersionRequested, &wsaData);
         
          if (wsaerr != 0)
          {
                /* Tell the user that we could not find a usable */
            /* WinSock DLL.*/
                printf("The Winsock dll not found!\n");
                return 0;
          }
          else
          {
                printf("The Winsock dll found!\n");
                printf("The status: %s.\n", wsaData.szSystemStatus);
          }
         
          /* Confirm that the WinSock DLL supports 2.2.        */
          /* Note that if the DLL supports versions greater    */
          /* than 2.2 in addition to 2.2, it will still return */
          /* 2.2 in wVersion since that is the version we      */
          /* requested.                                        */    
          if (LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 2)
          {
                /* Tell the user that we could not find a usable */
                /* WinSock DLL.*/
                printf("The dll do not support the Winsock version %u.%u!\n", LOBYTE(wsaData.wVersion),HIBYTE(wsaData.wVersion));
                WSACleanup();
                return 0;
          }
          else
          {
                printf("The dll supports the Winsock version %u.%u!\n", LOBYTE(wsaData.wVersion),HIBYTE(wsaData.wVersion));
                printf("The highest version this dll can support: %u.%u\n", LOBYTE(wsaData.wHighVersion), HIBYTE(wsaData.wHighVersion));
          }
     
          // Call the socket function and return its value to the m_socket variable.
          // For this application, use the Internet address family, streaming sockets, and
          // the TCP/IP protocol.
          // using AF_INET family, TCP socket type and protocol of the AF_INET - IPv4
          m_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
         
          // Check for errors to ensure that the socket is a valid socket.
          if (m_socket == INVALID_SOCKET)
          {
                printf("Error at socket(): %ld\n", WSAGetLastError());
                WSACleanup();
                return 0;
          }
          else
          {
                printf("socket() is OK!\n");
          }
          return 0;
    }
     
    
    

      The sample output:

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 44

    Well, it works! As mentioned before, we are not just trying to 'mess up' our VS C++ 2008 programming environment here, but more important thing is to learn and have some familiarities

    to the VS / VS C++ itself. In simple words, the same steps can be followed for other headers and/or libraries file inclusion to the project

    One more thing that we want to mention if you build the program examples for Winsock at Tenouk.com is the Unicode issue.

    Unfortunately, we are not aware whether those codes are all based on the Unicode character set (optional support for older Visual IDE).

    However, based on the previous two program examples re-compilation, the Unicode is supported for the Winsok2 'resource' files.

    If you encounter this issue through the generated warning or error in the Output Window, you may want to try disable the

    Unicode support in the project's property page as shown below. The Unicode was set by default.

    The Visual studio 2008/visual C++ .NET and winsock2 C code building (compile and link) issue and how-to documentation 45





  • 相关阅读:
    Assetbundle创建与加载
    11个超棒的iOS开发学习网站
    UGUI
    Unity3D教程宝典之Shader篇
    解决ngui挡住粒子的问题
    unity 随笔
    进程与线程浅析
    c#语言
    Unity3D中使用委托和事件
    Unity3D中常用的数据结构总结与分析
  • 原文地址:https://www.cnblogs.com/volcanol/p/2238004.html
Copyright © 2011-2022 走看看