Unable to successfully compile wxWidgets-3.0.4

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.
Waingrove
Earned a small fee
Earned a small fee
Posts: 15
Joined: Fri Mar 27, 2020 4:25 pm

Unable to successfully compile wxWidgets-3.0.4

Post by Waingrove » Fri Mar 27, 2020 5:49 pm

I have tried a dozen times to build wxWidgets-3.0.4 withh no success.

I have codeblocks 16.01 installed.
I am using mingw64.
PATH is set to c:\mingw64\bin
I set the options in config.gcc to
SHARED ?= 1
TOOLKIT_VERSION ?= 2
UNICODE ?= 0
BUILD ?= release
MONOLITHIC ?= 1
GCC_VERSION ?= 3

I've tried using cmd.exe, command.com , both get no where.
I've tried using msys v.1.011

The final line of the install log is:

c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw3
2/lib/../lib/libuuid.a(lib64_libuuid_a-extras-uuid.o):extras-uuid.c:(.rdata$CLSI
D_FileProtocol[CLSID_FileProtocol]+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
mingw32-make: *** [makefile.gcc:5206: ..\..\lib\gcc_dll\wxmsw230_gcc_custom.dll]
Error 1

When I tried building minimal I get System Error:

The Program can't start because wxmsw230_gcc_custom.dll is missing.

What do I need to do?

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 365
Joined: Fri Nov 03, 2006 2:00 pm

Re: Unable to successfully compile wxWidgets-3.0.4

Post by stahta01 » Fri Mar 27, 2020 6:42 pm

Please state the reason for these two changes?

Code: Select all

TOOLKIT_VERSION ?= 2
UNICODE ?= 0
Please give information on the GCC compiler being used.
Edit: Found version 7.2.0 in your post.

Tim S.
Last edited by stahta01 on Fri Mar 27, 2020 6:44 pm, edited 1 time in total.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4228
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Unable to successfully compile wxWidgets-3.0.4

Post by ONEEYEMAN » Fri Mar 27, 2020 6:44 pm

Hi,
What is the exact command you used to build wxWidgets that fails for you?
Also - you shouldn't be modifying the config.gcc.

I suggest to start a fresh.

Unpack wxWidgets somewhere - i.e. c:\wxWidgets
Start command prompt
Do: cd c:\wxWidgets\build\msw
Do: mingw-w32 -f makefile.gcc

No, let me tell you about the options:

SHARED - on Windows it is a preferred way to build wxWidgets library statically linked, so that when you distribute the binary you just grab the executable and the CRT DLLs. However if you plan to build the DLLs that will link to wxWidgets it is advisable to build a shared version of wxWidgets.
UNICODE - do you really want to turn off UNICODE support?
BUILD - I strongly suggest to start with the debug configuration. It will help find an issue with you code and every possible memory leak.
MONOLITHIC - you can turn this option off. There is no gain in building monolithic version of the library now (in 2020), but you might experience linking issues later on during development with the monolithic build

So when the default build finish succesfully just do:

mingw-w32 -f makefile.gcc BUILD=debug SHARED=0

UNICODE option will be ON by defaut and the MONOLITHIC will be OFF.

See if that helps.

Thank you.
Last edited by ONEEYEMAN on Fri Mar 27, 2020 7:15 pm, edited 1 time in total.

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 365
Joined: Fri Nov 03, 2006 2:00 pm

Re: Unable to successfully compile wxWidgets-3.0.4

Post by stahta01 » Fri Mar 27, 2020 6:46 pm

To ONEEYEMAN: Replace "mingw-w64" with "mingw32-make" in directions:

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4228
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Unable to successfully compile wxWidgets-3.0.4

Post by ONEEYEMAN » Fri Mar 27, 2020 7:15 pm

Hi, Tim,
He said
I am using mingw64.
that's why I used the command.

Will fix.

Thank you.

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 365
Joined: Fri Nov 03, 2006 2:00 pm

Re: Unable to successfully compile wxWidgets-3.0.4

Post by stahta01 » Sat Mar 28, 2020 1:21 am

The Original Post reminds me of the error that needs this to be added to work around the cause.
The cause tends to be in the C Runtime source code used by MInGW GCC.

Code: Select all

LDFLAGS="-Wl,--allow-multiple-definition"
Edit1: Possible build command to try.

Code: Select all

mingw32-make -f makefile.gcc BUILD=debug SHARED=0 LDFLAGS=-Wl,--allow-multiple-definition
Tim S.

Waingrove
Earned a small fee
Earned a small fee
Posts: 15
Joined: Fri Mar 27, 2020 4:25 pm

Re: Unable to successfully compile wxWidgets-3.0.4

Post by Waingrove » Sat Mar 28, 2020 1:34 am

I tried to post a similar issue with wxWidgets-3.0.4 today. Seems it has yet to be approved. My solution was was connected to the windows security settings for the wxWidgets-3.0.4 directory. This may be a noob mistake but I think it deserves sharing. Right clik the folder wxWidgets-3.0.4 and select preferences. Select the security tab. To change permissions clik edit. Grant Full control to the user and or admin, you choice, depending on your access to the machine. Apply. After doing this I had no problem building wxWidgets library.

Waingrove
Earned a small fee
Earned a small fee
Posts: 15
Joined: Fri Mar 27, 2020 4:25 pm

Re: Unable to successfully compile wxWidgets-3.0.4

Post by Waingrove » Mon Mar 30, 2020 11:01 pm

Ok, as stated in my previous post I can build the library files for wxWidgets-3.0.4. And I can create a project in C::B using the monolithinc library.
But, I am still unable to build the dll version of wxWidgets-3.0.4. I've tried some settings found online but to no avail.

I cannot seem to use configure to build successfully.
Using mingw32-make.exe I can build the lib files but it will not create the dll .

Using the dos prompt is unseccessful.
Using msys64 will produce the lib files but not the dll.

Why?

Thx

p.s. I'm on a win 7 64bit machine.

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 365
Joined: Fri Nov 03, 2006 2:00 pm

Re: Unable to successfully compile wxWidgets-3.0.4

Post by stahta01 » Mon Mar 30, 2020 11:29 pm

What command you using to build shared wxWidgets that does not work?
Edit: And where are you running that command?

Tim S.

Waingrove
Earned a small fee
Earned a small fee
Posts: 15
Joined: Fri Mar 27, 2020 4:25 pm

Re: Unable to successfully compile wxWidgets-3.0.4

Post by Waingrove » Mon Mar 30, 2020 11:58 pm

mingw32-make.exe -f makefile.gcc

I'm setting the options in the config.gcc file.
When shared is set to 1 I get the error:
collect2.exe: error: ld returned 1 exit status
mingw32-make: *** [makefile.gcc:5206: ..\..\lib\gcc_dll\wxmsw30ud_gcc_custom.dll] Error 1

From what you implied: shared =0
makes the library files successfully
shared =1
causes the error.

# =========================================================================
# This configuration file was generated by
# Bakefile 0.2.9 (http://www.bakefile.org)
# Beware that all changes made to this file will be overwritten next
# time you run Bakefile!
# =========================================================================


# -------------------------------------------------------------------------
# These are configurable options:
# -------------------------------------------------------------------------

# Compiler flags to link shared library
LINK_DLL_FLAGS ?= -shared

# Compiler flags to link loadable module
LINK_MODULE_FLAGS ?= -shared

# C compiler
CC = gcc

# C++ compiler
CXX = g++

# Standard flags for CC
CFLAGS ?=

# Standard flags for C++
CXXFLAGS ?=

# Standard preprocessor flags (common for CC and CXX)
CPPFLAGS ?=

# Standard linker flags
LDFLAGS ?=

# The C preprocessor
CPP ?= $(CC) -E

# What type of library to build? [0,1]
SHARED ?= 0

# GTK+ toolkit version [,2]
TOOLKIT_VERSION ?=

# Build wxUniversal instead of native port? [0,1]
WXUNIV ?= 0

# Compile Unicode build of wxWidgets? [0,1]
UNICODE ?= 1

# Use MSLU library when building Unicode version. [0,1]
MSLU ?= 0

# Type of compiled binaries [debug,release]
BUILD ?= debug

# Should debugging info be included in the executables? The default value
# "default" means that debug info will be included if BUILD=debug
# and not included if BUILD=release. [0,1,default]
DEBUG_INFO ?= default

# Value of wxDEBUG_LEVEL. The default value is the same as 1 and means that all
# but expensive assert checks are enabled, use 0 to completely remove debugging
# code. [0,1,default]
DEBUG_FLAG ?= 1

# Multiple libraries or single huge monolithic one? [0,1]
MONOLITHIC ?= 1

# Build GUI libraries? [0,1]
USE_GUI ?= 1

# Build wxHTML library (USE_GUI must be 1)? [0,1]
USE_HTML ?= 1

# Build wxWebView library (USE_GUI must be 1)? [0,1]
USE_WEBVIEW ?= 1

# Build multimedia library (USE_GUI must be 1)? [0,1]
USE_MEDIA ?= 1

# Build wxXRC library (USE_GUI must be 1)? [0,1]
USE_XRC ?= 1

# Build wxAUI library (USE_GUI must be 1)? [0,1]
USE_AUI ?= 1

# Build wxRibbon library (USE_GUI must be 1)? [0,1]
USE_RIBBON ?= 1

# Build wxPropertyGrid library (USE_GUI must be 1)? [0,1]
USE_PROPGRID ?= 1

# Build wxRichTextCtrl library (USE_GUI must be 1)? [0,1]
USE_RICHTEXT ?= 1

# Build wxStyledTextCtrl library (USE_GUI must be 1)? [0,1]
USE_STC ?= 1

# Build OpenGL canvas library (USE_GUI must be 1)? [0,1]
USE_OPENGL ?= 1

# Build quality assurance classes library (USE_GUI must be 1)? [0,1]
USE_QA ?= 0

# Enable exceptions in compiled code. [0,1]
USE_EXCEPTIONS ?= 1

# Enable run-time type information (RTTI) in compiled code. [0,1]
USE_RTTI ?= 1

# Enable threading in compiled code. [0,1]
USE_THREADS ?= 1

# Enable wxCairoContext for platforms other than Linux/GTK. [0,1]
USE_CAIRO ?= 0

# Is this official build by wxWidgets developers? [0,1]
OFFICIAL_BUILD ?= 0

# Use this to name your customized DLLs differently
VENDOR ?= custom

#
WX_FLAVOUR ?=

#
WX_LIB_FLAVOUR ?=

# Name of your custom configuration. This affects directory
# where object files are stored as well as the location of
# compiled .lib files and setup.h under the lib/ toplevel directory.
CFG ?=

# Compiler flags needed to compile test suite in tests directory. If you want
# to run the tests, set it so that the compiler can find CppUnit headers.
CPPUNIT_CFLAGS ?=

# Linker flags needed to link test suite in tests directory. If you want
# to run the tests, include CppUnit library here.
CPPUNIT_LIBS ?=

# Version of C runtime library to use. You can change this to
# static if SHARED=0, but it is highly recommended to not do
# it if SHARED=1 unless you know what you are doing. [dynamic,static]
RUNTIME_LIBS ?= dynamic

# Set the version of your Mingw installation here.
# "3" ...... this is for Mingw 2.0 or newer (comes with gcc3)
# "2.95" ... for Mingw 1.1 or any of the older versions [3,2.95]
GCC_VERSION ?= 3

# Windows resource compiler to use, possibly including extra options.
# For example, add "-F pe-i386" here if using 64 bit windres for 32 bit build.
WINDRES ?= windres --use-temp-file

I am currently building with SHARED =0
just to be sure of what I stated.

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 365
Joined: Fri Nov 03, 2006 2:00 pm

Re: Unable to successfully compile wxWidgets-3.0.4

Post by stahta01 » Tue Mar 31, 2020 12:09 am

Are you saying that this command is the one that fails?

Code: Select all

mingw32-make.exe -f makefile.gcc SHARED=1
Editing config.gcc is not normally preferred way for newbies to use.

Tim S.

Waingrove
Earned a small fee
Earned a small fee
Posts: 15
Joined: Fri Mar 27, 2020 4:25 pm

Re: Unable to successfully compile wxWidgets-3.0.4

Post by Waingrove » Tue Mar 31, 2020 12:34 am

Yup

when SHARED =0
I successfuly create the library

when SHARED =1
I get the error

Waingrove
Earned a small fee
Earned a small fee
Posts: 15
Joined: Fri Mar 27, 2020 4:25 pm

Re: Unable to successfully compile wxWidgets-3.0.4

Post by Waingrove » Tue Mar 31, 2020 12:35 am

stahta01 wrote:
Tue Mar 31, 2020 12:09 am
Are you saying that this command is the one that fails?

Code: Select all

mingw32-make.exe -f makefile.gcc SHARED=1
Editing config.gcc is not normally preferred way for newbies to use.

Tim S.
It seems the most stable way to ensure correct cammand options.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4228
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Unable to successfully compile wxWidgets-3.0.4

Post by ONEEYEMAN » Tue Mar 31, 2020 12:43 am

Hi,
You shouldn't be changing the config file.

Please undo all those changes and try with just

mingw32-make -f makefile.gcc

Thank you.

Waingrove
Earned a small fee
Earned a small fee
Posts: 15
Joined: Fri Mar 27, 2020 4:25 pm

Re: Unable to successfully compile wxWidgets-3.0.4

Post by Waingrove » Tue Mar 31, 2020 12:54 am

Using the config.gcc file is appropriate.
making mistakes passing arguments t o the command adds to the possibility of mistakes. Read the config.gcc file before dismissing it.

Post Reply