Compiling a wxWidgets application under windows

970 views
Skip to first unread message

Gunter Königsmann

unread,
Dec 5, 2017, 6:46:02 AM12/5/17
to wx-users
Dear all,

I have tried the same now with wxWidgets 3.0 and 3.1 on 2 PCs using 3 versions of mingw (mingw, tdm-gcc and mingw-w64):
  • Make sure that the PATH environment variable begins with the mingw installation
  • cd into the directory the wxWidgets source can be found in
  • cd build
  • cd msw
  • mingw32-make SHELL=CMD.exe -j4 -f makefile.gcc BUILD=release UNICODE=1 SHARED=0 MONOLITHIC=1
  • [this attempt always aborts with msys changing mono to moo during the final stage => applied the change described in https://wiki.wxwidgets.org/Compiling_wxWidgets_with_MinGW for this case]
  • mingw32-make SHELL=CMD.exe -j4 -f makefile.gcc BUILD=release UNICODE=1 SHARED=0 MONOLITHIC=1

Now wxWidgets seems to be compiled fine => let's try to compile our own application in eclipse's managed build:


Info: Internal Builder is used for build
g
++ "-IC:\\Users\\koengu\\Desktop\\wxWidgets-3.1.0\\lib\\gcc_lib\\mswu" "-IC:\\Users\\koengu\\Desktop\\wxWidgets-3.1.0\\include\\" -O3 -Wall -c -fmessage-length=0 -o minimal.o "..\\minimal.cpp"
g
++ "-LC:\\Users\\koengu\\Desktop\\wxWidgets-3.1.0\\lib\\gcc_lib" -o wxWindows.exe minimal.o -lwxmsw31u -lwxmsw31u_gl -lwxscintilla -lwxtiff -lwxzlib -lwxjpeg -lwxexpat -lwxregexu -lwxscintilla -lwxpng
minimal
.o:minimal.cpp:(.text+0x65): undefined reference to `wxAppConsoleBase::CheckBuildOptions(char const*, char const*)'
minimal.o:minimal.cpp:(.text+0x7a): undefined reference to `
wxApp::wxApp()'
minimal.o:minimal.cpp:(.text+0x103): undefined reference to `wxEntry(HINSTANCE__*, HINSTANCE__*, char*, int)'

minimal
.o:minimal.cpp:(.text+0x111): undefined reference to `wxAppConsoleBase::ms_appInstance'
minimal.o:minimal.cpp:(.text+0x12d): undefined reference to `
wxConvLibcPtr'
minimal.o:minimal.cpp:(.text+0x144): undefined reference to `wxString::npos'

minimal
.o:minimal.cpp:(.text+0x15b): undefined reference to `wxString::ConvertStr(char const*, unsigned int, wxMBConv const&)'
minimal.o:minimal.cpp:(.text+0x166): undefined reference to `
wxPrivate::GetUntypedNullData()'
minimal.o:minimal.cpp:(.text+0x17a): undefined reference to `wxPrivate::GetUntypedNullData()'

minimal
.o:minimal.cpp:(.text+0x191): undefined reference to `wxPrivate::GetUntypedNullData()'
minimal.o:minimal.cpp:(.text+0x1e4): undefined reference to `
wxPrivate::GetUntypedNullData()'
minimal.o:minimal.cpp:(.text+0x1fb): undefined reference to `wxPrivate::GetUntypedNullData()'

minimal
.o:minimal.cpp:(.text+0x20d): undefined reference to `wxGetOsDescription()'
minimal.o:minimal.cpp:(.text+0x212): undefined reference to `
wxPrivate::GetUntypedNullData()'
minimal.o:minimal.cpp:(.text+0x21d): undefined reference to `wxPrivate::GetUntypedNullData()'

minimal
.o:minimal.cpp:(.text+0x254): undefined reference to `wxPrivate::GetUntypedNullData()'
minimal.o:minimal.cpp:(.text+0x280): undefined reference to `
wxFormatString::GetArgumentType(unsigned int) const'
minimal.o:minimal.cpp:(.text+0x286): undefined reference to `wxTheAssertHandler'

minimal
.o:minimal.cpp:(.text+0x2be): undefined reference to `wxOnAssert(char const*, int, char const*, char const*, char const*)'
minimal.o:minimal.cpp:(.text+0x2c4): undefined reference to `
wxTrapInAssert'
minimal.o:minimal.cpp:(.text+0x2cd): undefined reference to `wxTrapInAssert'

minimal
.o:minimal.cpp:(.text+0x2da): undefined reference to `wxArgNormalizerWchar<wxString const&>::get() const'
minimal.o:minimal.cpp:(.text+0x2f2): undefined reference to `
wxFormatString::GetArgumentType(unsigned int) const'
minimal.o:minimal.cpp:(.text+0x2f8): undefined reference to `wxTheAssertHandler'

minimal
.o:minimal.cpp:(.text+0x330): undefined reference to `wxOnAssert(char const*, int, char const*, char const*, char const*)'
minimal.o:minimal.cpp:(.text+0x336): undefined reference to `
wxTrapInAssert'
minimal.o:minimal.cpp:(.text+0x33f): undefined reference to `wxTrapInAssert'

minimal
.o:minimal.cpp:(.text+0x34c): undefined reference to `wxFormatString::AsWChar()'
minimal.o:minimal.cpp:(.text+0x36d): undefined reference to `
wxString::DoFormatWchar(wchar_t const*, ...)'
minimal.o:minimal.cpp:(.text+0x39b): undefined reference to `wxMessageBox(wxString const&, wxString const&, long, wxWindow*, int, int)'

minimal
.o:minimal.cpp:(.text+0x3c3): undefined reference to `wxPrivate::GetUntypedNullData()'
minimal.o:minimal.cpp:(.text+0x3dd): undefined reference to `
wxPrivate::GetUntypedNullData()'
minimal.o:minimal.cpp:(.text+0x3e8): undefined reference to `wxPrivate::GetUntypedNullData()'

minimal
.o:minimal.cpp:(.text+0x402): undefined reference to `wxPrivate::GetUntypedNullData()'
minimal.o:minimal.cpp:(.text+0x40d): undefined reference to `
wxPrivate::GetUntypedNullData()'
minimal.o:minimal.cpp:(.text+0x423): more undefined references to `wxPrivate::GetUntypedNullData()'
follow
minimal
.o:minimal.cpp:(.text+0x5c1): undefined reference to `wxGet_wxConvLibcPtr()'
minimal.o:minimal.cpp:(.text+0x5c6): undefined reference to `
wxConvLibcPtr'
minimal.o:minimal.cpp:(.text+0x66d): undefined reference to `wxConvLibcPtr'

minimal
.o:minimal.cpp:(.text+0x684): undefined reference to `wxString::npos'
minimal.o:minimal.cpp:(.text+0x68c): undefined reference to `
wxFrameNameStr'
minimal.o:minimal.cpp:(.text+0x69b): undefined reference to `wxString::ConvertStr(char const*, unsigned int, wxMBConv const&)'

minimal
.o:minimal.cpp:(.text+0x6a6): undefined reference to `wxPrivate::GetUntypedNullData()'
minimal.o:minimal.cpp:(.text+0x6ba): undefined reference to `
wxPrivate::GetUntypedNullData()'
minimal.o:minimal.cpp:(.text+0x6d1): undefined reference to `wxPrivate::GetUntypedNullData()'

minimal
.o:minimal.cpp:(.text+0x724): undefined reference to `wxPrivate::GetUntypedNullData()'
minimal.o:minimal.cpp:(.text+0x73b): undefined reference to `
wxPrivate::GetUntypedNullData()'
minimal.o:minimal.cpp:(.text+0x74d): undefined reference to `wxFrameBase::wxFrameBase()'

minimal
.o:minimal.cpp:(.text+0x759): undefined reference to `vtable for wxFrame'
minimal.o:minimal.cpp:(.text+0x760): undefined reference to `
wxFrame::Init()'


I even asked someone else to setup the project for me. With the same result.

What did I do wrong?


Thanks a lot,

and kind regards,


    Gunter.

Vadim Zeitlin

unread,
Dec 5, 2017, 7:18:41 AM12/5/17
to wx-u...@googlegroups.com
On Tue, 5 Dec 2017 03:46:01 -0800 (PST) Gunter Königsmann wrote:

GK> I have tried the same now with wxWidgets 3.0 and 3.1 on 2 PCs using 3
GK> versions of mingw (mingw, tdm-gcc and mingw-w64):

FWIW I've just recently retested all 3 of those (and different versions of
the latter) and they all worked for me. I tested with the current master
and not using MONOLITHIC=1, however.

GK> - mingw32-make SHELL=CMD.exe -j4 -f makefile.gcc BUILD=release UNICODE=1
GK> SHARED=0 MONOLITHIC=1
GK>
GK> Now wxWidgets seems to be compiled fine => let's try to compile our own
GK> application in eclipse's managed build:
GK>
GK>
GK> Info: Internal Builder is used for build
GK> g++ "-IC:\\Users\\koengu\\Desktop\\wxWidgets-3.1.0\\lib\\gcc_lib\\mswu"
GK> "-IC:\\Users\\koengu\\Desktop\\wxWidgets-3.1.0\\include\\" -O3 -Wall -c -
GK> fmessage-length=0 -o minimal.o "..\\minimal.cpp"
GK> g++ "-LC:\\Users\\koengu\\Desktop\\wxWidgets-3.1.0\\lib\\gcc_lib" -o
GK> wxWindows.exe minimal.o -lwxmsw31u -lwxmsw31u_gl -lwxscintilla -lwxtiff -lwxzlib
GK> -lwxjpeg -lwxexpat -lwxregexu -lwxscintilla -lwxpng
GK> minimal.o:minimal.cpp:(.text+0x65): undefined reference to `wxAppConsoleBase::CheckBuildOptions(char
GK> const*, char const*)'

This function must be in libwxmsw31u.a file, so it's a mystery why is it
not found. Can you run the same command from the (same) command prompt
where you built wxWidgets itself? If it still gives the same error, could
you please run "nm -C /full/path/to/libwxmsw31u.a|fgrep CheckBuildOptions"?
What does it show?

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

Gunter Königsmann

unread,
Dec 5, 2017, 8:20:44 AM12/5/17
to wx-users
Not setting MONOLITHIC=1 results for me in:

KoenGu@DENUE01D00489 /c/users/koengu/Desktop/wxWidgets-3.1.0/build/msw
$ mingw32
-make SHELL=CMD.exe -j1 -f makefile.gcc BUILD=release UNICODE=1 SHARED
=0 MONOLITHIC=0
if not exist ..\..\lib\gcc_lib\mswu mkdir ..\..\lib\gcc_lib\mswu
if exist ..\..\lib\gcc_lib\libwxmsw31u_core.a del ..\..\lib\gcc_lib\libwxmsw31u_
core
.a
ar rcu
..\..\lib\gcc_lib\libwxmsw31u_core.a gcc_mswu\corelib_dummy.o gcc_mswu\co
relib_event
.o gcc_mswu\corelib_fs_mem.o gcc_mswu\corelib_msgout.o gcc_mswu\corel
ib_utilscmn
.o gcc_mswu\corelib_main.o gcc_mswu\corelib_volume.o gcc_mswu\corelib
_activex
.o gcc_mswu\corelib_app.o gcc_mswu\corelib_bitmap.o gcc_mswu\corelib_bru
sh
.o gcc_mswu\corelib_caret.o gcc_mswu\corelib_clipbrd.o gcc_mswu\corelib_colour
.o gcc_mswu\corelib_cursor.o gcc_mswu\corelib_data.o gcc_mswu\corelib_dc.o gcc_m
swu
\corelib_dcclient.o gcc_mswu\corelib_dcmemory.o gcc_mswu\corelib_dcprint.o gc
c_mswu
\corelib_dcscreen.o gcc_mswu\corelib_dialup.o gcc_mswu\corelib_dib.o gcc_m
swu
\corelib_display.o gcc_mswu\corelib_enhmeta.o gcc_mswu\corelib_font.o gcc_msw
u
\corelib_fontenum.o gcc_mswu\corelib_fontutil.o gcc_mswu\corelib_gdiimage.o gcc
_mswu
\corelib_gdiobj.o gcc_mswu\corelib_gdiplus.o gcc_mswu\corelib_graphics.o gc
c_mswu
\corelib_icon.o gcc_mswu\corelib_imaglist.o gcc_mswu\corelib_minifram.o gc
c_mswu
\corelib_nonownedwnd.o gcc_mswu\corelib_dataobj.o gcc_mswu\corelib_dropsrc
.o gcc_mswu\corelib_droptgt.o gcc_mswu\corelib_oleutils.o gcc_mswu\corelib_safea
rray
.o gcc_mswu\corelib_palette.o gcc_mswu\corelib_pen.o gcc_mswu\corelib_popupw
in.o gcc_mswu\corelib_printdlg.o gcc_mswu\corelib_printwin.o gcc_mswu\corelib_re
gion
.o gcc_mswu\corelib_renderer.o gcc_mswu\corelib_settings.o gcc_mswu\corelib_
textmeasure
.o gcc_mswu\corelib_tooltip.o gcc_mswu\corelib_toplevel.o gcc_mswu\co
relib_uiaction
.o gcc_mswu\corelib_utilsgui.o gcc_mswu\corelib_utilswin.o gcc_msw
u
\corelib_uxtheme.o gcc_mswu\corelib_window.o gcc_mswu\corelib_graphicsd2d.o gcc
_mswu
\corelib_utilsrt.o gcc_mswu\corelib_helpchm.o gcc_mswu\corelib_helpwin.o gc
c_mswu
\corelib_automtn.o gcc_mswu\corelib_uuid.o gcc_mswu\corelib_clrpickerg.o g
cc_mswu
\corelib_collpaneg.o gcc_mswu\corelib_filepickerg.o gcc_mswu\corelib_font
pickerg
.o gcc_mswu\corelib_generic_statusbr.o gcc_mswu\corelib_prntdlgg.o gcc_ms
wu
\corelib_msw_accel.o gcc_mswu\corelib_msw_anybutton.o gcc_mswu\corelib_appprog
ress
.o gcc_mswu\corelib_artmsw.o gcc_mswu\corelib_msw_bmpbuttn.o gcc_mswu\coreli
b_msw_button
.o gcc_mswu\corelib_msw_checkbox.o gcc_mswu\corelib_msw_choice.o gcc
_mswu
\corelib_colordlg.o gcc_mswu\corelib_combo.o gcc_mswu\corelib_msw_combobox.
o gcc_mswu
\corelib_msw_control.o gcc_mswu\corelib_msw_dialog.o gcc_mswu\corelib_
dirdlg
.o gcc_mswu\corelib_dragimag.o gcc_mswu\corelib_evtloop.o gcc_mswu\corelib
_filedlg
.o gcc_mswu\corelib_frame.o gcc_mswu\corelib_msw_gauge.o gcc_mswu\coreli
b_headerctrl
.o gcc_mswu\corelib_iniconf.o gcc_mswu\corelib_msw_listbox.o gcc_msw
u
\corelib_msw_listctrl.o gcc_mswu\corelib_mdi.o gcc_mswu\corelib_msw_menu.o gcc_
mswu
\corelib_menuitem.o gcc_mswu\corelib_metafile.o gcc_mswu\corelib_msgdlg.o gc
c_mswu
\corelib_nativdlg.o gcc_mswu\corelib_nativewin.o gcc_mswu\corelib_msw_note
book
.o gcc_mswu\corelib_access.o gcc_mswu\corelib_ownerdrw.o gcc_mswu\corelib_pa
nel
.o gcc_mswu\corelib_progdlg.o gcc_mswu\corelib_msw_radiobox.o gcc_mswu\coreli
b_msw_radiobut
.o gcc_mswu\corelib_richmsgdlg.o gcc_mswu\corelib_msw_scrolbar.o g
cc_mswu
\corelib_msw_slider.o gcc_mswu\corelib_msw_spinbutt.o gcc_mswu\corelib_sp
inctrl
.o gcc_mswu\corelib_msw_statbmp.o gcc_mswu\corelib_msw_statbox.o gcc_mswu\
corelib_statusbar
.o gcc_mswu\corelib_msw_statline.o gcc_mswu\corelib_msw_stattex
t
.o gcc_mswu\corelib_taskbarbutton.o gcc_mswu\corelib_msw_toolbar.o gcc_mswu\cor
elib_msw_textctrl
.o gcc_mswu\corelib_textentry.o gcc_mswu\corelib_msw_tglbtn.o g
cc_mswu
\corelib_treectrl.o gcc_mswu\corelib_systhemectrl.o gcc_mswu\corelib_msw_
checklst
.o gcc_mswu\corelib_msw_fdrepdlg.o gcc_mswu\corelib_fontdlg.o gcc_mswu\c
orelib_accelcmn
.o gcc_mswu\corelib_accesscmn.o gcc_mswu\corelib_anidecod.o gcc_m
swu
\corelib_affinematrix2d.o gcc_mswu\corelib_appcmn.o gcc_mswu\corelib_artprov.
o gcc_mswu
\corelib_artstd.o gcc_mswu\corelib_arttango.o gcc_mswu\corelib_bmpbase
.o gcc_mswu\corelib_bmpbtncmn.o gcc_mswu\corelib_bookctrl.o gcc_mswu\corelib_btn
cmn
.o gcc_mswu\corelib_cairo.o gcc_mswu\corelib_checkboxcmn.o gcc_mswu\corelib_c
hecklstcmn
.o gcc_mswu\corelib_choiccmn.o gcc_mswu\corelib_clipcmn.o gcc_mswu\cor
elib_clrpickercmn
.o gcc_mswu\corelib_colourcmn.o gcc_mswu\corelib_colourdata.o g
cc_mswu
\corelib_combocmn.o gcc_mswu\corelib_cmdproc.o gcc_mswu\corelib_cmndata.o
 gcc_mswu
\corelib_containr.o gcc_mswu\corelib_cshelp.o gcc_mswu\corelib_ctrlcmn.
o gcc_mswu
\corelib_ctrlsub.o gcc_mswu\corelib_dcbase.o gcc_mswu\corelib_dcbufcmn
.o gcc_mswu\corelib_dcgraph.o gcc_mswu\corelib_dcsvg.o gcc_mswu\corelib_dirctrlc
mn
.o gcc_mswu\corelib_dlgcmn.o gcc_mswu\corelib_dndcmn.o gcc_mswu\corelib_dobjcm
n
.o gcc_mswu\corelib_docmdi.o gcc_mswu\corelib_docview.o gcc_mswu\corelib_dpycmn
.o gcc_mswu\corelib_dseldlg.o gcc_mswu\corelib_effects.o gcc_mswu\corelib_fddlgc
mn
.o gcc_mswu\corelib_filectrlcmn.o gcc_mswu\corelib_filehistorycmn.o gcc_mswu\c
orelib_filepickercmn
.o gcc_mswu\corelib_fontpickercmn.o gcc_mswu\corelib_fldlgcm
n
.o gcc_mswu\corelib_fontcmn.o gcc_mswu\corelib_fontdata.o gcc_mswu\corelib_grap
hicc
.o gcc_mswu\corelib_fontenumcmn.o gcc_mswu\corelib_fontmap.o gcc_mswu\coreli
b_fontutilcmn
.o gcc_mswu\corelib_framecmn.o gcc_mswu\corelib_gaugecmn.o gcc_mswu
\corelib_gbsizer.o gcc_mswu\corelib_gdicmn.o gcc_mswu\corelib_geometry.o gcc_msw
u
\corelib_gifdecod.o gcc_mswu\corelib_graphcmn.o gcc_mswu\corelib_headercolcmn.o
 gcc_mswu
\corelib_headerctrlcmn.o gcc_mswu\corelib_helpbase.o gcc_mswu\corelib_i
conbndl
.o gcc_mswu\corelib_imagall.o gcc_mswu\corelib_imagbmp.o gcc_mswu\corelib
_image
.o gcc_mswu\corelib_imagfill.o gcc_mswu\corelib_imaggif.o gcc_mswu\corelib
_imagiff
.o gcc_mswu\corelib_imagjpeg.o gcc_mswu\corelib_imagpcx.o gcc_mswu\corel
ib_imagpng
.o gcc_mswu\corelib_imagpnm.o gcc_mswu\corelib_imagtga.o gcc_mswu\core
lib_imagtiff
.o gcc_mswu\corelib_imagxpm.o gcc_mswu\corelib_layout.o gcc_mswu\cor
elib_lboxcmn
.o gcc_mswu\corelib_listctrlcmn.o gcc_mswu\corelib_markupparser.o gc
c_mswu
\corelib_matrix.o gcc_mswu\corelib_menucmn.o gcc_mswu\corelib_modalhook.o
gcc_mswu
\corelib_mousemanager.o gcc_mswu\corelib_nbkbase.o gcc_mswu\corelib_over
laycmn
.o gcc_mswu\corelib_ownerdrwcmn.o gcc_mswu\corelib_paper.o gcc_mswu\coreli
b_panelcmn
.o gcc_mswu\corelib_persist.o gcc_mswu\corelib_pickerbase.o gcc_mswu\c
orelib_popupcmn
.o gcc_mswu\corelib_preferencescmn.o gcc_mswu\corelib_prntbase.o
gcc_mswu
\corelib_quantize.o gcc_mswu\corelib_radiobtncmn.o gcc_mswu\corelib_radi
ocmn
.o gcc_mswu\corelib_rearrangectrl.o gcc_mswu\corelib_rendcmn.o gcc_mswu\core
lib_rgncmn
.o gcc_mswu\corelib_scrolbarcmn.o gcc_mswu\corelib_settcmn.o gcc_mswu\
corelib_sizer
.o gcc_mswu\corelib_slidercmn.o gcc_mswu\corelib_spinbtncmn.o gcc_m
swu
\corelib_spinctrlcmn.o gcc_mswu\corelib_srchcmn.o gcc_mswu\corelib_statbar.o
gcc_mswu
\corelib_statbmpcmn.o gcc_mswu\corelib_statboxcmn.o gcc_mswu\corelib_sta
tlinecmn
.o gcc_mswu\corelib_stattextcmn.o gcc_mswu\corelib_stockitem.o gcc_mswu\
corelib_tbarbase
.o gcc_mswu\corelib_textcmn.o gcc_mswu\corelib_textentrycmn.o gc
c_mswu
\corelib_textmeasurecmn.o gcc_mswu\corelib_toplvcmn.o gcc_mswu\corelib_tre
ebase
.o gcc_mswu\corelib_uiactioncmn.o gcc_mswu\corelib_valgen.o gcc_mswu\coreli
b_validate
.o gcc_mswu\corelib_valtext.o gcc_mswu\corelib_valnum.o gcc_mswu\corel
ib_wincmn
.o gcc_mswu\corelib_windowid.o gcc_mswu\corelib_wrapsizer.o gcc_mswu\co
relib_xpmdecod
.o gcc_mswu\corelib_busyinfo.o gcc_mswu\corelib_buttonbar.o gcc_ms
wu
\corelib_choicdgg.o gcc_mswu\corelib_choicbkg.o gcc_mswu\corelib_collheaderctr
lg
.o gcc_mswu\corelib_combog.o gcc_mswu\corelib_dcpsg.o gcc_mswu\corelib_dirctrl
g
.o gcc_mswu\corelib_dragimgg.o gcc_mswu\corelib_filectrlg.o gcc_mswu\corelib_he
aderctrlg
.o gcc_mswu\corelib_infobar.o gcc_mswu\corelib_listbkg.o gcc_mswu\corel
ib_logg
.o gcc_mswu\corelib_markuptext.o gcc_mswu\corelib_msgdlgg.o gcc_mswu\core
lib_numdlgg
.o gcc_mswu\corelib_progdlgg.o gcc_mswu\corelib_preferencesg.o gcc_ms
wu
\corelib_printps.o gcc_mswu\corelib_renderg.o gcc_mswu\corelib_richmsgdlgg.o g
cc_mswu
\corelib_scrlwing.o gcc_mswu\corelib_selstore.o gcc_mswu\corelib_spinctlg
.o gcc_mswu\corelib_splitter.o gcc_mswu\corelib_srchctlg.o gcc_mswu\corelib_stat
bmpg
.o gcc_mswu\corelib_stattextg.o gcc_mswu\corelib_textdlgg.o gcc_mswu\corelib
_tipwin
.o gcc_mswu\corelib_toolbkg.o gcc_mswu\corelib_treectlg.o gcc_mswu\coreli
b_treebkg
.o gcc_mswu\corelib_vlbox.o gcc_mswu\corelib_vscroll.o gcc_mswu\corelib
_xmlreshandler
.o
ar
: gcc_mswu\corelib_vlbo.o: No such file or directory
mingw32
-make: *** [makefile.gcc:5350: ..\..\lib\gcc_lib\libwxmsw31u_core.a] Erro
r
1

Using -j 4 aborts way sooner as setup.h is used before it is created. Will download the master and see if that works for me.

Gunter Königsmann

unread,
Dec 5, 2017, 8:31:37 AM12/5/17
to wx-users
It didn't:
KoenGu@DENUE01D00489 /c/users/koengu/Desktop/wxWidgets-master/build/msw
$ mingw32
-make SHELL=CMD.exe -j1 -f makefile.gcc BUILD=release UNICODE=1 SHARED
=0 MONOLITHIC=0
if not exist ..\..\lib\gcc_lib\mswu mkdir ..\..\lib\gcc_lib\
mswu
gcc
-E "..\..\include\wx\msw\genrcdefs.h" > "..\..\lib\gcc_lib\mswu\wx\msw\rcdef
s.h"

gcc
-c -o gcc_mswu\wxregex_regcomp.o  -O2 -mthreads  -DHAVE_W32API_H -DNDEBUG -I
..\..\include -I..\..\lib\gcc_lib\mswu -D__WXMSW__  -D_UNICODE   -MTgcc_mswu\wxr
egex_regcomp
.o -MFgcc_mswu\wxregex_regcomp.o.d -MD -MP ../../src/regex/regcomp.c

gcc
-c -o gcc_mswu\wxregex_regexec.o  -O2 -mthreads  -DHAVE_W32API_H -DNDEBUG -I
..\..\include -I..\..\lib\gcc_lib\mswu -D__WXMSW__  -D_UNICODE   -MTgcc_mswu\wxr
egex_regexec
.o -MFgcc_mswu\wxregex_regexec.o.d -MD -MP ../../src/regex/regexec.c

gcc
-c -o gcc_mswu\wxregex_regerror.o  -O2 -mthreads  -DHAVE_W32API_H -DNDEBUG -
I
..\..\include -I..\..\lib\gcc_lib\mswu -D__WXMSW__  -D_UNICODE   -MTgcc_mswu\wx
regex_regerror
.o -MFgcc_mswu\wxregex_regerror.o.d -MD -MP ../../src/regex/regerr
or.c
gcc
-c -o gcc_mswu\wxregex_regfree.o  -O2 -mthreads  -DHAVE_W32API_H -DNDEBUG -I
..\..\include -I..\..\lib\gcc_lib\mswu -D__WXMSW__  -D_UNICODE   -MTgcc_mswu\wxr
egex_regfree
.o -MFgcc_mswu\wxregex_regfree.o.d -MD -MP ../../src/regex/regfree.c

if exist ..\..\lib\gcc_lib\libwxregexu.a del ..\..\lib\gcc_lib\libwxregexu.a
ar rcu
..\..\lib\gcc_lib\libwxregexu.a gcc_mswu\wxregex_regcomp.o gcc_mswu\wxreg
ex_regexec
.o gcc_mswu\wxregex_regerror.o gcc_mswu\wxregex_regfree.o
ranlib
..\..\lib\gcc_lib\libwxregexu.a
mingw32
-make: *** No rule to make target '../../src/zlib/adler32.c', needed by '
gcc_mswu\wxzlib_adler32.o'
.  Stop.

KoenGu@DENUE01D00489 /c/users/koengu/Desktop/wxWidgets-master/build/msw
$
Will download 3.1.0 again and try to compile this one and my application from the same shell session.

Gunter Königsmann

unread,
Dec 5, 2017, 11:04:26 AM12/5/17
to wx-users
No... ...seems like I always get the same error message. But I've tried the precompiled binaries. They work => will use them from now on.

Michael Surette

unread,
Dec 5, 2017, 1:02:10 PM12/5/17
to wx-u...@googlegroups.com
"undefined reference" errors, as in your original message, mean that
your linker can't find your libraries.

HTH

--
Mike

Vadim Zeitlin

unread,
Dec 5, 2017, 1:24:58 PM12/5/17
to wx-u...@googlegroups.com
On Tue, 5 Dec 2017 08:04:26 -0800 (PST) Gunter Königsmann wrote:

GK> No... ...seems like I always get the same error message. But I've tried
GK> the precompiled binaries. They work => will use them from now on.

It's definitely nice that you could make it work using the precompiled
binaries, but it's not nice at all that you had so many problems building
the library yourself.

I do know about the problem with "make -j4" and you need to run make twice
to work around it, see this note in the installation instructions:

https://github.com/wxWidgets/wxWidgets/blob/696a5ba3ddaf2ddca96f37972c9234d0d782b5ff/docs/msw/install.txt#L245,L248

This is still extremely annoying, but at least we know what the problem is
here.

But I still have no idea why do we get these mysterious problems with
command-line length (and resulting truncation/omission of single letters
from the linker command line) in some environments but not others. This is
really mysterious and I never could reproduce the problem myself.

Gunter Königsmann

unread,
Dec 6, 2017, 12:38:24 AM12/6/17
to wx-users
As the  original problem is solved for me (take the pre-compiled binaries and blame the rest on a weird individual windows system, but I am willing to do any additional tests you want) perhaps this thread can at least be used to help with this:

When the character limit on a dos command line was still lower (150 chars? 255 chars? 256 chars?) than the current 8192 character limit the fractint build script wrote all the linker parameters to a file and then used @parameterfile.txt as an argument that passed them to the command that needed the long command line. On Linux my bash shell doesn't seem to understand this notation. But perhaps cmd.exe will still...

Gunter Königsmann

unread,
Dec 6, 2017, 5:10:30 AM12/6/17
to wx-users
Seems like I spoke to soon:

When using the precompiled headers the file wx/setup.h is missing. Which I understand: wx/setup.h is specific to a specific build => tried extracted wxMSW-3.1.0_gcc510TDM_x64_ReleaseDLL.7 from the wxWidgets github page. Which didn't contain a setup.h file, while wxMSW-1.3.0_gcc510TDM_x64_Dev.7z does contain two of them: In the "mswu" folder and in the "mswud" folder. I assume the "mswu" one belongs to the "Release" dlls instead. Is this correct?

...and the headers come with a msvc/wx/setup.h file. Which should belong to the msvc precompiled dlls, if I am not totally wrong. Am I correct here? I didn't find any good documentation on "mswu" and "mswud". But as wxWidgets is *big* I assume that might be caused by me searching at the wrong place.


Vadim Zeitlin

unread,
Dec 6, 2017, 7:36:18 AM12/6/17
to wx-u...@googlegroups.com
On Wed, 6 Dec 2017 02:10:29 -0800 (PST) Gunter Königsmann wrote:

GK> When using the precompiled headers the file wx/setup.h is missing. Which I
GK> understand: wx/setup.h is specific to a specific build => tried extracted
GK> wxMSW-3.1.0_gcc510TDM_x64_ReleaseDLL.7 from the wxWidgets github page.
GK> Which didn't contain a setup.h file, while wxMSW-1.3.0_gcc510TDM_x64_Dev.7z
GK> does contain two of them: In the "mswu" folder and in the "mswud" folder. I
GK> assume the "mswu" one belongs to the "Release" dlls instead. Is this
GK> correct?

The "mswu" folder is for (Unicode) Release build of MSW port and "mswud"
one is for the debug one, yes.

GK> ...and the headers come with a msvc/wx/setup.h file. Which should belong to
GK> the msvc precompiled dlls, if I am not totally wrong. Am I correct here?

No, this header is part of the "Headers" archive because it's unchanging,
i.e. it doesn't depend on the build. The setup.h in the "Dev" archives
contain (possibly) build-specific options.

GK> I didn't find any good documentation on "mswu" and "mswud".

We do need better instructions for using binaries. I wrote this

http://wxwidgets.blogspot.com/2012/08/how-to-use-294-wxmsw-binaries.html

for wxMSW but we don't have anything for MinGW, apparently. Anyhow, you
need to add the lib/gcc_lib/mswu[d] directory to your include paths when
building your code.

Gunter Königsmann

unread,
Dec 6, 2017, 1:26:50 PM12/6/17
to wx-users

for wxMSW but we don't have anything for MinGW, apparently. Anyhow, you
need to add the lib/gcc_lib/mswu[d] directory to your include paths when
building your code.

That did the trick => When using TDMGCC 5.10/64 Bit the following is necessary to build an application:
  • Download and extract the headers.
  • The archive with the header files also contains three .cpp files. Delete them before your IDE finds them, adds them to your project and chokes on them.
  • As soon as the headers are in the include path the IDE of your choice will protest that there is no setup.h file.
  • The headers actually come with a msvc folder containing an setup.h file. Completely ignore this file. And don't tell the compiler about its existence. This is important. Else you will get a .exe file that crashes immediately on start.
  • Download and extract the dlls for the release. If you want to build a release you'll have to copy the .dll files you find here to the folder the .exe file of the release will end up in. If it cannot find the .dll files the .exe will crash on startup without telling you why; Add the directory the .dll files are in to the linker path and tell the linker to link these files with the application.
  • Extracting the dlls for the release still won't provide you with a valid setup.h file and therefore at this point you won't be able to compile anything.
  • Download and extract the dlls for the debug build. These files come with an folder named "libmswu" that contains the wx/setup.h file you'll have to add to your compiler's include path if you want to build a release and a "libmswud" folder that contains the wx/setup.h file you'll have to add to the compiler's include path if you want to build a debug build.
  • If you have built a debug build of your application copy the debug .dlls to the folder the respective .exe is in. If the .exe file doesn't find the .dll files it won't start but won't tell you why; Add the directory with the .dll files to the linker path and tell the linker to link these files with the application.

Afterwards the application the compiler outputs works fine. Tried this with wxMaxima, with another application I have written myself and with the minimal example.

Vadim Zeitlin

unread,
Dec 6, 2017, 4:15:28 PM12/6/17
to wx-u...@googlegroups.com
On Wed, 6 Dec 2017 10:26:49 -0800 (PST) Gunter Königsmann wrote:

GK> When using TDMGCC 5.10/64 Bit the following is
GK> necessary to build an application:
GK>
GK> - Download and extract the headers.
GK> - The archive with the header files also contains three .cpp files.
GK> Delete them before your IDE finds them, adds them to your project and
GK> chokes on them.

It really shouldn't be necessary to delete anything, these files can be
used by some code. I do hope that IDE smart enough to add files to the
project automatically (please let me know which one is this, so that I
could avoid recommending it accidentally) also provides a way to remove
them from project without deleting them.

GK> - As soon as the headers are in the include path the IDE of your choice
GK> will protest that there is no setup.h file.

I want to use this IDE less and less...

GK> - The headers actually come with a msvc folder containing an setup.h
GK> file. Completely ignore this file. And don't tell the compiler about its
GK> existence. This is important. Else you will get a .exe file that crashes
GK> immediately on start.

You should indeed just ignore it (luckily this doesn't require any extra
effort), but using it should result in compile-time errors, not crashes.
I'm really not sure how did you manage to compile using this file.

GK> - Download and extract the dlls for the release. If you want to
GK> build a release you'll have to copy the .dll files you find here to
GK> the folder the .exe file of the release will end up in.

You can also copy them in any directory on your PATH or, sometimes
simpler, just run your .exe from the directory containing these DLLs.

GK> If it cannot find the .dll files the .exe will crash on startup
GK> without telling you why;

This is really suspicious, how do you launch it? If you run it from
Explorer (and not, say, Cygwin command line), it should tell that a
dependent DLL is not found. If you do use Cygwin, it's true that it eats
this error message for some reason, but it's a Cygwin "feature" and not
related to wxWidgets in any way.

GK> Add the directory the .dll files are in to the linker path and tell
GK> the linker to link these files with the application.

Just a note: the linker uses .lib files, not the .dll ones.

GK> - Extracting the dlls for the release still won't provide you with a
GK> valid setup.h file and therefore at this point you won't be able to compile
GK> anything.

Yes, DLLs are supposed to be also used for end users/installers. For
development, you need the "Dev" archive, as previously mentioned.

GK> - Download and extract the dlls for the debug build. These files come
GK> with an folder named "libmswu" that contains the wx/setup.h file you'll
GK> have to add to your compiler's include path if you want to build a release
GK> and a "libmswud" folder that contains the wx/setup.h file you'll have to
GK> add to the compiler's include path if you want to build a debug build.

I think it must be a mistake... I'm not sure why are the headers included
in the debug DLL distribution. IMHO they shouldn't, if only for
consistency.

Gunter Königsmann

unread,
Dec 7, 2017, 12:40:13 AM12/7/17
to wx-u...@googlegroups.com
> I want to use this IDE less and less...
>
Well... ...without any setup.h the thing won't compile - and I was
surprised that I got an error message telling me so before even trying
this. But if I could choose the IDE I use I would actually select a
different one, too.

> GK> - The headers actually come with a msvc folder containing an setup.h
> GK> file. Completely ignore this file. And don't tell the compiler about its
> GK> existence. This is important. Else you will get a .exe file that crashes
> GK> immediately on start.
>
> You should indeed just ignore it (luckily this doesn't require any extra
> effort), but using it should result in compile-time errors, not crashes.
> I'm really not sure how did you manage to compile using this file.
TDM-gcc did output an error message, when compiling the minimal example,
at least. But it did output a .o file, return the retval 0 and the .o
file could be linked to an application. the same happens if I include an
#error in my source code.

>
> GK> If it cannot find the .dll files the .exe will crash on startup
> GK> without telling you why;
>
> This is really suspicious, how do you launch it? If you run it from
> Explorer (and not, say, Cygwin command line), it should tell that a
> dependent DLL is not found. If you do use Cygwin, it's true that it eats
> this error message for some reason, but it's a Cygwin "feature" and not
> related to wxWidgets in any way.
I double-clicked on the file - and used TDM-gcc. But slowly I am
beginning to suspect that the windows computer I had access to is
broken: On missing DLL files I nearly never get any warnings.
>
> GK> Add the directory the .dll files are in to the linker path and tell
> GK> the linker to link these files with the application.
>
> GK> - Download and extract the dlls for the debug build. These files come
> GK> with an folder named "libmswu" that contains the wx/setup.h file you'll
> GK> have to add to your compiler's include path if you want to build a release
> GK> and a "libmswud" folder that contains the wx/setup.h file you'll have to
> GK> add to the compiler's include path if you want to build a debug build.
>
> I think it must be a mistake... I'm not sure why are the headers included
> in the debug DLL distribution. IMHO they shouldn't, if only for
> consistency.
>
That was the second reason why I wrote my last mail: I wasn't sure about
this, neither. The first one was that I wanted to describe how I
succeeded compiling the application (even if I am sure that the 1st
attempt won't use the optimal way).

Kind regards,

Gunter.
Reply all
Reply to author
Forward
0 new messages