Author Topic: Codeblocks wxwidgets + sqlite  (Read 11478 times)

Offline woser

  • Multiple posting newcomer
  • *
  • Posts: 13
Codeblocks wxwidgets + sqlite
« on: January 25, 2012, 10:13:14 pm »
Hi, I've build wxwidgets static library (2.8.12) and works ok, and now I compile sqlite, and I try sqlcipher too, Everyone works ok when I use console project but when I create Project of wxwidgets application and when I connect library sqlite to codeblocks, program don't run, can anybody help me, everyone library was compiled static ?

compiled example :  http://dl.dropbox.com/u/26886994/Release.zip

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6636
    • My Best Post
Re: Codeblocks wxwidgets + sqlite
« Reply #1 on: January 25, 2012, 10:17:38 pm »
I suggest reading all the FAQs
http://wiki.codeblocks.org/index.php?title=FAQ

Then either post a Code::Blocks/wxSmith question; or, then on Full Compiler logging and post your question in the wxForum. http://forums.wxwidgets.org/

http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline woser

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Codeblocks wxwidgets + sqlite
« Reply #2 on: January 25, 2012, 10:42:36 pm »
Code: [Select]
-------------- Clean: Release in wx_test4 ---------------

Cleaned "wx_test4 - Release"

-------------- Build: Release in wx_test4 ---------------

mingw32-g++.exe -Wall -pipe -Wno-attributes -Winvalid-pch -include wx_pch.h -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -DWX_PRECOMP  -O2    -IC:\wxWidgets-2.8.12\include -IC:\wxWidgets-2.8.12\contrib\include -IC:\wxWidgets-2.8.12\lib\gcc_lib\mswu  -c C:\MY_PROJECT\wx_test4\wx_pch.h -o wx_pch.h.gch\Release_wx_pch_h_gch
cc1plus.exe: warning: C:\MY_PROJECT\wx_test4\wx_pch.h.gch/Debug_wx_pch_h_gch: created and used with differing settings of '-maccumulate-outgoing-args'
cc1plus.exe: warning: ./wx_pch.h.gch/Debug_wx_pch_h_gch: created and used with differing settings of '-mthreads'
mingw32-g++.exe -Wall -pipe -Wno-attributes -Winvalid-pch -include wx_pch.h -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -DWX_PRECOMP  -O2    -IC:\wxWidgets-2.8.12\include -IC:\wxWidgets-2.8.12\contrib\include -IC:\wxWidgets-2.8.12\lib\gcc_lib\mswu  -c C:\MY_PROJECT\wx_test4\wx_test4App.cpp -o obj\Release\wx_test4App.o
cc1plus.exe: warning: ./wx_pch.h.gch/Debug_wx_pch_h_gch: created and used with differing settings of '-mthreads'
windres.exe -IC:\wxWidgets-2.8.12\include -IC:\wxWidgets-2.8.12\lib\gcc_lib\mswu  -J rc -O coff -i C:\MY_PRO~1\wx_test4\resource.rc -o obj\Release\resource.res
mingw32-g++.exe -Wall -pipe -Wno-attributes -Winvalid-pch -include wx_pch.h -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -DWX_PRECOMP  -O2    -IC:\wxWidgets-2.8.12\include -IC:\wxWidgets-2.8.12\contrib\include -IC:\wxWidgets-2.8.12\lib\gcc_lib\mswu  -c C:\MY_PROJECT\wx_test4\wx_test4Main.cpp -o obj\Release\wx_test4Main.o
cc1plus.exe: warning: ./wx_pch.h.gch/Debug_wx_pch_h_gch: created and used with differing settings of '-mthreads'
mingw32-g++.exe -LC:\wxWidgets-2.8.12\lib\gcc_lib  -o bin\Release\wx_test4.exe obj\Release\wx_test4App.o obj\Release\wx_test4Main.o  obj\Release\resource.res  -s -static-libgcc  -lwxmsw28u_aui -lwxmsw28u_media -lwxbase28u_net -lwxbase28u_xml -lwxmsw28u_adv -lwxmsw28u_html -lwxmsw28u_core -lwxbase28u -lwxpng -lwxjpeg -lwxtiff -lwxzlib -lwxregexu -lwxexpat -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 ..\SQLCIPHER\libSQLCIPHER.a ..\SQLCIPHER\lib\libeay32.dll.a  -mwindows
Output size is 2,93 MB
Process terminated with status 0 (0 minutes, 13 seconds)
0 errors, 4 warnings (0 minutes, 13 seconds)
 


Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: Codeblocks wxwidgets + sqlite
« Reply #3 on: January 26, 2012, 11:33:52 am »
Code: [Select]
Output size is 2,93 MB
Process terminated with status 0 (0 minutes, 13 seconds)
0 errors, 4 warnings (0 minutes, 13 seconds)
This indicates an executable was definitely created. What is your problem?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline woser

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Codeblocks wxwidgets + sqlite
« Reply #4 on: January 26, 2012, 04:29:24 pm »
Exe start but immediately end.... nothing show on the screen

I've tried almost everything, when I try to debug it is nothing happen, even when I create breakpoints on, app init, Library of sqlite works ok when I create console program, but when I use wxwidgets program run, and end immiadiately, but when I try a debug program stay and nothing happen.

Build log for debug:

Code: [Select]

mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wno-attributes -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -Wall  -g -D__WXDEBUG__    -IC:\wxWidgets-2.8.12\include -IC:\wxWidgets-2.8.12\contrib\include -IC:\wxWidgets-2.8.12\lib\gcc_lib\mswud  -c C:\MY_PROJECT\wx_test4\wx_pch.h -o wx_pch.h.gch\Debug_wx_pch_h_gch
cc1plus.exe: warning: C:\MY_PROJECT\wx_test4\wx_pch.h.gch/Release_wx_pch_h_gch: created with -gnone, but used with -gdwarf-2
cc1plus.exe: warning: ./wx_pch.h.gch/Release_wx_pch_h_gch: created with -gnone, but used with -gdwarf-2
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wno-attributes -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -Wall  -g -D__WXDEBUG__    -IC:\wxWidgets-2.8.12\include -IC:\wxWidgets-2.8.12\contrib\include -IC:\wxWidgets-2.8.12\lib\gcc_lib\mswud  -c C:\MY_PROJECT\wx_test4\wx_test4App.cpp -o obj\Debug\wx_test4App.o
windres.exe -IC:\wxWidgets-2.8.12\include -IC:\wxWidgets-2.8.12\lib\gcc_lib\mswud  -J rc -O coff -i C:\MY_PRO~1\wx_test4\resource.rc -o obj\Debug\resource.res
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wno-attributes -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -Wall  -g -D__WXDEBUG__    -IC:\wxWidgets-2.8.12\include -IC:\wxWidgets-2.8.12\contrib\include -IC:\wxWidgets-2.8.12\lib\gcc_lib\mswud  -c C:\MY_PROJECT\wx_test4\wx_test4Main.cpp -o obj\Debug\wx_test4Main.o
mingw32-g++.exe -LC:\wxWidgets-2.8.12\lib\gcc_lib  -o bin\Debug\wx_test4.exe obj\Debug\wx_test4App.o obj\Debug\wx_test4Main.o  obj\Debug\resource.res  -mthreads  -lwxmsw28ud_aui -lwxmsw28ud_media -lwxbase28ud_net -lwxbase28ud_xml -lwxmsw28ud_adv -lwxmsw28ud_html -lwxmsw28ud_core -lwxbase28ud -lwxpngd -lwxjpegd -lwxtiffd -lwxzlibd -lwxregexud -lwxexpatd -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32  -mwindows
Output size is 30,78 MB
Process terminated with status 0 (0 minutes, 37 seconds)
0 errors, 2 warnings (0 minutes, 37 seconds)

Screenshot:


ZIP file with compiled library and source, and sample program which cannot work, everything prepared for code:blocks :

http://dl.dropbox.com/u/26886994/MY_PROJECT.ZIP (32mb)


Everything working when I compile it for visual studio 2010 compiler, and compile the same code.... But i need MinGW
« Last Edit: January 26, 2012, 04:34:20 pm by woser »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6636
    • My Best Post
Re: Codeblocks wxwidgets + sqlite
« Reply #5 on: January 26, 2012, 06:21:08 pm »
I almost never use debug with Code::Blocks, so I can not help you there.

I am guessing you are doing it right; but, you might read this link to confirm.
http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks

Did you try the default wxWidgets app (via wizard) to confirm everything is set up right to run wxWidgets apps?
Did you try to debug a simple "hello world" app to confirm you debugger is set up right?

Tim S.

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline woser

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Codeblocks wxwidgets + sqlite
« Reply #6 on: January 26, 2012, 10:25:31 pm »
Yes defualt app of wxwidgets works OK, but when I add library of sqlite to the linker defualt app destroy, but in the console program of C++ when I add my library everything is ok  :/

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6636
    • My Best Post
Re: Codeblocks wxwidgets + sqlite
« Reply #7 on: January 26, 2012, 11:40:39 pm »
Code: [Select]
..\SQLCIPHER\libSQLCIPHER.a ..\SQLCIPHER\lib\libeay32.dll.a

The above implies you are not adding it the preferred way inside of Code::Blocks.
Note: The method you used works most of the time; but, maybe it is the problem.

Try doing it the "For your project :" way shown in below link.
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline woser

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Codeblocks wxwidgets + sqlite
« Reply #8 on: January 27, 2012, 08:58:23 pm »
I try it, and nothing better :( maybe someone will try everything what you need is this zip file to check it what is wrong with my sample project....

All my sources, and projects of code:blocks http://dl.dropbox.com/u/26886994/MY_PROJECT.ZIP (32mb)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6636
    • My Best Post
Re: Codeblocks wxwidgets + sqlite
« Reply #9 on: January 27, 2012, 09:10:06 pm »
You likely have a program logic bug; that is NOT on topic in this forum.
I suggest you find a programming site to post your source code on and ask for help.

Edit: Did you self compiler the SQLLite library?
The MinGW GCC exception style MUST match between your app and your C++ libraries (not sure on C libraries). Mixing SJLJ and Dwarf2 will not work most of the time.
NOTE: You are likely using an MinGW GCC having Dwarf2 style exception; this likely does NOT work with the SQLite library.

Tim S.
« Last Edit: January 27, 2012, 09:42:36 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6636
    • My Best Post
Re: Codeblocks wxwidgets + sqlite
« Reply #10 on: January 27, 2012, 09:57:40 pm »
I have to echo my prior advice because I think this is now a off topic issue.

then on Full Compiler logging and post your question in the wxForum. http://forums.wxwidgets.org/

http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

You might also try any MinGW GCC support forum or SQLite support forum.

Is there a reason you removed the code to close the program in your wx_test4 program?
I see no Code::Blocks related problem; but, I did have to edit your project a lot to get it to compile on my system. I attached the modified project file for wx_test4. Note: I used wxWidgets 2.8.11 instead of 2.8.12 but that is NOT likely a difference that matters. The fact I used an SJLJ MinGW GCC is the likely solution.

Tim S.
« Last Edit: January 27, 2012, 10:38:52 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline woser

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Codeblocks wxwidgets + sqlite
« Reply #11 on: January 28, 2012, 03:26:19 pm »
Quote from: stahta01

Is there a reason you removed the code to close the program in your wx_test4 program?
I see no Code::Blocks related problem; but, I did have to edit your project a lot to get it to compile on my system. I attached the modified project file for wx_test4. Note: I used wxWidgets 2.8.11 instead of 2.8.12 but that is NOT likely a difference that matters. The fact I used an SJLJ MinGW GCC is the likely solution.

Tim S.

Thank you for the response, I try you project but it is nothing to happen, maybe you Can try add only my sqlcipher library to the linker of any your project, and test that it is a correct library

Of course the close of program it is doesn't matter, I try to download new Mingw, I recompile everything but it is the same problem, I don't know where is the problem, What I do wrong ??
« Last Edit: January 28, 2012, 04:22:04 pm by woser »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6636
    • My Best Post
Re: Codeblocks wxwidgets + sqlite
« Reply #12 on: January 28, 2012, 05:18:44 pm »
You need to go somewhere else and ask for help or state a Code::Blocks issue.
This thread has gone way off topic for the Code::Blocks website.

Linking a library without calling its functions does NOTHING to stop it from running.
Either you get a linking error/warning or nothing changes; this likely means you failed to understand the compiler/linking issue. Which is NOT valid for this site.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline woser

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Codeblocks wxwidgets + sqlite
« Reply #13 on: January 28, 2012, 10:31:38 pm »
I know what was wrong  :o

When I compile sqlite I use two files sqlcipher.c and shell.c and it was a problem  that has a "main" which will conflict.

When I compile library with sqlcipher.c without shell everything works OK :):)