Hi, thanks for the time and help.
I would like to find a simple way, here is my try steps:
I try to create a cbp file which use the makefile.gcc under the sample/minimal folder.
I add the line
makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 VENDOR=cb
Because I built wx library with the command:
mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 VENDOR=cb
Now, I have a "all" build target of the cbp file.
When I click the "build" button, I got this:
-------------- Build: all in minimal (compiler: GNU GCC Compiler)---------------
[100.0%] Checking if target is up-to-date: mingw32-make.exe -q -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 VENDOR=cb all
Running command: mingw32-make.exe -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 VENDOR=cb all
process_begin: CreateProcess(NULL, F:/msys2/mingw64/bin/ -c "if not exist gcc_mswudll mkdir gcc_mswudll", ...) failed.
make (e=5): 拒绝访问。
mingw32-make: [makefile.gcc:206: gcc_mswudll] Error 5 (ignored)
if not exist gcc_mswudll mkdir gcc_mswudll
windres -i../../samples/sample.rc -ogcc_mswudll\minimal_sample_rc.o --define __WXMSW__ --define NDEBUG --define _UNICODE --include-dir .\..\..\lib\gcc_dll\mswu --include-dir ./../../include --include-dir . --define WXUSINGDLL --define wxUSE_DPI_AWARE_MANIFEST=2 --include-dir ./../../samples --define NOPCH
windres: gcc_mswudll\minimal_sample_rc.o: No such file or directory
mingw32-make: *** [makefile.gcc:224: gcc_mswudll\minimal_sample_rc.o] Error 1
Process terminated with status 2 (0 minute(s), 0 second(s))
3 error(s), 0 warning(s) (0 minute(s), 0 second(s))
The Chinese text means "access deny".
When I look at the makefile.gcc, I see this line:
$(OBJS):
-if not exist $(OBJS) mkdir $(OBJS)
This means the makefile does not work correctly under C::B, while I see it works correctly under Windows cmd.
Here is the log under Windows CMD
F:\code\wxWidgets-3.2.1\samples\minimal>mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 VENDOR=cb all
if not exist gcc_mswudll mkdir gcc_mswudll
windres -i../../samples/sample.rc -ogcc_mswudll\minimal_sample_rc.o --define __WXMSW__ --define NDEBUG --define _UNICODE --include-dir .\..\..\lib\gcc_dll\mswu --include-di
r ./../../include --include-dir . --define WXUSINGDLL --define wxUSE_DPI_AWARE_MANIFEST=2 --include-dir ./../../samples --define NOPCH
g++ -c -o gcc_mswudll\minimal_minimal.o -O2 -mthreads -D__WXMSW__ -DNDEBUG -D_UNICODE -I.\..\..\lib\gcc_dll\mswu -I.\..\..\include -W -Wall -I. -DWXUSINGDLL -I.\..\..\sample
s -DNOPCH -Wno-ctor-dtor-privacy -MTgcc_mswudll\minimal_minimal.o -MFgcc_mswudll\minimal_minimal.o.d -MD -MP minimal.cpp
g++ -o gcc_mswudll\minimal.exe @gcc_mswudll\minimal.exe.rsp -mthreads -L.\..\..\lib\gcc_dll -Wl,--subsystem,windows -mwindows -lwxmsw32u -lwxscintilla -lwxtiff -lwxjpeg -
lwxpng -lwxzlib -lwxregexu -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lve
rsion -lws2_32 -lwininet -loleacc -luxtheme
So, it looks like a wrong shell is called? or any solutions?
Thanks.
EDIT: problem solved!The problem is that I have a path:
$(TARGET_COMPILER_DIR)../usr/bin
In the compiler's extra path. I just remove this line, and restart C::B, and it is OK now.
EDIT2:I think this issue has already mentioned by
AndrewCot, because I have put the msys' shell path usr/bin to the mingw64/bin path. Though I can use the sh.exe to call the wx-config script, but this also cause this issue.