Author Topic: Build C::B linker error: undefined reference to`wxMSLU__wstat(wchar_t const*,...  (Read 5619 times)

Offline zaleksf

  • Single posting newcomer
  • *
  • Posts: 8
I am running Code::Blocks version svn9378 on Windows 7_x64.

The compiler I use is Mingw-w64 i686-4.9.2-release-win32-sjlj-rt_v3-rev0.

I am attempting to build a 32-bit Code::Blocks version svn10036 using wxWidgets 3.0.2+ (WX_3_0_BRANCH). WxWidgets built successfully with the Mingw-w64 compiler.

The build continues until a linker error with the sdk. Please see the build log listed below.

Build log:
Code
-------------- Build: tinyXML in Code::Blocks wx3.0.x (compiler: GNU GCC Compiler)---------------

i686-w64-mingw32-g++.exe -Wall C:\CodeLib\CodeBlocks -pipe -mthreads -fmessage-length=0 -fexceptions -std=gnu++11 -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DNOPCH -DwxUSE_UNICODE -std=c++11 -IC:\CodeLib\wxWidgets\WX_3_0_BRANCH\include -IC:\CodeLib\wxWidgets\WX_3_0_BRANCH\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude\tinyxml -c C:\CodeLib\CodeBlocks\src\base\tinyxml\tinystr.cpp -o .objs30\base\tinyxml\tinystr.o
i686-w64-mingw32-g++.exe: warning: C:\CodeLib\CodeBlocks: linker input file unused because linking not done
i686-w64-mingw32-g++.exe -Wall C:\CodeLib\CodeBlocks -pipe -mthreads -fmessage-length=0 -fexceptions -std=gnu++11 -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DNOPCH -DwxUSE_UNICODE -std=c++11 -IC:\CodeLib\wxWidgets\WX_3_0_BRANCH\include -IC:\CodeLib\wxWidgets\WX_3_0_BRANCH\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude\tinyxml -c C:\CodeLib\CodeBlocks\src\base\tinyxml\tinyxml.cpp -o .objs30\base\tinyxml\tinyxml.o
i686-w64-mingw32-g++.exe: warning: C:\CodeLib\CodeBlocks: linker input file unused because linking not done
i686-w64-mingw32-g++.exe -Wall C:\CodeLib\CodeBlocks -pipe -mthreads -fmessage-length=0 -fexceptions -std=gnu++11 -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DNOPCH -DwxUSE_UNICODE -std=c++11 -IC:\CodeLib\wxWidgets\WX_3_0_BRANCH\include -IC:\CodeLib\wxWidgets\WX_3_0_BRANCH\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude\tinyxml -c C:\CodeLib\CodeBlocks\src\base\tinyxml\tinyxmlerror.cpp -o .objs30\base\tinyxml\tinyxmlerror.o
i686-w64-mingw32-g++.exe: warning: C:\CodeLib\CodeBlocks: linker input file unused because linking not done

...
...

-------------- Build: sdk in Code::Blocks wx3.0.x (compiler: GNU GCC Compiler)---------------

i686-w64-mingw32-g++.exe -Wall C:\CodeLib\CodeBlocks -pipe -mthreads -fmessage-length=0 -fexceptions -std=gnu++11 -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DNOPCH -DwxUSE_UNICODE -Woverloaded-virtual -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -std=c++11 -IC:\CodeLib\wxWidgets\WX_3_0_BRANCH\include -IC:\CodeLib\wxWidgets\WX_3_0_BRANCH\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\tinyxml -Iinclude\scripting\bindings -Iinclude\scripting\include -Iinclude\scripting\sqplus -Iinclude\mozilla_chardet -Iinclude\mozilla_chardet\mfbt -Iinclude\mozilla_chardet\nsprpub\pr\include -Iinclude\mozilla_chardet\xpcom -Iinclude\mozilla_chardet\xpcom\base -Iinclude\mozilla_chardet\xpcom\glue -c C:\CodeLib\CodeBlocks\src\sdk\configmanager-revision.cpp -o .objs30\sdk\configmanager-revision.o

...
...

i686-w64-mingw32-g++.exe -Wall C:\CodeLib\CodeBlocks -pipe -mthreads -fmessage-length=0 -fexceptions -std=gnu++11 -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DNOPCH -DwxUSE_UNICODE -Woverloaded-virtual -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -std=c++11 -IC:\CodeLib\wxWidgets\WX_3_0_BRANCH\include -IC:\CodeLib\wxWidgets\WX_3_0_BRANCH\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\tinyxml -Iinclude\scripting\bindings -Iinclude\scripting\include -Iinclude\scripting\sqplus -Iinclude\mozilla_chardet -Iinclude\mozilla_chardet\mfbt -Iinclude\mozilla_chardet\nsprpub\pr\include -Iinclude\mozilla_chardet\xpcom -Iinclude\mozilla_chardet\xpcom\base -Iinclude\mozilla_chardet\xpcom\glue -c C:\CodeLib\CodeBlocks\src\sdk\toolsmanager.cpp -o .objs30\sdk\toolsmanager.o
i686-w64-mingw32-g++.exe: warning: C:\CodeLib\CodeBlocks: linker input file unused because linking not done
i686-w64-mingw32-g++.exe -Wall C:\CodeLib\CodeBlocks -pipe -mthreads -fmessage-length=0 -fexceptions -std=gnu++11 -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DNOPCH -DwxUSE_UNICODE -Woverloaded-virtual -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -std=c++11 -IC:\CodeLib\wxWidgets\WX_3_0_BRANCH\include -IC:\CodeLib\wxWidgets\WX_3_0_BRANCH\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\tinyxml -Iinclude\scripting\bindings -Iinclude\scripting\include -Iinclude\scripting\sqplus -Iinclude\mozilla_chardet -Iinclude\mozilla_chardet\mfbt -Iinclude\mozilla_chardet\nsprpub\pr\include -Iinclude\mozilla_chardet\xpcom -Iinclude\mozilla_chardet\xpcom\base -Iinclude\mozilla_chardet\xpcom\glue -c C:\CodeLib\CodeBlocks\src\sdk\uservarmanager.cpp -o .objs30\sdk\uservarmanager.o
i686-w64-mingw32-g++.exe: warning: C:\CodeLib\CodeBlocks: linker input file unused because linking not done
i686-w64-mingw32-g++.exe -Wall C:\CodeLib\CodeBlocks -pipe -mthreads -fmessage-length=0 -fexceptions -std=gnu++11 -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DNOPCH -DwxUSE_UNICODE -Woverloaded-virtual -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -std=c++11 -IC:\CodeLib\wxWidgets\WX_3_0_BRANCH\include -IC:\CodeLib\wxWidgets\WX_3_0_BRANCH\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\tinyxml -Iinclude\scripting\bindings -Iinclude\scripting\include -Iinclude\scripting\sqplus -Iinclude\mozilla_chardet -Iinclude\mozilla_chardet\mfbt -Iinclude\mozilla_chardet\nsprpub\pr\include -Iinclude\mozilla_chardet\xpcom -Iinclude\mozilla_chardet\xpcom\base -Iinclude\mozilla_chardet\xpcom\glue -c C:\CodeLib\CodeBlocks\src\sdk\workspaceloader.cpp -o .objs30\sdk\workspaceloader.o
In file included from include/cbauibook.h:10:0,
                 from C:\CodeLib\CodeBlocks\src\sdk\workspaceloader.cpp:27:
C:\CodeLib\wxWidgets\WX_3_0_BRANCH\include/wx/aui/auibook.h:349:18: warning: 'virtual bool wxAuiNotebook::AddPage(wxWindow*, const wxString&, bool, int)' was hidden [-Woverloaded-virtual]
     virtual bool AddPage(wxWindow *page, const wxString &text, bool select,
                  ^
In file included from C:\CodeLib\CodeBlocks\src\sdk\workspaceloader.cpp:27:0:
include/cbauibook.h:138:14: warning:   by 'bool cbAuiNotebook::AddPage(wxWindow*, const wxString&, bool, const wxBitmap&)' [-Woverloaded-virtual]
         bool AddPage(wxWindow* page,
              ^
In file included from include/cbauibook.h:10:0,
                 from C:\CodeLib\CodeBlocks\src\sdk\workspaceloader.cpp:27:
C:\CodeLib\wxWidgets\WX_3_0_BRANCH\include/wx/aui/auibook.h:352:18: warning: 'virtual bool wxAuiNotebook::InsertPage(size_t, wxWindow*, const wxString&, bool, int)' was hidden [-Woverloaded-virtual]
     virtual bool InsertPage(size_t index, wxWindow *page, const wxString &text,
                  ^
In file included from C:\CodeLib\CodeBlocks\src\sdk\workspaceloader.cpp:27:0:
include/cbauibook.h:153:14: warning:   by 'bool cbAuiNotebook::InsertPage(size_t, wxWindow*, const wxString&, bool, const wxBitmap&)' [-Woverloaded-virtual]
         bool InsertPage(size_t page_idx,
              ^
i686-w64-mingw32-g++.exe: warning: C:\CodeLib\CodeBlocks: linker input file unused because linking not done
i686-w64-mingw32-g++.exe -Wall C:\CodeLib\CodeBlocks -pipe -mthreads -fmessage-length=0 -fexceptions -std=gnu++11 -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DNOPCH -DwxUSE_UNICODE -Woverloaded-virtual -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -std=c++11 -IC:\CodeLib\wxWidgets\WX_3_0_BRANCH\include -IC:\CodeLib\wxWidgets\WX_3_0_BRANCH\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\tinyxml -Iinclude\scripting\bindings -Iinclude\scripting\include -Iinclude\scripting\sqplus -Iinclude\mozilla_chardet -Iinclude\mozilla_chardet\mfbt -Iinclude\mozilla_chardet\nsprpub\pr\include -Iinclude\mozilla_chardet\xpcom -Iinclude\mozilla_chardet\xpcom\base -Iinclude\mozilla_chardet\xpcom\glue -c C:\CodeLib\CodeBlocks\src\sdk\xtra_res.cpp -o .objs30\sdk\xtra_res.o
i686-w64-mingw32-g++.exe: warning: C:\CodeLib\CodeBlocks: linker input file unused because linking not done
i686-w64-mingw32-g++.exe -shared  -Wl,--out-implib=devel30\libcodeblocks.a -Wl,--dll -Lbase\tinyxml -LC:\CodeLib\wxWidgets\WX_3_0_BRANCH\lib\gcc_dll -Ldevel30 -Lsdk\scripting\lib .objs30\sdk\configmanager-revision.o .objs30\base\tinyxml\tinywxuni.o .objs30\sdk\annoyingdialog.o .objs30\sdk\autodetectcompilers.o .objs30\sdk\base64.o .objs30\sdk\blockallocated.o .objs30\sdk\cbauibook.o .objs30\sdk\cbcolourmanager.o .objs30\sdk\cbdebugger_interfaces.o .objs30\sdk\cbeditor.o .objs30\sdk\cbeditorprintout.o .objs30\sdk\cbexception.o .objs30\sdk\cbplugin.o .objs30\sdk\cbproject.o .objs30\sdk\cbstatusbar.o .objs30\sdk\cbstyledtextctrl.o .objs30\sdk\cbthreadpool.o .objs30\sdk\cbtreectrl.o .objs30\sdk\cbworkspace.o .objs30\sdk\ccmanager.o .objs30\sdk\compileoptionsbase.o .objs30\sdk\compiler.o .objs30\sdk\compilercommandgenerator.o .objs30\sdk\compilerfactory.o .objs30\sdk\compileroptions.o .objs30\sdk\compiletargetbase.o .objs30\sdk\configmanager.o .objs30\sdk\configurationpanel.o .objs30\sdk\configuretoolsdlg.o .objs30\sdk\confirmreplacedlg.o .objs30\sdk\crc32.o .objs30\sdk\debuggermanager.o .objs30\sdk\editarrayfiledlg.o .objs30\sdk\editarrayorderdlg.o .objs30\sdk\editarraystringdlg.o .objs30\sdk\editor_hooks.o .objs30\sdk\editorbase.o .objs30\sdk\editorcolourset.o .objs30\sdk\editorlexerloader.o .objs30\sdk\editormanager.o .objs30\sdk\editpairdlg.o .objs30\sdk\editpathdlg.o .objs30\sdk\edittooldlg.o .objs30\sdk\encodingdetector.o .objs30\sdk\externaldepsdlg.o .objs30\sdk\filefilters.o .objs30\sdk\filegroupsandmasks.o .objs30\sdk\filemanager.o .objs30\sdk\findreplacedlg.o .objs30\sdk\genericmultilinenotesdlg.o .objs30\sdk\globals.o .objs30\sdk\importers_globals.o .objs30\sdk\incrementalselectlistdlg.o .objs30\sdk\infowindow.o .objs30\sdk\loggers.o .objs30\sdk\logmanager.o .objs30\sdk\macrosmanager.o .objs30\sdk\managedthread.o .objs30\sdk\manager.o .objs30\sdk\menuitemsmanager.o .objs30\sdk\mozilla_chardet\src\CharDistribution.o .objs30\sdk\mozilla_chardet\src\JpCntx.o .objs30\sdk\mozilla_chardet\src\LangBulgarianModel.o .objs30\sdk\mozilla_chardet\src\LangCyrillicModel.o .objs30\sdk\mozilla_chardet\src\LangGreekModel.o .objs30\sdk\mozilla_chardet\src\LangHebrewModel.o .objs30\sdk\mozilla_chardet\src\LangHungarianModel.o .objs30\sdk\mozilla_chardet\src\LangThaiModel.o .objs30\sdk\mozilla_chardet\src\nsBig5Prober.o .objs30\sdk\mozilla_chardet\src\nsCharSetProber.o .objs30\sdk\mozilla_chardet\src\nsEscCharsetProber.o .objs30\sdk\mozilla_chardet\src\nsEscSM.o .objs30\sdk\mozilla_chardet\src\nsEUCJPProber.o .objs30\sdk\mozilla_chardet\src\nsEUCKRProber.o .objs30\sdk\mozilla_chardet\src\nsEUCTWProber.o .objs30\sdk\mozilla_chardet\src\nsGB2312Prober.o .objs30\sdk\mozilla_chardet\src\nsHebrewProber.o .objs30\sdk\mozilla_chardet\src\nsLatin1Prober.o .objs30\sdk\mozilla_chardet\src\nsMBCSGroupProber.o .objs30\sdk\mozilla_chardet\src\nsMBCSSM.o .objs30\sdk\mozilla_chardet\src\nsSBCharSetProber.o .objs30\sdk\mozilla_chardet\src\nsSBCSGroupProber.o .objs30\sdk\mozilla_chardet\src\nsSJISProber.o .objs30\sdk\mozilla_chardet\src\nsUniversalDetector.o .objs30\sdk\mozilla_chardet\src\nsUTF8Prober.o .objs30\sdk\multiselectdlg.o .objs30\sdk\newfromtemplatedlg.o .objs30\sdk\personalitymanager.o .objs30\sdk\pipedprocess.o .objs30\sdk\pluginmanager.o .objs30\sdk\pluginsconfigurationdlg.o .objs30\sdk\printing_types.o .objs30\sdk\projectbuildtarget.o .objs30\sdk\projectfile.o .objs30\sdk\projectfileoptionsdlg.o .objs30\sdk\projectlayoutloader.o .objs30\sdk\projectloader.o .objs30\sdk\projectloader_hooks.o .objs30\sdk\projectmanager.o .objs30\sdk\projectsfilemasksdlg.o .objs30\sdk\projecttemplateloader.o .objs30\sdk\scripting\bindings\sc_consts.o .objs30\sdk\scripting\bindings\sc_dialog.o .objs30\sdk\scripting\bindings\sc_globals.o .objs30\sdk\scripting\bindings\sc_io.o .objs30\sdk\scripting\bindings\sc_plugin.o .objs30\sdk\scripting\bindings\sc_progress.o .objs30\sdk\scripting\bindings\sc_util_dialogs.o .objs30\sdk\scripting\bindings\sc_wxtypes.o .objs30\sdk\scripting\bindings\scriptbindings.o .objs30\sdk\scriptingmanager.o .objs30\sdk\scriptsecuritywarningdlg.o .objs30\sdk\scrollingdialog.o .objs30\sdk\sdk_events.o .objs30\sdk\searchresultslog.o .objs30\sdk\selecttargetdlg.o .objs30\sdk\templatemanager.o .objs30\sdk\toolsmanager.o .objs30\sdk\uservarmanager.o .objs30\sdk\workspaceloader.o .objs30\sdk\xtra_res.o  -o devel30\codeblocks.dll -Wl,--enable-auto-image-base -Wl,--export-all-symbols -Wl,--add-stdcall-alias -Wl,--enable-auto-import -Wl,--no-undefined  -lshfolder -ltxml30 -lwxscintilla_cb -lsqplus30 -lsqstdlib30 -lsquirrel30 -lgdi32 -lwxmsw30u
.objs30\sdk\filemanager.o:filemanager.cpp:(.text$_Z7wxLstatRK8wxStringP8_stati64[__Z7wxLstatRK8wxStringP8_stati64]+0x1b): undefined reference to `wxMSLU__wstat(wchar_t const*, _stati64*)'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (6 minute(s), 25 second(s))
1 error(s), 322 warning(s) (6 minute(s), 25 second(s))

I have added/removed different combinations of the CXX flag -std=c++11 (check box) and -std=gnu++11 (manual entry), but that does not help.

Any thoughts on how to resolve this would be greatly appreciated - thanks.


Offline Scr3amer

  • Multiple posting newcomer
  • *
  • Posts: 16
Hello dude,

I compiled wxWidget 3.0.2 and C::B rev 10529 with MinGW64 4.9.3 SEH POSIX and I had same error.
That only means the linker cannot find the function in the library.
I am currently reading the source of wx to see if they changed the name of that function. If it is the case, we will have to change it too in C::B source code. Maybe that is a deprecated function from 2.8.6 ...

When I will have more information, I will be back in case that helps someone else.

EDIT :
Something weird, I cannot find where this function is called in C::B source, nothing in filemanager.cpp or .h
« Last Edit: October 16, 2015, 04:33:08 am by Scr3amer »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9662
If you want to build C::B I strongly suggest you use the recommended compiler (which is TDM-GCC).

We cannot and will not verify that C::B will compile against each and every MinGW / GCC branch (you know how many are out there... do you?!). This might very well be an error in the MinGW version you are using.

Check the nightlies what we use to compile C::B.

Furthermore you seem to have manipulated the sources as this part of the compiler line:
Code
-Wall C:\CodeLib\CodeBlocks
Will not come from the original C::B project files and is plain wrong.

As we don't know what other errors you've introduced I'm afraid you are on your own.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7339
    • My Best Post
The error is likely because the OP used the wrong options to build wx3.0; I got a like error till I added the options I use to build wxWidgets 3.0.

Quote
wxWidgets built with my new normal options of
CPPFLAGS="-DHAVE_TR1_TYPE_TRAITS"
CXXFLAGS="-Wno-unused-local-typedefs -fno-keep-inline-dllexport"

NOTE: The define HAVE_TR1_TYPE_TRAITS must be valid for the Compiler you are using or the error will just change!

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