Undefined reference to wxHtmlWindowMouseHelper Topic is solved
Undefined reference to wxHtmlWindowMouseHelper
I'm working on Windows 10 on a GUI project in C::B 17.12 using wxWIdgets 3.1.3, Shared=0 unicode=1 When I add and HtmlWindow and compile I get 2 errors:
Undefined reference to wxHtmlWindowMouseHelper::wxHtmlWindowMouseHelper(wxHtmlWindowInterface)
Undefined refernce to vtable for wxHtmlWindow
It compiles fine without the HtmlWindow
any help would be appreciated.
Undefined reference to wxHtmlWindowMouseHelper::wxHtmlWindowMouseHelper(wxHtmlWindowInterface)
Undefined refernce to vtable for wxHtmlWindow
It compiles fine without the HtmlWindow
any help would be appreciated.
Re: Undefined reference to wxHtmlWindowMouseHelper
Did you link to the correct library?
What compiler are you using?
NOTE: Code::Blocks is not a compiler!
Post the linker error with the linker command from the build log window.
Tim S.
What compiler are you using?
NOTE: Code::Blocks is not a compiler!
Post the linker error with the linker command from the build log window.
Tim S.
Re: Undefined reference to wxHtmlWindowMouseHelper
Sorry for the stupid question, but: Did you add (and in the correct order) the wxHTML library, i.e. libwxmsw31u_html.a for the Release and libwxmsw31ud_html.a for the Debug build configurations in Code::Blocks' Project Build Options in Linker Settings / Link Libraries?
Re: Undefined reference to wxHtmlWindowMouseHelper
Hi,
You should add the appropriate library to the "Linker" options.
But I am curious - why do you need to use an undocumented class in your program?
Thank you.
You should add the appropriate library to the "Linker" options.
But I am curious - why do you need to use an undocumented class in your program?
Thank you.
Re: Undefined reference to wxHtmlWindowMouseHelper
He likely did not; that wxHtmlWindowMouseHelper class is a helper class that is needed
to use the documented class of wxHtmlWindow.
From wx/htmlwin.h
Code: Select all
wxHtmlWindow() : wxHtmlWindowMouseHelper(this) { Init(); }
Re: Undefined reference to wxHtmlWindowMouseHelper
Thanks for all of your responses. These are the libraries I linked in the order they are linked
liboleacc.a
libuxtheme.a
libwxmsw31u_html.a
here's my build log
This has been driving me nuts so I appreciate any help. Thanks
liboleacc.a
libuxtheme.a
libwxmsw31u_html.a
here's my build log
Code: Select all
-------------- Build: Release in Acorn (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -O2 -IC:\wxWidgets-3.1.3\include -IC:\wxWidgets-3.1.3\lib\gcc_lib\mswu -IC:\wxWidgets-3.1.3\lib\gcc_lib\mswu -IC:\wxWidgets-3.1.3\include -c I:\Acorn\AcornApp.cpp -o I:\Acorn\obj\release\AcornApp.o
mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -O2 -IC:\wxWidgets-3.1.3\include -IC:\wxWidgets-3.1.3\lib\gcc_lib\mswu -IC:\wxWidgets-3.1.3\lib\gcc_lib\mswu -IC:\wxWidgets-3.1.3\include -c I:\Acorn\AcornMain.cpp -o I:\Acorn\obj\release\AcornMain.o
mingw32-g++.exe -LC:\wxWidgets-3.1.3\lib\gcc_lib -o I:\Acorn\bin\release\Acorn.exe I:\Acorn\obj\release\AcornApp.o I:\Acorn\obj\release\AcornMain.o I:\Acorn\obj\release\convertDBHtoStump.o I:\Acorn\obj\release\csv.o I:\Acorn\obj\release\CSVexport.o I:\Acorn\obj\release\height5.o I:\Acorn\obj\release\main.o I:\Acorn\obj\release\openfile.o I:\Acorn\obj\release\probsurv5.o I:\Acorn\obj\release\readadrepnewformat.o I:\Acorn\obj\release\readstumpnewformat.o I:\Acorn\obj\release\reproDBH10.o I:\Acorn\obj\release\reproDBH21.o I:\Acorn\obj\release\stumpDBH10.o I:\Acorn\obj\release\stumpDBH21.o I:\Acorn\obj\release\icon.res I:\Acorn\obj\release\resource.res -s -mthreads -lwxmsw31u_core -lwxbase31u -lwxpng -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -lshlwapi -lversion -lwxjpeg -lwxtiff -loleacc -luxtheme -lwxmsw31u_html -mwindows
I:\Acorn\AcornApp.cpp: In member function 'virtual bool AcornApp::OnInit()':
I:\Acorn\AcornApp.cpp:32:21: warning: unused variable 'splash' [-Wunused-variable]
wxSplashScreen* splash = new wxSplashScreen(bitmap,
^
C:\wxWidgets-3.1.3\lib\gcc_lib/libwxmsw31u_html.a(htmllib_htmlwin.o):htmlwin.cpp:(.text+0x2be4): undefined reference to `wxFileSystem::FileNameToURL(wxFileName const&)'
C:\wxWidgets-3.1.3\lib\gcc_lib/libwxmsw31u_html.a(htmllib_htmlwin.o):htmlwin.cpp:(.text+0x32cb): undefined reference to `wxFileSystem::ChangePathTo(wxString const&, bool)'
C:\wxWidgets-3.1.3\lib\gcc_lib/libwxmsw31u_html.a(htmllib_htmlwin.o):htmlwin.cpp:(.text+0x3e0b): undefined reference to `wxFileSystem::FileNameToURL(wxFileName const&)'
C:/Program Files (x86)/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/5.1.0/../../../../mingw32/bin/ld.exe: C:\wxWidgets-3.1.3\lib\gcc_lib/libwxmsw31u_html.a(htmllib_htmlwin.o): bad reloc address 0x30c in section `.rdata'
C:/Program Files (x86)/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/5.1.0/../../../../mingw32/bin/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 10 second(s))
4 error(s), 1 warning(s) (0 minute(s), 10 second(s))
Re: Undefined reference to wxHtmlWindowMouseHelper
Well, it seems your wxHTML library is invalid?gismo wrote: ↑Mon May 11, 2020 2:31 am here's my build logCode: Select all
-------------- Build: Release in Acorn (compiler: GNU GCC Compiler)--------------- C:/Program Files (x86)/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/5.1.0/../../../../mingw32/bin/ld.exe: C:\wxWidgets-3.1.3\lib\gcc_lib/libwxmsw31u_html.a(htmllib_htmlwin.o): bad reloc address 0x30c in section `.rdata'
I would also move the HTML library before core one, i.e., the order of wxWidgets libraries would be: html, core, base, others
Re: Undefined reference to wxHtmlWindowMouseHelper
PB thanks for your reply. Yeah I thought originally that it might be the library order so I tried putting it in all possible orders and none worked.
I did successfully compile and run the sample wxHtmlEasyPrinting code with no issues in the order I have listed so I thought the library was fine.
I did successfully compile and run the sample wxHtmlEasyPrinting code with no issues in the order I have listed so I thought the library was fine.
Re: Undefined reference to wxHtmlWindowMouseHelper
Hi
So can you look at the command that the sample build produces and do the same here in your project?
Thank you.
So can you look at the command that the sample build produces and do the same here in your project?
Thank you.
Re: Undefined reference to wxHtmlWindowMouseHelper
So I did what ONEEYEMAN suggested. Here's how I compiled:
And this is the error I got
Code: Select all
mingw32-g++.exe -LC:\wxWidgets-3.1.3\lib\gcc_lib -o I:\Acorn\bin\release\Acorn.exe I:\Acorn\obj\release\AcornApp.o I:\Acorn\obj\release\AcornMain.o I:\Acorn\obj\release\convertDBHtoStump.o I:\Acorn\obj\release\csv.o I:\Acorn\obj\release\CSVexport.o I:\Acorn\obj\release\height5.o I:\Acorn\obj\release\main.o I:\Acorn\obj\release\openfile.o I:\Acorn\obj\release\probsurv5.o I:\Acorn\obj\release\readadrepnewformat.o I:\Acorn\obj\release\readstumpnewformat.o I:\Acorn\obj\release\reproDBH10.o I:\Acorn\obj\release\reproDBH21.o I:\Acorn\obj\release\stumpDBH10.o I:\Acorn\obj\release\stumpDBH21.o I:\Acorn\obj\release\icon.res I:\Acorn\obj\release\resource.res -s -mthreads -lwxmsw31u_html -lwxmsw31u_core -lwxbase31u -lwxpng -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -lshlwapi -lversion -lwxmsw31u_html -loleacc -luxtheme -lwxjpeg
Code: Select all
C:/Program Files (x86)/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/5.1.0/../../../../mingw32/bin/ld.exe: C:\wxWidgets-3.1.3\lib\gcc_lib/libwxmsw31u_core.a(corelib_imagtiff.o): bad reloc address 0xac in section `.rdata'
C:/Program Files (x86)/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/5.1.0/../../../../mingw32/bin/ld.exe: final link failed: Invalid operation
C:\wxWidgets-3.1.3\lib\gcc_lib/libwxmsw31u_core.a(corelib_imagtiff.o):imagtiff.cpp:(.text+0xadb): undefined reference to `TIFFSetWarningHandler'
C:\wxWidgets-3.1.3\lib\gcc_lib/libwxmsw31u_core.a(corelib_imagtiff.o):imagtiff.cpp:(.text+0xae7): undefined reference to `TIFFSetErrorHandler'
Re: Undefined reference to wxHtmlWindowMouseHelper
disregard my previous reply I ned to recompile
Re: Undefined reference to wxHtmlWindowMouseHelper
Ok so I compiles with the above code and added -lwxtiff -mwindows at the end and it ran.
Thanks for all your help
Thanks for all your help