Need help after failed to build wxSqlite4.8.2+wx3.2 Monolithic with MinGW8.1 under Win10 Topic is solved

In this forum you can discuss database related issues which can be wxWidgets related, but also generic in nature.
Post Reply
samsam598
Super wx Problem Solver
Super wx Problem Solver
Posts: 340
Joined: Mon Oct 06, 2008 12:55 pm

Need help after failed to build wxSqlite4.8.2+wx3.2 Monolithic with MinGW8.1 under Win10

Post by samsam598 »

Nice Day!

Several years before I build wxSqlite3(sqlite3.3.1)+wx3.1+MinGW4.7 and verything is great.
During the past several days this week,when with wx3.2+MinGW8.1,I can't make it this time.

Code: Select all

In file included from E:\Learning\LoveDev\SDK\wx32/include/wx/defs.h:45,
                 from E:\Learning\LoveDev\SDK\wx32/include/wx/wxprec.h:12,
                 from ../src/wxsqlite3.cpp:17:
E:\Learning\LoveDev\SDK\wx32/include/wx/platform.h:159:10: fatal error: wx/setup.h: No such file or directory
 #include "wx/setup.h"
          ^~~~~~~~~~~~
compilation terminated.
mingw32-make[1]: *** [wxsqlite3_mono.make:267: obj/gcc/Win32/Debug/wxsqlite3/wxsqlite3.o] Error 1
mingw32-make: *** [makefile:86: wxsqlite3] Error 2
Actually my build.bat file is as below:

Code: Select all

set PATH=E:\Learning\lovedev\MinGW81\bin;%PATH%;
rem mingw32-make clean
mingw32-make -fmakefile WX_SHARED=0 WX_DEBUG=0 WX_VERSION=32 WX_MONOLITHIC=1 WX_DIR=E:\Learning\lovedev\sdk\wx32 SHARED=0  clean
mingw32-make -fmakefile WX_SHARED=0 WX_DEBUG=0 WX_VERSION=32 WX_MONOLITHIC=1 WX_DIR=E:\Learning\lovedev\sdk\wx32 SHARED=0  2>errlog.txt
pause

and in the system environment variable:
WXWIN---E:\Learning\LoveDev\SDK\wx32
and,
Path already have below :
E:\Learning\LoveDev\SDK\wx32\include
E:\Learning\LoveDev\SDK\wx32\lib\gcc_lib\mswu

I have no idea why the compiler complains it can not find "wx/setup.h"

or, is there anything else that I made wrong?

Thanks for the help in advance.

PS:
wxSqlite3 is great and I love it.
Regards,
Sam
-------------------------------------------------------------------
Windows 10 64bit
VS Community 2019
msys2-mingw13.2.0 C::B character set: UTF-8/GBK(Chinese)
wxWidgets 3.3/3.2.4 Unicode Mono Static gcc static build
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Need help after failed to build wxSqlite4.8.2+wx3.2 Monolithic with MinGW8.1 under Win10

Post by utelle »

samsam598 wrote: Fri Jul 22, 2022 7:28 am During the past several days this week,when with wx3.2+MinGW8.1,I can't make it this time.

Code: Select all

In file included from E:\Learning\LoveDev\SDK\wx32/include/wx/defs.h:45,
                 from E:\Learning\LoveDev\SDK\wx32/include/wx/wxprec.h:12,
                 from ../src/wxsqlite3.cpp:17:
E:\Learning\LoveDev\SDK\wx32/include/wx/platform.h:159:10: fatal error: wx/setup.h: No such file or directory
 #include "wx/setup.h"
          ^~~~~~~~~~~~
compilation terminated.
mingw32-make[1]: *** [wxsqlite3_mono.make:267: obj/gcc/Win32/Debug/wxsqlite3/wxsqlite3.o] Error 1
mingw32-make: *** [makefile:86: wxsqlite3] Error 2
This problem has nothing to do with wxSQLite3, but with how you built your wxWidgets libraries. The error message indicates that the matching wxWidgets variant was not built correctly.

So, the main question is, how you built wxWidgets itself?
samsam598 wrote: Fri Jul 22, 2022 7:28 am Actually my build.bat file is as below:

Code: Select all

mingw32-make -fmakefile WX_SHARED=0 WX_DEBUG=0 WX_VERSION=32 WX_MONOLITHIC=1 WX_DIR=E:\Learning\lovedev\sdk\wx32 SHARED=0  
Did you build wxWidgets really with the very same options as you try to build wxSQLite3?
samsam598 wrote: Fri Jul 22, 2022 7:28 am Path already have below :
E:\Learning\LoveDev\SDK\wx32\include
E:\Learning\LoveDev\SDK\wx32\lib\gcc_lib\mswu
Did you check that

E:\Learning\LoveDev\SDK\wx32\lib\gcc_lib\mswu\wx\setup.h

really exists?

If yes, you have to make sure that the include paths for C++ header files is set up correctly by inspecting your makefile.
samsam598 wrote: Fri Jul 22, 2022 7:28 am I have no idea why the compiler complains it can not find "wx/setup.h"

or, is there anything else that I made wrong?
Again, the compiler only complains about a missing "wx/setup.h" file, if either the include paths for the compiler are not set up correctly, or if the matching wxWidgets build does not exist.
samsam598
Super wx Problem Solver
Super wx Problem Solver
Posts: 340
Joined: Mon Oct 06, 2008 12:55 pm

Re: Need help after failed to build wxSqlite4.8.2+wx3.2 Monolithic with MinGW8.1 under Win10

Post by samsam598 »

Thanks a lot, utelle.

Here below is the wx32 build command:
\bin\mingw32-make -f makefile.gcc BUILD=release SHARED=0 MONOLITHIC=1 UNICODE=1 2>errlog.txt

Yes,E:\Learning\LoveDev\SDK\wx32\lib\gcc_lib\mswu\wx\setup.h exists.Everytime before build wx,I modifiied the setup.h file located in ..include\wx\msw\. I guess \lib\gcc_lib\mswu\wx\setup.h is copied from there? Anyway,I double checked.

the gcc makefile is from the folder ..\build,and I did not modified it.--->Should I modify this file?

I encountered the same issue when I tried to build wxpdfdoc,"wx/setup.h" missing...

Maybe I'd better to rebuild wx32 and try again.

Regards,
Sam
Regards,
Sam
-------------------------------------------------------------------
Windows 10 64bit
VS Community 2019
msys2-mingw13.2.0 C::B character set: UTF-8/GBK(Chinese)
wxWidgets 3.3/3.2.4 Unicode Mono Static gcc static build
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Need help after failed to build wxSqlite4.8.2+wx3.2 Monolithic with MinGW8.1 under Win10

Post by utelle »

samsam598 wrote: Fri Jul 22, 2022 9:23 am Here below is the wx32 build command:
\bin\mingw32-make -f makefile.gcc BUILD=release SHARED=0 MONOLITHIC=1 UNICODE=1 2>errlog.txt
AFAICT this seems to be ok.
samsam598 wrote: Fri Jul 22, 2022 9:23 am Yes,E:\Learning\LoveDev\SDK\wx32\lib\gcc_lib\mswu\wx\setup.h exists.Everytime before build wx,I modifiied the setup.h file located in ..include\wx\msw\. I guess \lib\gcc_lib\mswu\wx\setup.h is copied from there? Anyway,I double checked.
Ok, then the include paths for the compiler are most likely not correct.
samsam598 wrote: Fri Jul 22, 2022 9:23 am the gcc makefile is from the folder ..\build,and I did not modified it.--->Should I modify this file?
No, usually it is not necessary to modify the makefile itself.
samsam598 wrote: Fri Jul 22, 2022 9:23 am I encountered the same issue when I tried to build wxpdfdoc,"wx/setup.h" missing...
wxSQLite3 and wxPdfDocument both have a file config.gcc in the build directory. This file has to be adapted to your environment.
samsam598
Super wx Problem Solver
Super wx Problem Solver
Posts: 340
Joined: Mon Oct 06, 2008 12:55 pm

Re: Need help after failed to build wxSqlite4.8.2+wx3.2 Monolithic with MinGW8.1 under Win10

Post by samsam598 »

I tried several versions of mingw(gcc) but none can build successfully,several years ago I built wxSqlite3.1.1 with mingw4.8 successfully and that's my current working version.
With msys2-mingw12.2.0,it seems the lib(mono,both debug and release lib )built ,but minimal and treeview sample still failed to build with the same error information.When I tried to build the minimal in CodeBlocks by add minimal.c into the project(only this one source file) ,exe was generated,but when trying to run,the ide seems hang and also the minimal.exe just hang.
Below is the batch build command to build wxWidgets3.3 (github download) :

Code: Select all

REM This batch file is a part of PB’s Guide to Starting with wxWidgets on Microsoft Windows with MinGW and Code::Blocks 

set PATH=C:\msys64\mingw64\bin;%PATH%

cd /d %WXWIN%\build\MSW


REM Build wxWidgets Static Debug configuration with C++17 support and GCC libraries linked statically
mingw32-make -f makefile.gcc MONOLITHIC=1 SHARED=0 BUILD=debug CXXFLAGS="-std=c++17" LDFLAGS="-static" SHELL=cmd.exe
IF %ERRORLEVEL% NEQ 0 goto FAIL

REM Build wxWidgets Static Release configuration with C++17 support and GCC libraries linked statically
mingw32-make -f makefile.gcc MONOLITHIC=1 SHARED=0 BUILD=release CXXFLAGS="-std=c++17" LDFLAGS="-static" SHELL=cmd.exe
IF %ERRORLEVEL% NEQ 0 goto FAIL


goto SUCCESS

:FAIL
echo Build failed, see above why.
pause
goto FINISHED

:SUCCESS
echo Build wxWidget 3.3 mono static library successfuly.
:FINISHED
echo press any key to continue...
I noticed in wxsqlite-mono.make file,there is a -L/usr/lib64 ,but msys2,mingw32/64 does not have a usr/lib32|lib64 subdirectory.Does this matter?

Code: Select all

else ifeq ($(config),debug_win64)
TARGETDIR = ../lib/gcc_x64_lib
TARGET = $(TARGETDIR)/libwxsqlite3$(wxFlavour)d.a
OBJDIR = obj/gcc/Win64/Debug/wxsqlite3
DEFINES += -D_WINDOWS -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DDEBUG -D_DEBUG -DWXSQLITE3_DLLNAME=wxs[size=150]ql[/size]ite3$(wxSuffixDebug) -D_LIB -DWXMAKINGLIB_WXSQLITE3 -D_UNICODE -D__WXDEBUG__ -D__WXMSW__ -DCODEC_TYPE=$(CODEC_TYPE) -DSQLITE_ENABLE_DEBUG=$(SQLITE_ENABLE_DEBUG) -DSQLITE_THREADSAFE=1 -DSQLITE_DQS=0 -DSQLITE_MAX_ATTACHED=10 -DSQLITE_ENABLE_EXPLAIN_COMMENTS=1 -DSQLITE_SOUNDEX=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_SECURE_DELETE=1 -DSQLITE_ENABLE_DESERIALIZE=1 -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_FTS3_PARENTHESIS=1 -DSQLITE_ENABLE_FTS4=1 -DSQLITE_ENABLE_FTS5=1 -DSQLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_GEOPOLY=1 -DSQLITE_CORE=1 -DSQLITE_ENABLE_EXTFUNC=1 -DSQLITE_ENABLE_MATH_FUNCTIONS=1 -DSQLITE_ENABLE_CSV=1 -DSQLITE_ENABLE_VSV=1 -DSQLITE_ENABLE_SHA3=1 -DSQLITE_ENABLE_CARRAY=1 -DSQLITE_ENABLE_FILEIO=1 -DSQLITE_ENABLE_SERIES=1 -DSQLITE_ENABLE_UUID=1 -DSQLITE_ENABLE_REGEXP=1 -DSQLITE_TEMP_STORE=2 -DSQLITE_USE_URI=1 -DSQLITE_USER_AUTHENTICATION=1
INCLUDES += -I"$(wxRootDir)/lib/$(wxCompilerPrefix)$(wxArchSuffix)_lib/msw$(wxSuffix)" -I"$(wxRootDir)/include" -I../include -I../src
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g -msse4.2 -maes
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g -msse4.2 -maes
LIBS += -l$(wxMonolithicLibName) -lwxjpeg$(wxSuffixDebug) -lwxpng$(wxSuffixDebug) -lwxzlib$(wxSuffixDebug) -lwxtiff$(wxSuffixDebug) -lwxexpat$(wxSuffixDebug) -lwxregex$(wxSuffix) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lwsock32 -lwininet -loleacc -luxtheme
ALL_LDFLAGS += $(LDFLAGS) -L"$(wxRootDir)/lib/$(wxCompilerPrefix)$(wxArchSuffix)_lib" [size=150][b]-L/usr/lib64 -m64[/b][/size]

my wxsqlite-mono-static-debug-win64.make:

Code: Select all

...
ifndef config
  config=debug_win64
endif
...
My batch file to build wxsqlite3 mono-static gcc static link:

Code: Select all

REM This batch file is a part of PB’s Guide to Starting with wxWidgets on Microsoft Windows with MinGW and Code::Blocks 

set PATH=C:\msys64\mingw64\bin;%PATH%

rem cd /d %WXWIN%\build\MSW


REM Build wxWidgets Static Debug configuration with C++17 support and GCC libraries linked statically
mingw32-make -f wxsqlite3_mono_debug_win64.make MONOLITHIC=1 SHARED=0 BUILD=debug CXXFLAGS="-std=c++17" LDFLAGS="-static" SHELL=cmd.exe
IF %ERRORLEVEL% NEQ 0 goto FAIL

REM Build wxWidgets Static Release configuration with C++17 support and GCC libraries linked statically
rem mingw32-make -f wxsqlite3_mono_release_win64.make MONOLITHIC=1 SHARED=0 BUILD=release  CXXFLAGS="-std=c++17" LDFLAGS="-static" SHELL=cmd.exe
rem IF %ERRORLEVEL% NEQ 0 goto FAIL


goto SUCCESS

:FAIL
echo Build failed, see above why.
pause
goto FINISHED

:SUCCESS
echo Build wxSqlite3484 static library successfuly.
:FINISHED
echo press any key to continue...
With mingw4.8.1+wxSqlite3.1.1(btw wxSqlite3.1.1 is very very easy to build) I can write simple code for learning,it is clean,very easy to understand.I really really want to upgrade to the most recent version(I noticed there is again a update yesterday,wow!) to work together with wx3.3 under mingw12.2.0 (which support gcc/g++ 2a )so that I can just keep wx3.3+mingw12.2.0 one version as my workshop but failed and failed.

I am eager to seeking help to solve the issue.Much much appreciated.

Best Regards,
Sam
Regards,
Sam
-------------------------------------------------------------------
Windows 10 64bit
VS Community 2019
msys2-mingw13.2.0 C::B character set: UTF-8/GBK(Chinese)
wxWidgets 3.3/3.2.4 Unicode Mono Static gcc static build
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Need help after failed to build wxSqlite4.8.2+wx3.2 Monolithic with MinGW8.1 under Win10

Post by utelle »

samsam598 wrote: Fri Sep 09, 2022 6:00 am I tried several versions of mingw(gcc) but none can build successfully,several years ago I built wxSqlite3.1.1 with mingw4.8 successfully and that's my current working version.
Before making a new wxSQLite3 release, I regularly build wxSQLite3 for testing purposes with different mingw versions, and usually the builds succeed flawlessly. That is, current wxQLite3 versions can be build successfully with current mingw versions.

wxSQLite3 3.1.1 was released in 2014 and is really outdated.
samsam598 wrote: Fri Sep 09, 2022 6:00 am With msys2-mingw12.2.0,it seems the lib(mono,both debug and release lib )built ,but minimal and treeview sample still failed to build with the same error information.
Personally, I never used the monolithic build of wxWidgets. However, there is nothing extraordinary linking wxSQLite3 against the monolithic wxWidgets library. Which errors do you get on building the samples?
samsam598 wrote: Fri Sep 09, 2022 6:00 am When I tried to build the minimal in CodeBlocks by add minimal.c into the project(only this one source file) ,exe was generated,but when trying to run,the ide seems hang and also the minimal.exe just hang.
I suspect that you have some kind of mixup of your environment. For example, a mismatching DLL could be loaded due to a wrongly set up PATH environment variable. Mixing 32-bit and 64-bit builds also can result in desaster.

Can you build your own applications (not using wxSQLite3) without problems?
samsam598 wrote: Fri Sep 09, 2022 6:00 am Below is the batch build command to build wxWidgets3.3 (github download) : [...]

I noticed in wxsqlite-mono.make file,there is a -L/usr/lib64 ,but msys2,mingw32/64 does not have a usr/lib32|lib64 subdirectory.Does this matter?
These library search paths are used in all makefiles, not only the monolithic ones. They are added by the tool premake5 that is used for generating the makefiles. If the corresponding directories do not exist, the presence of these symbols does no harm.
samsam598 wrote: Fri Sep 09, 2022 6:00 am With mingw4.8.1+wxSqlite3.1.1(btw wxSqlite3.1.1 is very very easy to build) I can write simple code for learning,it is clean,very easy to understand.I really really want to upgrade to the most recent version(I noticed there is again a update yesterday,wow!)
Usually new wxSQLite3 releases are made shortly after the release of a new SQLite version - actually over 60 releases since version 3.1.1 was released.
samsam598 wrote: Fri Sep 09, 2022 6:00 am to work together with wx3.3 under mingw12.2.0 (which support gcc/g++ 2a )so that I can just keep wx3.3+mingw12.2.0 one version as my workshop but failed and failed.
Again, wxSQLite3 can be build without problems with recent mingw versions. If you experience problems, most likely your development environment is not set up properly. First, you should check whether you can build (and run) successfully your own (test) applications - not using wxSQLite3. Second, you should check whether you can build wxSQLite3 and its samples with the build files coming with wxSQLite3 (you will have to adjust the file config.gcc to match your environment).

Regards,
Ulrich
samsam598
Super wx Problem Solver
Super wx Problem Solver
Posts: 340
Joined: Mon Oct 06, 2008 12:55 pm

Re: Need help after failed to build wxSqlite4.8.2+wx3.2 Monolithic with MinGW8.1 under Win10

Post by samsam598 »

Thank you so much!
Personally, I never used the monolithic build of wxWidgets. However, there is nothing extraordinary linking wxSQLite3 against the monolithic wxWidgets library. Which errors do you get on building the samples?
Somthing like 'recipe for minimal.exe failed'
Can you build your own applications (not using wxSQLite3) without problems?
Yes,I tried to build wx/sample/minimal,sample/opengl entired sub folder examples just by run the same batch file which build wx3.3 as mentioned above; to check C::B setting up with wx3.3,I test in the IDE again with minimal example,and other execises I made ,pure c++ stl console execise+wxlib linked in(No GUI);run wxMessageBoxs in a console execise to check wxPrintf output Chinese character issue;and also ,of course,running the wizard to create wxFrame based /Dialog based GUI application with wxSimth and also with wxFormBuilder.Everthing is OK.
I suspect that you have some kind of mixup of your environment. For example, a mismatching DLL could be loaded due to a wrongly set up PATH environment variable. Mixing 32-bit and 64-bit builds also can result in desaster.
To run below build test,I moved wx3--release libs to another place and just leave the debug version there for below----

2 hour ago I downloaded wxSqlite3.4.9.0 from github(https://github.com/utelle/wxsqlite3),double checked system environment path,%WXWIN%,msys2-MingW64\bin path,make sure there is only this one compiler 'visible' and then try to build wxSqlite3490.This time it is so weird the compiler just complaints can not find wx/setup.h.To compare,I retried with wxSqlite3482,same error:can not find wx/setup.h.

Code: Select all

E:\Learning\CodeBlocks\sdk\wxsqlite3482\build>mingw32-make -f makefile MONOLITHIC=1 SHARED=0 BUILD=debug CXXFLAGS="-std=c++17" LDFLAGS="-static" SHELL=cmd.exe
"==== Building wxsqlite3 (debug_win64) ===="
Creating obj/gcc/Win64/Debug/wxsqlite3
wxsqlite3_version.rc
sqlite3mc_amalgamation.c
wxsqlite3.cpp
In file included from E:\Learning\CodeBlocks\sdk\wx3/include/wx/defs.h:45,
                 from E:\Learning\CodeBlocks\sdk\wx3/include/wx/wxprec.h:12,
                 from ../src/wxsqlite3.cpp:17:
E:\Learning\CodeBlocks\sdk\wx3/include/wx/platform.h:159:10: fatal error: wx/setup.h: No such file or directory
  159 | #include "wx/setup.h"
      |          ^~~~~~~~~~~~
compilation terminated.
mingw32-make[1]: *** [wxsqlite3_mono.make:267: obj/gcc/Win64/Debug/wxsqlite3/wxsqlite3.o] Error 1
mingw32-make: *** [makefile:86: wxsqlite3] Error 2
Below is some basic information/configuration related to the Mingw|wx:
WXWIN:E:\Learning\CodeBlocks\sdk\wx3
PATH:E:\Learning\CodeBlocks\msys64\mingw64\bin;E:\Learning\CodeBlocks\sdk\wx3\include;E:\Learning\CodeBlocks\sdk\wx3\lib\gcc_lib\mswud;
build wxsqlite batch file:

Code: Select all

set PATH=E:\Learning\CodeBlocks\msys64\mingw64\bin;E:\Learning\CodeBlocks\sdk\wx3\include;E:\Learning\CodeBlocks\sdk\wx3\lib\gcc_lib\mswud;%PATH%

rem cd /d %WXWIN%\build\MSW


REM Build wxWidgets Static Debug configuration with C++17 support and GCC libraries linked statically
mingw32-make -f wxsqlite3_mono_debug_win64.make MONOLITHIC=1 SHARED=0 BUILD=debug CXXFLAGS="-std=c++17" LDFLAGS="-static" SHELL=cmd.exe
wxsqlite3_mono_debug_win64.make:
<code>
...
ifndef config
config=debug_win64
endif
...
</code>
Attachments
0910-3.png
0910-3.png (12.82 KiB) Viewed 14759 times
0910-2.png
0910-2.png (4.74 KiB) Viewed 14759 times
0910.png
0910.png (49 KiB) Viewed 14759 times
Regards,
Sam
-------------------------------------------------------------------
Windows 10 64bit
VS Community 2019
msys2-mingw13.2.0 C::B character set: UTF-8/GBK(Chinese)
wxWidgets 3.3/3.2.4 Unicode Mono Static gcc static build
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Need help after failed to build wxSqlite4.8.2+wx3.2 Monolithic with MinGW8.1 under Win10

Post by utelle »

samsam598 wrote: Sat Sep 10, 2022 1:01 am
Which errors do you get on building the samples?
Somthing like 'recipe for minimal.exe failed'
Well, "something failed" does not really help to identify the cause of the probelms. There must be a more specific error message. You could invoke make with a switch to enable verbose output. That could possibly help to find the cause.
samsam598 wrote: Sat Sep 10, 2022 1:01 am
Can you build your own applications (not using wxSQLite3) without problems?
Yes,I tried to build wx/sample/minimal,sample/opengl entired sub folder examples just by run the same batch file which build wx3.3 as mentioned above;
It's certainly a good first step to be able to compile and run the samples coming with wxWidgets. However, I meant to ask whether you can set up, compile and run your own test application successfully.
samsam598 wrote: Sat Sep 10, 2022 1:01 am to check C::B setting up with wx3.3,I test in the IDE again with minimal example,and other execises I made ,pure c++ stl console execise+wxlib linked in(No GUI);run wxMessageBoxs in a console execise to check wxPrintf output Chinese character issue;and also ,of course,running the wizard to create wxFrame based /Dialog based GUI application with wxSimth and also with wxFormBuilder.Everthing is OK.
I don't use C::B myself, so I can't help with setting up wx projects in C::B. However, you seem to have managed to do that, if all the mentioned samples work.

If building and running wxSQLite3 does not work for you, there must be a subtle difference. Usually adjusting the configuration file "config.gcc" should be enough to get things up and running.
samsam598 wrote: Sat Sep 10, 2022 1:01 am To run below build test,I moved wx3--release libs to another place and just leave the debug version there for below----
wx's debug and release libs are usually located in the same directory and are distinguished by a "d" appended to the lib name. That is, it should not be necessary to move the lib files around.
samsam598 wrote: Sat Sep 10, 2022 1:01 am 2 hour ago I downloaded wxSqlite3.4.9.0 from github(https://github.com/utelle/wxsqlite3),double checked system environment path,%WXWIN%,msys2-MingW64\bin path,make sure there is only this one compiler 'visible' and then try to build wxSqlite3490.This time it is so weird the compiler just complaints can not find wx/setup.h.To compare,I retried with wxSqlite3482,same error:can not find wx/setup.h.
This indicates that either the wx library path is not set up correctly, or that wx was not built for the selected configuration.

For example, the build files coming with wxSQLite3 assume that the library path for a 64-bit build contains the architecture suffix "_x64". However, the default build files coming with wxWidgets do not set this suffix automatically. This is normally not a problem for users that only build for a single architecture (32- or 64-bit, but not both). Looking at the screenshot of the directory structure, I see that the library path is "gcc_lib", although you built for 64-bit. So, you need to adjust wxSQLite3's "config.gcc" to not use the architecture suffix for 64-bit builds. You could try the following:

Change in file "config.gcc" all lines with

Code: Select all

wxArchSuffix = _x64
to

Code: Select all

wxArchSuffix = _x64
If you are lucky, this will already do the trick.
samsam598 wrote: Sat Sep 10, 2022 1:01 am Below is some basic information/configuration related to the Mingw|wx:

Code: Select all

WXWIN:E:\Learning\CodeBlocks\sdk\wx3
PATH:E:\Learning\CodeBlocks\msys64\mingw64\bin;E:\Learning\CodeBlocks\sdk\wx3\include;E:\Learning\CodeBlocks\sdk\wx3\lib\gcc_lib\mswud;
The PATH environment variable looks a bit strange. The PATH environment variable should list directories which contain executables or DLLs. However, you added directories which contain include files.

IMHO the directory "E:\Learning\CodeBlocks\sdk\wx3\include" should be dropped from PATH. And directory

"E:\Learning\CodeBlocks\sdk\wx3\lib\gcc_lib\mswud"

should be changed to

"E:\Learning\CodeBlocks\sdk\wx3\lib\gcc_lib",

because libs and DLLs are located there. The subdirectories "mswu" resp "mswud" contain include files for the compiler describing the selected configuration ("setup.h").
samsam598 wrote: Sat Sep 10, 2022 1:01 am build wxsqlite batch file:

Code: Select all

set PATH=E:\Learning\CodeBlocks\msys64\mingw64\bin;E:\Learning\CodeBlocks\sdk\wx3\include;E:\Learning\CodeBlocks\sdk\wx3\lib\gcc_lib\mswud;%PATH%
REM Build wxWidgets Static Debug configuration with C++17 support and GCC libraries linked statically
mingw32-make -f wxsqlite3_mono_debug_win64.make MONOLITHIC=1 SHARED=0 BUILD=debug CXXFLAGS="-std=c++17" LDFLAGS="-static" SHELL=cmd.exe
Again, you need to adjust the PATH environment variable as described above.

Regrads,
Ulrich
samsam598
Super wx Problem Solver
Super wx Problem Solver
Posts: 340
Joined: Mon Oct 06, 2008 12:55 pm

Re: Need help after failed to build wxSqlite4.8.2+wx3.2 Monolithic with MinGW8.1 under Win10

Post by samsam598 »

Really appreciated for the great help! Built successfully!
And also I do apologize for the trouble made to you because my knowing nothing about gcc/makefile.
This indicates that either the wx library path is not set up correctly, or that wx was not built for the selected configuration.

For example, the build files coming with wxSQLite3 assume that the library path for a 64-bit build contains the architecture suffix "_x64". However, the default build files coming with wxWidgets do not set this suffix automatically. This is normally not a problem for users that only build for a single architecture (32- or 64-bit, but not both). Looking at the screenshot of the directory structure, I see that the library path is "gcc_lib", although you built for 64-bit. So, you need to adjust wxSQLite3's "config.gcc" to not use the architecture suffix for 64-bit builds. You could try the following:

Change in file "config.gcc" all lines with
CODE: SELECT ALL

wxArchSuffix = _x64
After Search & replace all x_64 to blank,
wxArchSuffix =
relocate wx release libs to their original place ,run build batch file,the build process is very smooth and in a couple of minutes build successfully.Both mono debug_win64,mono release_win64,and minimal,treeview samples.

Personally, I never used the monolithic build of wxWidgets.
Yes I knew buiding monolithic libraries seems a bit stupid.I learnt that libs link order matters to gcc and I do encountered the issue several times during the past.To reduce the re-ordering files numbers I have to manage when I encounter again,the less files I managed to cope with the better.Why static then?Just want to see the portability(Double click the application located in any folder and it runs. Meanwhile,no DLLs have to copy and transfer from one pc to another pc).Sorry again.

Getting back to the result.I run the minimal & treeview,both got a assertion faiure at the end.Should I try to fix this issue or just leave it?

Today is Mid-Autumn Day ,I wish everybody every family healthy and happy together!!!

Sam
Attachments
0910-6.png
0910-6.png (9.8 KiB) Viewed 14733 times
0910-5.png
0910-5.png (23.73 KiB) Viewed 14738 times
0910-4.png
0910-4.png (29.73 KiB) Viewed 14738 times
Regards,
Sam
-------------------------------------------------------------------
Windows 10 64bit
VS Community 2019
msys2-mingw13.2.0 C::B character set: UTF-8/GBK(Chinese)
wxWidgets 3.3/3.2.4 Unicode Mono Static gcc static build
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Need help after failed to build wxSqlite4.8.2+wx3.2 Monolithic with MinGW8.1 under Win10

Post by utelle »

samsam598 wrote: Sat Sep 10, 2022 11:05 am Really appreciated for the great help! Built successfully!
Glad to hear that!
samsam598 wrote: Sat Sep 10, 2022 11:05 am And also I do apologize for the trouble made to you because my knowing nothing about gcc/makefile.
Well, you are in good company. I use mainly Visual C++, and my knowledge about gcc/mingw is also limited.
samsam598 wrote: Sat Sep 10, 2022 11:05 am
Personally, I never used the monolithic build of wxWidgets.
Yes I knew buiding monolithic libraries seems a bit stupid.
I wouldn't call it stupid, it's simply less common. Especially on Linux platforms almost always shared wx multilib libraries are used.
samsam598 wrote: Sat Sep 10, 2022 11:05 am I learnt that libs link order matters to gcc and I do encountered the issue several times during the past.
It is indeed often cumbersome that the order of link libraries matters for the gcc linker. With Visual C++ it's different: link libraries can be specified in any order.
samsam598 wrote: Sat Sep 10, 2022 11:05 am Getting back to the result.I run the minimal & treeview,both got a assertion faiure at the end.Should I try to fix this issue or just leave it?
I have absolutely no idea how this can happen, because in case (1) [minimal] the function sqlite3_rekey that is used internally explicitly enters the mutex for which the assertion failed. In case (2) it is even more difficult to tell what's going on. All I can say is that these assertions should not fail.

Since I didn't experience such assertion failures during my own tests, it is very difficult to tell, why they are occurring in your environment.
samsam598 wrote: Sat Sep 10, 2022 11:05 am Today is Mid-Autumn Day ,I wish everybody every family healthy and happy together!!!
Thanks. The same for you.

Regards,
Ulrich
Post Reply