簡體   English   中英

setup.h沒有這樣的文件或目錄

[英]setup.h no such file or directory

您好,我正在嘗試構建用於代碼塊的wxWidgets 3.0。 當我運行手冊上給出的命令時

mingw32-make -f makefile.gcc BUILD = release SHARED = 1 MONOLITHIC = 1 UNICODE = 1 CXXFLAGS = -fno-keep-inline-dllexport

它表示錯誤包括\\ include / setup / .h:121:27:致命錯誤:../../../lib/vc_x64_lib/mswu/wx/setup.h

它還說

C:\wxWidgets-3.0.4\build\msw>mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 CXXFLAGS=-fno-keep-inline-dllexport
if not exist ..\..\lib\gcc_dll\mswu mkdir ..\..\lib\gcc_dll\mswu
gcc -c -o gcc_mswudll\wxregex_regcomp.o  -O2 -mthreads  -DHAVE_W32API_H -DNDEBUG -I..\..\include -I..\..\lib\gcc_dll\mswu -D__WXMSW__  -D_UNICODE   -MTgcc_mswudll\wxregex_regcomp.o -MFgcc_mswudll\wxregex_regcomp.o.d -MD -MP ../../src/regex/regcomp.c
In file included from ..\..\include/wx/platform.h:183:0,
                 from ..\..\include/wx/defs.h:27,
                 from ../../src/regex/regcustom.h:39,
                 from ../../src/regex/regguts.h:38,
                 from ../../src/regex/regcomp.c:33:
..\..\include/wx/setup.h:12:6: error: #error "This file should only be included when using Microsoft Visual C++"
     #error "This file should only be included when using Microsoft Visual C++"
      ^
In file included from ..\..\include/wx/version.h:16:0,
                 from ..\..\include/wx/setup.h:19,
                 from ..\..\include/wx/platform.h:183,
                 from ..\..\include/wx/defs.h:27,
                 from ../../src/regex/regcustom.h:39,
                 from ../../src/regex/regguts.h:38,
                 from ../../src/regex/regcomp.c:33:
..\..\include/wx/setup.h:113:31: error: pasting "/" and "vc_x64_lib" does not give a valid preprocessing token
         wxCONCAT6(../../../lib/, wxLIB_SUBDIR, /, wxTOOLKIT_PREFIX, wxSUFFIX, /wx/setup.h)

我要使用的手冊是: http : //wiki.codeblocks.org/index.php?title=WxWindowsQuickRef

如果您嘗試進行任何操作仍會出錯,請按照以下說明進行操作:

  1. 刪除整個wxWidgets文件夾,以您的情況為C:\\wxWidgets-3.0.4

  2. 重新安裝wxWidgets,即使在同一目錄中

  3. 刪除與舊gcc相關的所有內容(可能是dir和PATH var,請參見下文),然后下載安裝最新版本的gcc。 Mingw 32 mingw-get-setup.exe ,從Mingw 64或從TDM組合32/64 稍后,您需要為您的應用將此編譯器設置為默認的C :: B編譯器。

  4. 如果需要,將mingw/bin目錄添加到Windows PATH環境var中。

  5. 打開命令框窗口,然后復制並粘貼以下行:

    mingw32-make -f makefile.gcc BUILD = release UNICODE = 1 USE_OPENGL = 1 CXXFLAGS =“-std = gnu ++ 11 -fno-keep-inline-dllexport”

請注意,我已經刪除了MONOLITHIC = 1標志,有時這是問題的根源。 唯一的結果是,您必須向項目設置中添加幾個庫(基本庫,核心庫等,並以適當的順序),而不是一個大庫。 看看<wxWidgets dir>\\lib

mingw\\bin到PATH是一個選項。 C :: B不需要它。 需要它的是命令框。 如果您不想污染PATH變量,則每次打開命令框使用編譯器時都必須添加它:
在此命令框中使用編譯器之前,請執行PATH=%PATH%;C:\\MinGW\\bin (其中MinGW是您安裝編譯器的位置)。

您必須手動將文件include/msvc/wx/setup.hinclude/wx/setup.h ,該文件沒有其他說明。 不必這樣做,現在需要刪除創建的文件,並撤消為使構建正常進行而可能進行的其他更改。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM