• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            牽著老婆滿街逛

            嚴以律己,寬以待人. 三思而后行.
            GMail/GTalk: yanglinbo#google.com;
            MSN/Email: tx7do#yahoo.com.cn;
            QQ: 3 0 3 3 9 6 9 2 0 .

            ACE_STUDY ACE應(yīng)用程序鏈接錯誤 error LNK2019 的解決辦法

            from:http://hi.baidu.com/erdosfish/blog/item/6d82aa180cf33e0634fa41e4.html

            ACE應(yīng)用程序鏈接錯誤      error LNK2019 的解決辦法
            注意:是Stone Jiang寫的,我找到的文章。感謝他的文章!

            讀者水平:初級 http://blog.csdn.net/FocusOnACE/archive/2006/07/09/896332.aspx
            摘要:文本簡要指出如何正確編譯和鏈接ACE應(yīng)用程序。

            對于新手來說,ACE開發(fā)環(huán)境,會是一團謎團,如何正確配置開發(fā)者機器,快速體驗ACE,
            就是本系列文章的目的。本文僅解決如何解決LNK2019錯誤

            環(huán)境:
              

                    ACE版本 5.5.1
                     操作系統(tǒng) Windows xp professional sp2
                     開發(fā)環(huán)境 Microsoft Visual C++ 2005       77626-009-0000007-41235


            下面的代碼是服務(wù)的主程序

            // @file: RegisterServer.cpp :
            // @description: Defines the entry point for the GameService Daemon application.
            // @date: 2006-07-06
            // @author: Jiangtao<2005119@gmail.com>
            #ifdef _DEBUG
            #define        ACE_NDEBUG 0
            #define        ACE_NTRACE 0
            #endif
            #include      
            " stdafx.h "
            #include      
            " ACE/Filecache.h "
            #include      
            " ACE/Log_Msg.h "
            #include      
            " ACE/OS_NS_signal.h "
            #include      
            " ACE/Service_Config.h "

            #ifdef ACE_HAS_SIG_C_FUNC
            #pragma message ( 
            " ACE_HAS_SIG_C_FUNC " )
            extern       " C "
            {
            #endif      /* ACE_HAS_SIG_C_FUNC */

                  
            //      call exit() so that static destructors get called
                  static       void
                  handler ( 
            int )
            {
                  delete (ACE_Filecache      
            * ) ACE_Filecache::instance ();
                  ACE_OS::exit ( 
            0 );
            }

            #ifdef ACE_HAS_SIG_C_FUNC
            }
            #endif      /* ACE_HAS_SIG_C_FUNC */

            int      ACE_TMAIN( int      argc, ACE_TCHAR *      argv[])
            {
            ACE_DEBUG((LM_INFO,ACE_TEXT( 
            " 啟動服務(wù)\n " )));
            ACE_Service_Config daemon;

            ACE_OS::signal (SIGCHLD, SIG_IGN);

                  
            //      SigAction not needed since the handler will shutdown the server.
            ACE_OS::signal (SIGINT, (ACE_SignalHandler) handler);
            ACE_OS::signal (SIGUSR2, (ACE_SignalHandler) handler);

                  
            if      (daemon.open (argc, argv, ACE_DEFAULT_LOGGER_KEY,      0 )      !=       0 )
                  ACE_ERROR_RETURN ((LM_ERROR,      
            " %p\n " ,      " open " ),      1 );

                  
            //      The configured service creates threads, and the
                  
            //      server won't exit until the threads die.

                  
            //      Run forever, performing the configured services until we receive
                  
            //      a SIGINT.

                  
            return       0 ;
            }



            服務(wù)加載的配置文件

            ###############################################################################
            # file svc.conf
            ###############################################################################

            dynamic GameService Service_Object      
            *      GameService: _make_GameServer_T() active


            出錯提示:

            ----- Build started: Project: RegisterServer, Configuration: Debug Win32 ------
            Compiling
            RegisterServer.cpp
            Linking
            RegisterServer.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) int __cdecl ace_os_wmain_i(class ACE_Main_Base &,int,wchar_t * * const)" (
            __imp_?ace_os_wmain_i@@YAHAAVACE_Main_Base@@HQAPA_W@Z) referenced in function _wmain
            RegisterServer.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static int __cdecl ACE_Service_Config::open(int,wchar_t * * const,wchar_t const *,int,int,int)" (
            __imp_?open@ACE_Service_Config@@SAHHQAPA_WPB_WHHH@Z) referenced in function "int __cdecl ace_wmain_i(int,wchar_t * * const)" (?ace_wmain_i@@YAHHQAPA_W@Z)
            D:\ACE_OUTPUT\Game\\RegisterServerd.exe : fatal error LNK1120: 2 unresolved externals
            Build log was saved at "
            file://d:\My Sources\RegisterService\RegisterServer\Debug\BuildLog.htm"
            RegisterServer - 3 error(s), 0 warning(s)
            ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
            問題分析
            出錯信息顯示,不能解析函數(shù)ace_os_wmain_i()以及      ACE_Service_Config::open()。
            從這里可以看出,鏈接器需要UNICODE版本的ace庫,而我們在生成ACE的時候,并沒有生成寬字符
            的UNICODE版本。

            解決辦法:
            打開項目的屬性頁,找到配置屬性,在字符集中,選擇多字節(jié)字符集。再重新編譯,問題解決。


            posted on 2007-10-11 15:31 楊粼波 閱讀(614) 評論(0)  編輯 收藏 引用


            只有注冊用戶登錄后才能發(fā)表評論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            日韩精品久久无码人妻中文字幕| 欧美日韩精品久久久久| 久久精品国产亚洲AV无码偷窥| 人妻精品久久久久中文字幕一冢本| 久久久无码一区二区三区| 亚洲国产精品久久久久婷婷软件| 99久久亚洲综合精品成人| 色偷偷91久久综合噜噜噜噜| 香蕉久久av一区二区三区| 久久久91精品国产一区二区三区| 亚洲国产精品成人AV无码久久综合影院 | 国产精品99久久不卡| 久久99精品国产麻豆婷婷| 亚洲AV无码一区东京热久久| 精品国产91久久久久久久a | 国内精品久久久久久中文字幕| 亚洲欧美一区二区三区久久| 久久精品一区二区三区不卡| 久久SE精品一区二区| 久久久久国色AV免费观看| 狠狠色丁香久久综合五月| 亚洲欧美伊人久久综合一区二区| 久久www免费人成精品香蕉| 国产精品美女久久久久| 伊人久久精品无码二区麻豆| 一97日本道伊人久久综合影院| 久久www免费人成精品香蕉| 色综合久久综合网观看| 久久天天躁狠狠躁夜夜avapp | 色偷偷88888欧美精品久久久| 久久激情五月丁香伊人| 精品人妻伦一二三区久久| 99久久99久久精品国产| 91久久国产视频| 人人狠狠综合久久亚洲88| 久久r热这里有精品视频| 97r久久精品国产99国产精| 99久久99久久久精品齐齐| 高清免费久久午夜精品| 久久精品国产亚洲AV无码偷窥| 久久精品国产亚洲AV大全|