Author Topic: WxWidgets Setup Issue  (Read 8114 times)

Offline alen12345

  • Single posting newcomer
  • *
  • Posts: 7
WxWidgets Setup Issue
« on: August 15, 2012, 09:46:18 am »
I installed wxwidgets using the instalattion pack with the pre-compiled library and I don't seem to be able to mak it work.
After setting the global compiler variable, I had no problem creating the project but the application does not run. I'm trying to build a Frame Based application using wxSmith. Using wxWidgets DLL it compiles fine but crashes asking for mingw10.dll in debug mode when building and running pressing F9. Turning on the option to build as a monolithic library the compiler throws some errors due to some reference issues.
What's the problem? I installed WxWidgets using the Pack version 2.8, whereas, as fas as the coompiler is concerned, I'm using GCC 4.7.1.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: WxWidgets Setup Issue
« Reply #1 on: August 15, 2012, 10:00:11 am »
I installed WxWidgets using the Pack version 2.8, whereas, as fas as the coompiler is concerned, I'm using GCC 4.7.1.
Both compilers (the one used to build wx and the one you're using) must match. If they don't match you'll have endless problems.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline alen12345

  • Single posting newcomer
  • *
  • Posts: 7
Re: WxWidgets Setup Issue
« Reply #2 on: August 16, 2012, 10:18:46 am »
Compiled fine in dynamic mode, unfortunately all other options such as static or monolithic fail since codeblocks cannot find the right configuration, even if selected in the wizard. Should I edit some other files after the build to make it work?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: WxWidgets Setup Issue
« Reply #3 on: August 16, 2012, 10:47:31 am »
If you don't have the appropriate wx library, it can not work.
If you compile wxWidgets yourself, you can chose any options you need, if you use precompiled binaries you depend on the distributor.

Offline alen12345

  • Single posting newcomer
  • *
  • Posts: 7
Re: WxWidgets Setup Issue
« Reply #4 on: August 16, 2012, 01:37:13 pm »
I did not explain my issue properly. I compiled using the other options like for example MONOLITHIC=1 so I have the suitable libraries but codeblocks does not recognize them.

Like explained at this link: http://wiki.wxwidgets.org/WxWidgets_Build_Configurations


Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: WxWidgets Setup Issue
« Reply #5 on: August 16, 2012, 02:00:43 pm »
I did not explain my issue properly. I compiled using the other options like for example MONOLITHIC=1 so I have the suitable libraries but codeblocks does not recognize them.

Like explained at this link: http://wiki.wxwidgets.org/WxWidgets_Build_Configurations



In your first post, you wrote, that you use wxWidgets with pre-compiled library.
So now it's not clear for me, what you really use.

Could you please explain exactly what you did, what has failed and which errors you get.

Offline alen12345

  • Single posting newcomer
  • *
  • Posts: 7
Re: WxWidgets Setup Issue
« Reply #6 on: August 16, 2012, 03:19:34 pm »
Pre-compiled did not work for me, so I decided to build my own libraries as suggested in the first reply. I use GCC 4.7.1 and the build was pretty easy with no problems following also the tutorial found here: http://wiki.wxwidgets.org/Compiling_wxWidgets_with_MinGW

Everything perfect, just needed to copy and paste a couple of dlls in the release folder when trying to run the app outside the IDE.

If I try to build the libraries differently, with other options such as dynamic but monolithic, or static multi-lib, codeblocks reports an error when trying to create the project, saying that it cannot find a correct configuration in the folder provided. For example if I build the libraries with MONOLITHIC=1 and then select monolithic in the wizard codeblocks reports the error that I have just tried to explain. The libraries always build correctly with the options I want, but when codeblocks is instructed to use a different specification from Dll and unicode, it cannot find the right configuration.

Link for other flags:

http://wiki.wxwidgets.org/WxWidgets_Build_Configurations


Commands to build the libraries;

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

make -f makefile.gcc SHARED=0 UNICODE=1 BUILD=release

make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release

Only the last one works, unfortunately.

 Thank you for your interest.
« Last Edit: August 16, 2012, 03:26:45 pm by alen12345 »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: WxWidgets Setup Issue
« Reply #7 on: August 16, 2012, 03:40:50 pm »
Pre-compiled did not work for me, so I decided to build my own libraries as suggested in the first reply. I use GCC 4.7.1 and the build was pretty easy with no problems following also the tutorial found here: http://wiki.wxwidgets.org/Compiling_wxWidgets_with_MinGW

Everything perfect, just needed to copy and paste a couple of dlls in the release folder when trying to run the app outside the IDE.

If I try to build the libraries differently, with other options such as dynamic but monolithic, or static multi-lib, codeblocks reports an error when trying to create the project, saying that it cannot find a correct configuration in the folder provided. For example if I build the libraries with MONOLITHIC=1 and then select monolithic in the wizard codeblocks reports the error that I have just tried to explain. The libraries always build correctly with the options I want, but when codeblocks is instructed to use a different specification from Dll and unicode, it cannot find the right configuration.

Link for other flags:

http://wiki.wxwidgets.org/WxWidgets_Build_Configurations


Commands to build the libraries;

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

make -f makefile.gcc SHARED=0 UNICODE=1 BUILD=release

make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release

Only the last one works, unfortunately.

 Thank you for your interest.

I DO NOT have success building both MONOLITHIC and MultiLib in the same wxWidgets folders.
If you wish to do both you should have two different wxWidgets folders.

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

Offline alen12345

  • Single posting newcomer
  • *
  • Posts: 7
Re: WxWidgets Setup Issue
« Reply #8 on: August 16, 2012, 07:03:39 pm »
I already knew that! Every time I test new configurations I delete the old libraries, and start from scratch. And the problem always persists.

I try those commands separately, just one of them per build!

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: WxWidgets Setup Issue
« Reply #9 on: August 18, 2012, 04:05:38 am »
Are you cleaning the folders correctly?

Code
make -f makefile.gcc MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=release clean

make -f makefile.gcc SHARED=0 UNICODE=1 BUILD=release  clean

make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release  clean

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

Offline alen12345

  • Single posting newcomer
  • *
  • Posts: 7
Re: WxWidgets Setup Issue
« Reply #10 on: August 18, 2012, 09:16:15 am »
Absolutely! First clean,  then build. The commands are the ones listed above. Thank you for the interest.

Ale N.