久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<tfoot id='lPHgD'></tfoot>

    <i id='lPHgD'><tr id='lPHgD'><dt id='lPHgD'><q id='lPHgD'><span id='lPHgD'><b id='lPHgD'><form id='lPHgD'><ins id='lPHgD'></ins><ul id='lPHgD'></ul><sub id='lPHgD'></sub></form><legend id='lPHgD'></legend><bdo id='lPHgD'><pre id='lPHgD'><center id='lPHgD'></center></pre></bdo></b><th id='lPHgD'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='lPHgD'><tfoot id='lPHgD'></tfoot><dl id='lPHgD'><fieldset id='lPHgD'></fieldset></dl></div>

    • <bdo id='lPHgD'></bdo><ul id='lPHgD'></ul>
    1. <legend id='lPHgD'><style id='lPHgD'><dir id='lPHgD'><q id='lPHgD'></q></dir></style></legend>

      <small id='lPHgD'></small><noframes id='lPHgD'>

    2. 對 WinMain (C++ Mingw) 的未定義引用

      Undefined reference to WinMain (C++ Mingw)(對 WinMain (C++ Mingw) 的未定義引用)
    3. <legend id='jTqpv'><style id='jTqpv'><dir id='jTqpv'><q id='jTqpv'></q></dir></style></legend>

            <tbody id='jTqpv'></tbody>
              <tfoot id='jTqpv'></tfoot>
            • <i id='jTqpv'><tr id='jTqpv'><dt id='jTqpv'><q id='jTqpv'><span id='jTqpv'><b id='jTqpv'><form id='jTqpv'><ins id='jTqpv'></ins><ul id='jTqpv'></ul><sub id='jTqpv'></sub></form><legend id='jTqpv'></legend><bdo id='jTqpv'><pre id='jTqpv'><center id='jTqpv'></center></pre></bdo></b><th id='jTqpv'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='jTqpv'><tfoot id='jTqpv'></tfoot><dl id='jTqpv'><fieldset id='jTqpv'></fieldset></dl></div>

                <bdo id='jTqpv'></bdo><ul id='jTqpv'></ul>

                <small id='jTqpv'></small><noframes id='jTqpv'>

              • 本文介紹了對 WinMain (C++ Mingw) 的未定義引用的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                目前我正在嘗試使用 C++ 制作一個 Windows 應用程序.為了編譯我的程序,我使用 Mingw GCC.順便說一句,我在 Windows 10 上.但是一旦我使用 int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int nCmdShow) 而不是 int main() 編譯器會顯示以下消息:><塊引用>

                C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o):crt0_c.c:(.text.startup+0x2e):對WinMain" collect2.exe 的未定義引用:錯誤:ld 返回 1退出狀態終端進程以退出代碼終止:1

                我嘗試編譯的示例代碼來自此 Windows 應用程序教程:示例代碼

                我已經嘗試重新安裝 mingw,但沒有幫助.這就是為什么我希望這里有人可以幫助我解決我的問題.提前謝謝你!

                解決方案

                此示例代碼使用 wWinMain

                <塊引用>

                需要注意的一點是 Visual C++ 支持wWinMain"入口點其中lpCmdLine"參數是LPWSTR".您通常會使用入口點的_tWinMain"預處理器定義和聲明LPTSTR lpCmdLine",以便您可以輕松地同時支持 ANSI和 Unicode 構建.但是,MinGW CRT 啟動庫沒有支持 wWinMain,所以你必須堅持使用標準的WinMain"如果需要訪問命令行,請使用GetCommandLine()"參數.

                通過 使用 MinGW 構建 Win32 GUI 應用程序

                在這種特定情況下,您可以改用 WinMain.這個程序不使用pCmdLine 值,所以當你把wWinMain 改為WinMainPWSTR pCmdLine 時它應該編譯到 PSTR pCmdLine.

                如果您以后需要 unicode 命令行,請使用 LPWSTR cmd_line = GetCommandLineW(); 而不是 WinMain 參數.

                較新的 Mingw 版本還支持 -municode 鏈接器選項切換到備用啟動代碼,允許使用 wWinMain 而不是 WinMain(或 wmain 而不是 main).將其添加到命令行、IDE 或 makefile 中的鏈接器選項.

                g++ other_options_and_arguments -municode

                currently I am trying to make a windows application using c++. For compiling my program I use Mingw GCC. Btw I'm on Windows 10. But as soon as I use int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int nCmdShow) instead of int main() the compiler shows me following message:

                C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o):crt0_c.c:(.text.startup+0x2e): undefined reference to `WinMain' collect2.exe: error: ld returned 1 exit status The terminal process terminated with exit code: 1

                The example code I tried to compile I got from this Windows application tutorial: Example Code

                I have already tried reinstalling mingw but it did not help. That's why i hoped someone here could help me with my problem. Thank you in advance!

                解決方案

                This example code uses wWinMain but

                One thing to note is that Visual C++ supports a "wWinMain" entry point where the "lpCmdLine" parameter is a "LPWSTR". You would typically use the "_tWinMain" preprocessor definition for your entry point and declare "LPTSTR lpCmdLine" so that you can easily support both ANSI and Unicode builds. However, the MinGW CRT startup library does not support wWinMain, so you’ll have to stick with the standard "WinMain" and use "GetCommandLine()" if you need to access command line arguments.

                via Building Win32 GUI Applications with MinGW

                In this specific case, you can use WinMain instead. This program doesn't use pCmdLine value, so it should compile when you change wWinMain to WinMain and PWSTR pCmdLine to PSTR pCmdLine.

                If you later would need unicode command line use LPWSTR cmd_line = GetCommandLineW(); instead of WinMain argument.

                Newer Mingw versions also support -municode linker option switching to alternate startup code allowing to use wWinMain instead of WinMain (or wmain instead of main). Add it to your command line, linker options in IDE or makefile.

                g++ other_options_and_arguments -municode
                

                這篇關于對 WinMain (C++ Mingw) 的未定義引用的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                In what ways do C++ exceptions slow down code when there are no exceptions thown?(當沒有異常時,C++ 異常會以何種方式減慢代碼速度?)
                Why catch an exception as reference-to-const?(為什么要捕獲異常作為對 const 的引用?)
                When and how should I use exception handling?(我應該何時以及如何使用異常處理?)
                Scope of exception object in C++(C++中異常對象的范圍)
                Catching exceptions from a constructor#39;s initializer list(從構造函數的初始化列表中捕獲異常)
                Difference between C++03 throw() specifier C++11 noexcept(C++03 throw() 說明符 C++11 noexcept 之間的區別)
                  <bdo id='jltu8'></bdo><ul id='jltu8'></ul>

                  <tfoot id='jltu8'></tfoot>

                    • <small id='jltu8'></small><noframes id='jltu8'>

                        <tbody id='jltu8'></tbody>

                      <i id='jltu8'><tr id='jltu8'><dt id='jltu8'><q id='jltu8'><span id='jltu8'><b id='jltu8'><form id='jltu8'><ins id='jltu8'></ins><ul id='jltu8'></ul><sub id='jltu8'></sub></form><legend id='jltu8'></legend><bdo id='jltu8'><pre id='jltu8'><center id='jltu8'></center></pre></bdo></b><th id='jltu8'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='jltu8'><tfoot id='jltu8'></tfoot><dl id='jltu8'><fieldset id='jltu8'></fieldset></dl></div>
                      <legend id='jltu8'><style id='jltu8'><dir id='jltu8'><q id='jltu8'></q></dir></style></legend>
                        • 主站蜘蛛池模板: 91精品久久久久 | 日韩欧美一区二区三区四区 | 99自拍视频 | 日韩精品一区二区三区视频播放 | 另类专区成人 | 日韩免费一级 | 国产精品久久久亚洲 | 在线播放中文字幕 | 国产一级在线 | 日韩国产高清在线观看 | 日韩国产欧美一区 | 亚洲精品大全 | 亚洲一区二区三区视频在线 | 亚洲 中文 欧美 日韩 在线观看 | 91视视频在线观看入口直接观看 | 人人看人人草 | 全免费a级毛片免费看视频免费下 | 日本精品一区 | 国产精品一区三区 | 免费99视频| 成人妇女免费播放久久久 | 久久久91精品国产一区二区精品 | 超碰操 | 精品欧美一区二区三区精品久久 | 国产福利视频 | 成人国产免费视频 | 伊人春色在线观看 | 中文字幕亚洲视频 | 欧美性a视频 | 亚洲精品久久久久久一区二区 | 久色网| 狠狠干影院 | 在线观看av中文字幕 | 国产欧美精品一区二区色综合朱莉 | 欧美日韩大片 | 国产精久久久久久久 | 亚洲人精品午夜 | 日韩日b视频 | 99在线免费观看视频 | 国产精品亚洲精品 | 一级片在线视频 |