Setup nightmare

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
paddle
Knows some wx things
Knows some wx things
Posts: 43
Joined: Sat Oct 12, 2019 4:57 pm

Setup nightmare

Post by paddle »

Hey guys,

I'm a almost total newbie on codeblocks, and total newbie on wxWidgets. I've struggled for days to setup wxWidgets and it's driving me crazy.

I first tried the 3.1.2 version but the build kept getting errors. Then I started to try with 3.0.4 and could build following this guide :
https://wiki.wxwidgets.org/CodeBlocks_Setup_Guide

I used :

Code: Select all

mingw32-make.exe -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1
First problem, tutorial say to rename \lib\gcc_dll into something else. However I don't have this folder. I have gcc_lib.
But I guess it's not a big problem if I don't build again.

Anyway I launch codeblock 17.12. Compiler is GNU GCC x64.
Create new project, wxwidgets project. Fill the setup wizard as explained here :
http://wiki.codeblocks.org/index.php?ti ... wsQuickRef

Then when I try to build I have

Code: Select all

||=== Build: Release in gegergrze (compiler: GNU GCC Compiler(x64)) ===|
ld.exe||cannot find -lwxmsw30u|
ld.exe||cannot find -lwxpng|
ld.exe||cannot find -lwxjpeg|
ld.exe||cannot find -lwxtiff|
ld.exe||cannot find -lwxzlib|
||error: ld returned 1 exit status|
||=== Build failed: 6 error(s), 0 warning(s) (0 minute(s), 8 second(s)) ===|


Full log are :

Code: Select all


-------------- Build: Release in gegergrze (compiler: GNU GCC Compiler(x64))---------------

x86_64-w64-mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -O2 -IC:\wxWidgets-3.0.4\include -IC:\wxWidgets-3.0.4\lib\gcc_lib\mswu -IC:\Users\Pierre\Desktop\test -IC:\wxWidgets-3.0.4\include -c C:\Users\Pierre\Desktop\tgz\cpp\test\gegergrze\gegergrzeApp.cpp -o obj\Release\gegergrzeApp.o
x86_64-w64-mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -O2 -IC:\wxWidgets-3.0.4\include -IC:\wxWidgets-3.0.4\lib\gcc_lib\mswu -IC:\Users\Pierre\Desktop\test -IC:\wxWidgets-3.0.4\include -c C:\Users\Pierre\Desktop\tgz\cpp\test\gegergrze\gegergrzeMain.cpp -o obj\Release\gegergrzeMain.o
x86_64-w64-mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -O2 -IC:\wxWidgets-3.0.4\include -IC:\wxWidgets-3.0.4\lib\gcc_lib\mswu -IC:\Users\Pierre\Desktop\test -IC:\wxWidgets-3.0.4\include -c C:\Users\Pierre\Desktop\tgz\cpp\test\gegergrze\GUIDialog.cpp -o obj\Release\GUIDialog.o
windres.exe -IC:\wxWidgets-3.0.4\include -IC:\wxWidgets-3.0.4\lib\gcc_lib\mswu  -J rc -O coff -i C:\Users\Pierre\Desktop\tgz\cpp\test\GEGERG~1\resource.rc -o obj\Release\resource.res
x86_64-w64-mingw32-g++.exe -LC:\wxWidgets-3.0.4\lib\gcc_lib -o bin\Release\gegergrze.exe obj\Release\gegergrzeApp.o obj\Release\gegergrzeMain.o obj\Release\GUIDialog.o  obj\Release\resource.res -s -mthreads  -lwxmsw30u -lwxpng -lwxjpeg -lwxtiff -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 "C:\Program Files (x86)\CodeBlocks\MinGW\lib\libuxtheme.a" "C:\Program Files (x86)\CodeBlocks\MinGW\lib\liboleacc.a" -mwindows
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.0.4\lib\gcc_lib/libwxmsw30u.a when searching for -lwxmsw30u
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.0.4\lib\gcc_lib\libwxmsw30u.a when searching for -lwxmsw30u
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.0.4\lib\gcc_lib/libwxmsw30u.a when searching for -lwxmsw30u
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwxmsw30u
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.0.4\lib\gcc_lib/libwxpng.a when searching for -lwxpng
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.0.4\lib\gcc_lib\libwxpng.a when searching for -lwxpng
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.0.4\lib\gcc_lib/libwxpng.a when searching for -lwxpng
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwxpng
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.0.4\lib\gcc_lib/libwxjpeg.a when searching for -lwxjpeg
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.0.4\lib\gcc_lib\libwxjpeg.a when searching for -lwxjpeg
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.0.4\lib\gcc_lib/libwxjpeg.a when searching for -lwxjpeg
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwxjpeg
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.0.4\lib\gcc_lib/libwxtiff.a when searching for -lwxtiff
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.0.4\lib\gcc_lib\libwxtiff.a when searching for -lwxtiff
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.0.4\lib\gcc_lib/libwxtiff.a when searching for -lwxtiff
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwxtiff
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.0.4\lib\gcc_lib/libwxzlib.a when searching for -lwxzlib
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.0.4\lib\gcc_lib\libwxzlib.a when searching for -lwxzlib
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.0.4\lib\gcc_lib/libwxzlib.a when searching for -lwxzlib
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwxzlib
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 8 second(s))
6 error(s), 0 warning(s) (0 minute(s), 8 second(s))
 
If someone can help finding the issue there it would really help me out.

It's actually the second time I tried to use CB&wxwidgets but the first time I just gave up because I could not do the setup. I can't say the setup process is very new-user-friendly.
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Setup nightmare

Post by doublemax »

Please try this guide: viewtopic.php?f=19&t=46125

It's up-to-date and quite detailed.
Use the source, Luke!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Setup nightmare

Post by ONEEYEMAN »

Hi,
First - don't do a monolithic build of wxWidgets.
Second - you C::B project options absolutely has to match the options you build wxWidgets with. Otherwise you will have a lot of issues.

Thank you.
paddle
Knows some wx things
Knows some wx things
Posts: 43
Joined: Sat Oct 12, 2019 4:57 pm

Re: Setup nightmare

Post by paddle »

Hi,
Thanks for your replies.
First - don't do a monolithic build of wxWidgets.
Second - you C::B project options absolutely has to match the options you build wxWidgets with. Otherwise you will have a lot of issues.
1- Not sure why there is this monolithic option if it should not be used..? Maybe it would best to remove all reference to it if it don't work.
2- Yes I got that. I selected unicode/monolithic/dll as required.

I tried to start over, following the tutorial you linked. Only difference was that I used 3.0.4, have not built the debug version of wx. And i used monolithic.

And I kept having the same errors.

Today I tried on another computer which is win7 32bit.
I followed the tutorial exactly. Using 3.1.2. Built the debug and release both. Every step have been done.
I could built minimal from CMD as explained in the tutorial.

But on CB new project still don't build. But now with different errors :
undefined reference to `jpeg_resync_to_restart'
undefined reference to `jpeg_std_error'
undefined reference to `jpeg_destroy_decompress'
...

Ok I cannot even paste the logs as I get the error from forum :
"Forbidden. Message seems to be spam."
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Setup nightmare

Post by ONEEYEMAN »

Hi,
Monolithic build will not gain you anything - just more headache in the future. ;-)
So, when you start over - what command did you use to build wxWidgets?
Also - it is good that you are able to build and run minimal sample. It means that it works.

And it would be nice if you can post a screenshots from the C::B wizard with what options you selected, when creating the project.

Thank you.
paddle
Knows some wx things
Knows some wx things
Posts: 43
Joined: Sat Oct 12, 2019 4:57 pm

Re: Setup nightmare

Post by paddle »

Hello,
I copy/pasted exactly as on tutorial of previous link.

mingw32-make -f makefile.gcc SHARED=0 BUILD=debug MONOLITHIC=0
mingw32-make -f makefile.gcc SHARED=0 BUILD=release MONOLITHIC=0

Then going to <wxdir>/samples/minimal
and running
mingw32-make -f makefile.gcc SHARED=0 BUILD=debug MONOLITHIC=0
works. I have the .exe file and minimal app can launch.

Now on codeblocks :
https://youtu.be/i-XSlk8qByA

Please tell me what I'm doing wrong.

Code: Select all

||=== Build: Debug in zfeazef (compiler: GNU GCC Compiler(x64)) ===|
ld.exe||cannot find -lwxmsw31ud_core|
ld.exe||cannot find -lwxbase31ud|
ld.exe||cannot find -lwxpngd|
ld.exe||cannot find -lwxzlibd|
||error: ld returned 1 exit status|
||=== Build failed: 5 error(s), 0 warning(s) (0 minute(s), 7 second(s)) ===|

Code: Select all

-------------- Build: Debug in fezfezf (compiler: GNU GCC Compiler(x64))---------------

x86_64-w64-mingw32-g++.exe -LC:\wxWidgets-3.1.2\lib\gcc_lib -o bin\Debug\fezfezf.exe obj\Debug\fezfezfApp.o obj\Debug\fezfezfMain.o  obj\Debug\resource.res  -mthreads   -lwxmsw31ud_core -lwxbase31ud -lwxpngd -lwxzlibd -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -lshlwapi -lversion -luxtheme -loleacc -mwindows
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.1.2\lib\gcc_lib/libwxmsw31ud_core.a when searching for -lwxmsw31ud_core
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.1.2\lib\gcc_lib\libwxmsw31ud_core.a when searching for -lwxmsw31ud_core
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.1.2\lib\gcc_lib/libwxmsw31ud_core.a when searching for -lwxmsw31ud_core
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwxmsw31ud_core
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.1.2\lib\gcc_lib/libwxbase31ud.a when searching for -lwxbase31ud
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.1.2\lib\gcc_lib\libwxbase31ud.a when searching for -lwxbase31ud
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.1.2\lib\gcc_lib/libwxbase31ud.a when searching for -lwxbase31ud
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwxbase31ud
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.1.2\lib\gcc_lib/libwxpngd.a when searching for -lwxpngd
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.1.2\lib\gcc_lib\libwxpngd.a when searching for -lwxpngd
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.1.2\lib\gcc_lib/libwxpngd.a when searching for -lwxpngd
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwxpngd
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.1.2\lib\gcc_lib/libwxzlibd.a when searching for -lwxzlibd
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.1.2\lib\gcc_lib\libwxzlibd.a when searching for -lwxzlibd
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\wxWidgets-3.1.2\lib\gcc_lib/libwxzlibd.a when searching for -lwxzlibd
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwxzlibd
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
5 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Setup nightmare

Post by doublemax »

I can't see the video as it requires to sign in to Youtube.

The "skipping incompatible" warning makes me believe that you either
a) have two different compilers installed and CB uses a different one that the one you built wxWidgets with
Or
b) one project is 32bit and the other is 64bit
Use the source, Luke!
paddle
Knows some wx things
Knows some wx things
Posts: 43
Joined: Sat Oct 12, 2019 4:57 pm

Re: Setup nightmare

Post by paddle »

I changed the video setting it can now be seen. https://youtu.be/i-XSlk8qByA

About the compiler, I just used codeblocks with mingw packaged. How should I check the compiler settings? It's in toolchain executables?

About 32bit vs 64bit this computer is 64bit, so is the version of mingw. I'll need to check the windows PATH see if it's not a 32bit mingw setup there by error.


On another computer - Another issue

I tried to install on my work computer yesterday (32bit windows 7) and could get it setup!! (even though I had to add png and tiff libraries in the new project wizard, which is not said in the tutorial, I found this advise on another forum post.)

And today surprise. When I launch codeblocks this morning, the windows open then freeze forever. So I kill the process. Open back up codeblocks, then on second launch it's ok, but the compiler setup is invalid...

Code: Select all

  The compiler's setup is invalid, so Code::Blocks cannot find/run the compiler.
  Probably the toolchain path within the compiler options is not setup correctly?!
  Do you have a compiler installed?
Goto "Settings->Compiler...->Global compiler settings->unknown->Toolchain executables" and fix the compiler's setup.
Tried to build the minimal from console and it builds correctly. Tried to check the compiler settings, reseting to default, toolchain executable links looks correct, tried reboot computer and the same pattern happens again (first time crash, then compiler broken).
paddle
Knows some wx things
Knows some wx things
Posts: 43
Joined: Sat Oct 12, 2019 4:57 pm

Re: Setup nightmare

Post by paddle »

I finally found the problem (of my first computer). You were right it's a compiler problem.

The path in my windows variables (for reference win7 : control panel, system, advanced system settings, environment variable, system variables, path)

was "C:\Program Files (x86)\CodeBlocks\MinGW\bin"

However the default compiler on my codeblocks was set to mingw64 that I have installed in C:\mingw-w64 ...

So I guess when building the libraries on command windows it used the compiler defined in the path. Thus incompatibility of libraries.
Post Reply