Author Topic: Run wxwidgets project not working  (Read 3940 times)

Offline dtrill

  • Single posting newcomer
  • *
  • Posts: 6
Run wxwidgets project not working
« on: February 26, 2020, 09:31:20 pm »
I have installed wxWidgets as per the CodeBlocks Setup Guide.  I can create a new wxWidgets project and 'Build' it (with 0 errors and 187 warnings - all about deprecated features). However, when I 'Run' I get an error 'Entry Point Not Found' which says 'The procedure entry point_gxx_personality_v0 could not be located in the dynamic link library C:\wxWidgets-3.0.4\lib\gcc_dll\wxmsw30u_gcc_custom.dll'

I am using Windows 10 (32 bit), CodeBlocks 17.12, wxWidgets 3.0.4 and mingw32-g++ compiler.

I am only having this issue with wxWidget projects not console applications.

Thanks in advance for any help.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Run wxwidgets project not working
« Reply #1 on: February 26, 2020, 10:02:35 pm »
If I recall correctly "point_gxx_personality_v0" likely means you built the library and the project code with different compilers.

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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Run wxwidgets project not working
« Reply #2 on: February 26, 2020, 10:10:29 pm »
My memory was only partly right. Try copying the DLL suggested first and see if that fixes it.
https://stackoverflow.com/questions/18668003/the-procedure-entry-point-gxx-personality-v0-could-not-be-located

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 dtrill

  • Single posting newcomer
  • *
  • Posts: 6
Re: Run wxwidgets project not working
« Reply #3 on: February 27, 2020, 01:28:21 am »
Thank you for the quick response.
As you suggested, I copied the dll to the executable file location, but that did not fix the error.
I then tried to re-build the wxWidgets library (after using 'clean'), but my only option that I found was to use 'makefile.gcc' as there was no 'makefile.g++' in the 'C:\wxWidgets-3.0.4\build\msw' folder.
In CodeBlocks, I have been using the g++ compiler for C++ programs.
What am I missing?
How can I create the wxWidgets library using the correct C++ compiler?
I still have a lot to learn about the CodeBlocks & wxWidgets settings etc.
Thanks again for your help.


 

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Run wxwidgets project not working
« Reply #4 on: February 27, 2020, 01:41:59 am »
Please state the path to the Compiler used to build wxWidgets!
Code
where g++
Then, state the "Compiler Installation Directory" used inside of Code::Blocks!

Settings -> Compiler
In the pull-down, "Selected Compiler"
SELECT THE COMPILER BEING USED TO BUILD THE CB PROJECT!!!!!
Tab: "Toolchain Executable"
Report the value in "Compiler Installation Directory"


Tim S.
« Last Edit: February 27, 2020, 01:53:22 am by stahta01 »
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 dtrill

  • Single posting newcomer
  • *
  • Posts: 6
Re: Run wxwidgets project not working
« Reply #5 on: February 27, 2020, 04:28:48 am »
Here is some more info.
CodeBlocks global compiler settings
Selected compiler: GNU GCC Compiler
Compilers installation directory: C:\Program Files\CodeBlocks\MinGW
C compiler: mingw32-gcc.exe
C++ compiler: mingw32-g++.exe
Linker for dynamic libs: mingw32-g++.exe

Windows system environment path:
1st item on list: C:\Program Files\CodeBlocks\MinGW
2nd item on list: C:\MinGW
... more search paths

wxWidgets build library
mingw32-make.exe -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0
I am not sure how to find and/or set the compiler for the above command?
Please let me know if you need more info.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Run wxwidgets project not working
« Reply #6 on: February 27, 2020, 05:09:49 am »
Here is some more info.
CodeBlocks global compiler settings
Selected compiler: GNU GCC Compiler
Compilers installation directory: C:\Program Files\CodeBlocks\MinGW
C compiler: mingw32-gcc.exe
C++ compiler: mingw32-g++.exe
Linker for dynamic libs: mingw32-g++.exe

Windows system environment path:
1st item on list: C:\Program Files\CodeBlocks\MinGW
2nd item on list: C:\MinGW
... more search paths

wxWidgets build library
mingw32-make.exe -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0
I am not sure how to find and/or set the compiler for the above command?
Please let me know if you need more info.

Where did you find directions that said to use "UNICODE=0" because it likely wrong; but, not the cause of the current problem you are having. But, that location needs fixed; so, please report it?

Try using the command below to see which locations the command is found.
Code
where g++


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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Run wxwidgets project not working
« Reply #7 on: February 27, 2020, 05:42:45 am »
You're probably using gcc for linking c++ code. Change it to g++ and it will work.
This is done in the settings -> compiler -> toolchain executables

Please tell me the toolchain exe used to do dynamic linking?

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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Run wxwidgets project not working
« Reply #9 on: February 27, 2020, 09:01:49 am »
I am not sure how to find and/or set the compiler for the above command?
Please let me know if you need more info.
The path to the compiler should be in the PATH environment variable.
You're having a problem because you're probably using c:/mingw for building wx and c:/program files/codeblocks/.../mingw to build your application. Change one of those compilers and you'll be fine. If I were you, I would remove the compiler I don't want to use, so it doesn't cause confusion.
(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 dtrill

  • Single posting newcomer
  • *
  • Posts: 6
Re: Run wxwidgets project not working
« Reply #10 on: February 27, 2020, 07:03:17 pm »
1) I found the 'UNICODE=0' code snippet at 'https://wiki.wxwidgets.org/CodeBlocks_Setup_Guide'.
See the section 'Building your own wxWidgets library'.

2) I have attached the re-build log html file 'wxwidgets-test\wxwidgets-test_build_log.zip' (let me  know if you need a different format).

3) The linker for dynamic libs is 'mingw32-g++.exe' (I assume this is what you asked for?)

Thanks.

Offline sodev

  • Regular
  • ***
  • Posts: 497
Re: Run wxwidgets project not working
« Reply #11 on: February 27, 2020, 07:44:34 pm »
1) I found the 'UNICODE=0' code snippet at 'https://wiki.wxwidgets.org/CodeBlocks_Setup_Guide'.
Quote
This page describes the steps I took in order to get Code::Blocks working with a homemade wxWidgets. I used the Code::Blocks+MINGW 1.0 bundle and wxWidgets 2.6.

Hmm, this is like what, 15 years old? Thats why i prefer no documentation over wrong/outdated documentation ::) ;D

Good news is, disabling unicode shouldn't do anything these days, this gets ignored and unicode gets forcefully enabled (however i'm not sure if this does apply to your used wxWidgets 3.0.4).

There are no build errors but you have some strange build settings, you enable 3 different c++ standards, not sure which one actually gets selected, but there can be only one. This might be another cause for your problems because these are not ABI compatible and if your wxWidgets library uses a different standard this might cause that error. Another possibility is that you are not only missing the wxWidgets DLL in the output directory (technically it needs to be on the search path and the output directory is on it) but also the compiler DLL's you can find in the bin directory of your toolchain.

Offline dtrill

  • Single posting newcomer
  • *
  • Posts: 6
Re: Run wxwidgets project not working
« Reply #12 on: February 27, 2020, 08:34:58 pm »
sodev, thanks for pointing out some of my rookie mistakes!

1) I believe current wxWidget install documentation can be found on the Code Blocks website 'http://wiki.codeblocks.org/index.php/WxWindowsQuickRef'. I will uninstall wxWidgets and re-install using this document.

2) I had assumed that the c++ standard set in the Project/Build options tab would override any standard set in the Settings/Compiler tab (i.e. global compiler settings), but Code Blocks seems to allow both standards to be used?

Thanks.

Offline dtrill

  • Single posting newcomer
  • *
  • Posts: 6
Re: Run wxwidgets project not working
« Reply #13 on: February 28, 2020, 01:36:58 am »
Touchdown.  :)
 
Using the above suggestions, and some additional help from sly_chandan at 'https://forums.wxwidgets.org/viewtopic.php?t=39427', I have now solved my problem.

It's important to use the same compiler for building both wxWidgets and Code Blocks.

In addition, build command 'mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 CXXFLAGS=-fno-keep-inline-dllexport' worked for wxwidgets version 2.8.12, but did not work for wxwidgets version 3.0.4 (does not create file 'wxmsw30u_gcc_custom.dll').

For version 3.0.4, I used build command 'mingw32-make -j8 -f makefile.gcc BUILD=release SHARED=1 UNICODE=1 VENDOR=custom MONOLITHIC=1' (as per sly_chandan which creates file 'wxmsw30u_gcc_custom.dll').

Thanks to everyone for the help.