Author Topic: try to build wxWidget hello-world  (Read 4181 times)

Offline MoonKid

  • Almost regular
  • **
  • Posts: 180
try to build wxWidget hello-world
« on: April 05, 2006, 04:28:30 pm »
I try to compile a wxWidget hello-world example. No it compiles and links without any errors, but there is no exe.

Here is the build log
<log>
-------------- Build: default in Octopus Backup ---------------
mingw32-g++.exe -LC:\wxWidgets-2.6.3\lib\gcc_dll -LC:\MinGW\lib  -o E:\Garage\projekte\OctopusBackup\OctopusBackup.exe .objs\libzip\lib\zip_fread.o .objs\OctopusBackup.o .objs\libzip\lib\mkstemp.o .objs\libzip\lib\zip_add.o .objs\libzip\lib\zip_close.o .objs\libzip\lib\zip_delete.o .objs\libzip\lib\zip_dirent.o .objs\libzip\lib\zip_entry_free.o .objs\libzip\lib\zip_entry_new.o .objs\libzip\lib\zip_err_str.o .objs\libzip\lib\zip_error.o .objs\libzip\lib\zip_error_get.o .objs\libzip\lib\zip_error_get_sys_type.o .objs\libzip\lib\zip_error_strerror.o .objs\libzip\lib\zip_error_to_str.o .objs\libzip\lib\zip_fclose.o .objs\libzip\lib\zip_file_error_get.o .objs\libzip\lib\zip_file_get_offset.o .objs\libzip\lib\zip_file_strerror.o .objs\libzip\lib\zip_fopen.o .objs\libzip\lib\zip_fopen_index.o .objs\OBCore.o .objs\libzip\lib\zip_free.o .objs\libzip\lib\zip_get_name.o .objs\libzip\lib\zip_get_num_files.o .objs\libzip\lib\zip_name_locate.o .objs\libzip\lib\zip_new.o .objs\libzip\lib\zip_open.o .objs\libzip\lib\zip_rename.o .objs\libzip\lib\zip_replace.o .objs\libzip\lib\zip_set_name.o .objs\libzip\lib\zip_source_buffer.o .objs\libzip\lib\zip_source_file.o .objs\libzip\lib\zip_source_filep.o .objs\libzip\lib\zip_source_free.o .objs\libzip\lib\zip_source_function.o .objs\libzip\lib\zip_source_zip.o .objs\libzip\lib\zip_stat.o .objs\libzip\lib\zip_stat_index.o .objs\libzip\lib\zip_strerror.o .objs\libzip\lib\zip_unchange.o .objs\libzip\lib\zip_unchange_all.o .objs\libzip\lib\zip_unchange_data.o    C:\Programme\GnuWin32\lib\libz.a -lwxmsw26 -lwxexpat
Info: resolving wxAppConsole::ms_appInstance        by linking to __imp___ZN12wxAppConsole14ms_appInstanceE (auto-import)
Info: resolving wxFrame::sm_eventTable       by linking to __imp___ZN7wxFrame13sm_eventTableE (auto-import)
Info: resolving wxStringBase::npos       by linking to __imp___ZN12wxStringBase4nposE (auto-import)
Info: resolving _wxFrameNameStr by linking to __imp__wxFrameNameStr (auto-import)
Info: resolving _wxEmptyString by linking to __imp__wxEmptyString (auto-import)
Info: resolving _wxStatusLineNameStr by linking to __imp__wxStatusLineNameStr (auto-import)
Info: resolving vtable for wxMenuby linking to __imp___ZTV6wxMenu (auto-import)
Info: resolving vtable for wxMenuBaseby linking to __imp___ZTV10wxMenuBase (auto-import)
Info: resolving vtable for wxListBaseby linking to __imp___ZTV10wxListBase (auto-import)
Info: resolving vtable for wxObjectby linking to __imp___ZTV8wxObject (auto-import)
Info: resolving vtable for wxFrameby linking to __imp___ZTV7wxFrame (auto-import)
Info: resolving _wxEVT_COMMAND_MENU_SELECTED by linking to __imp__wxEVT_COMMAND_MENU_SELECTED (auto-import)
Info: resolving _wxEVT_NULL by linking to __imp__wxEVT_NULL (auto-import)
Info: resolving wxAppConsole::ms_appInitFn        by linking to __imp___ZN12wxAppConsole12ms_appInitFnE (auto-import)
Info: resolving vtable for wxwxMenuItemListNodeby linking to __imp___ZTV20wxwxMenuItemListNode (auto-import)
Info: resolving _wxTopLevelWindows by linking to __imp__wxTopLevelWindows (auto-import)
.objs\OctopusBackup.o: In function `ZN8wxObject19ReservedObjectFunc7Ev':
C:/wxWidgets-2.6.3/include/wx/object.h:(.text$_ZN6wxMenuC1El[wxMenu::wxMenu(long)]+0x53): variable 'vtable for wxMenu' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
C:/wxWidgets-2.6.3/include/wx/object.h:(.text$_ZN10wxMenuBaseC2El[wxMenuBase::wxMenuBase(long)]+0x4c): variable 'vtable for wxMenuBase' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
C:/wxWidgets-2.6.3/include/wx/object.h:(.text$_ZN10wxListBaseC2E9wxKeyType[wxListBase::wxListBase(wxKeyType)]+0x45): variable 'vtable for wxListBase' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
C:/wxWidgets-2.6.3/include/wx/object.h:(.text$_ZN8wxObjectD2Ev[wxObject::~wxObject()]+0xb): variable 'vtable for wxObject' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
C:/wxWidgets-2.6.3/include/wx/object.h:(.text$_ZN8wxObjectC2Ev[wxObject::wxObject()]+0x8): variable 'vtable for wxObject' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
C:/wxWidgets-2.6.3/include/wx/object.h:(.text$_ZN7wxFrameC2EP8wxWindowiRK8wxStringRK7wxPointRK6wxSizelS4_[wxFrame::wxFrame(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxString const&)]+0x4c): variable 'vtable for wxFrame' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
C:/wxWidgets-2.6.3/include/wx/object.h:(.text$_ZN20wxwxMenuItemListNodeC1EP10wxListBasePS_S2_P10wxMenuItemRK9wxListKey[wxwxMenuItemListNode::wxwxMenuItemListNode(wxListBase*, wxwxMenuItemListNode*, wxwxMenuItemListNode*, wxMenuItem*, wxListKey const&)]+0x39): variable 'vtable for wxwxMenuItemListNode' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 2 seconds)
0 errors, 0 warnings
</log>

I am using
Code::Blocks 1.0 revision 2062 Build: Feb 23 2006, 03:02:53 - wx2.6.2 (Windows, ANSI)

The code of the example can be found in the wxWidget forum here:
http://wxforum.shadonet.com/viewtopic.php?t=7463

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: try to build wxWidget hello-world
« Reply #1 on: April 05, 2006, 04:42:39 pm »
No, it does not link without errors. It fails to link:
Quote
variable 'vtable for wxwxMenuItemListNode' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.

You have several options to solve this. Either set WXUSINGDLL in the #defines panel in project options, or do not use the wxWidgets DLL, but a static library instead (don't do both!).

More info on this can be found on the FAQ page in our WiKi.

EDIT:
here is the link: http://wiki.codeblocks.org/index.php?title=FAQ#When_compiling_a_wxWidgets_project.2C_I_get_several_.22variable_.27vtable_for_xxxx.27_can.27t_be_auto-imported.22._What.27s_wrong.3F
« Last Edit: April 05, 2006, 04:44:24 pm by thomas »
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline MoonKid

  • Almost regular
  • **
  • Posts: 180
Re: try to build wxWidget hello-world
« Reply #2 on: April 05, 2006, 05:02:18 pm »
set WXUSINGDLL in the #defines panel in project options

Thanks a lot! It works now.