User forums > Help
undefined reference to `wxAppConsole::CreateLogTarget()
stahta01:
@IsiPrimax
If after changing target to "release" and a full re-build does not fix the problem, please post the code in testMain.cpp.
Tim S
IsiPrimax:
I have try, but 3 Fails.
--- Code: ---/***************************************************************
* Name: testMain.cpp
* Purpose: Code for Application Frame
* Created: 2007-10-31
* License:
**************************************************************/
#include "testMain.h"
#include <wx/msgdlg.h>
//(*InternalHeaders(testFrame)
#include <wx/intl.h>
#include <wx/string.h>
//*)
//helper functions
enum wxbuildinfoformat {
short_f, long_f };
wxString wxbuildinfo(wxbuildinfoformat format)
{
wxString wxbuild(wxVERSION_STRING);
if (format == long_f )
{
#if defined(__WXMSW__)
wxbuild << _T("-Windows");
#elif defined(__UNIX__)
wxbuild << _T("-Linux");
#endif
#if wxUSE_UNICODE
wxbuild << _T("-Unicode build");
#else
wxbuild << _T("-ANSI build");
#endif // wxUSE_UNICODE
}
return wxbuild;
}
//(*IdInit(testFrame)
const long testFrame::idMenuQuit = wxNewId();
const long testFrame::idMenuAbout = wxNewId();
const long testFrame::ID_STATUSBAR1 = wxNewId();
//*)
BEGIN_EVENT_TABLE(testFrame,wxFrame)
//(*EventTable(testFrame)
//*)
END_EVENT_TABLE()
testFrame::testFrame(wxWindow* parent,wxWindowID id)
{
//(*Initialize(testFrame)
wxMenuItem* MenuItem2;
wxMenuItem* MenuItem1;
wxMenu* Menu1;
wxMenuBar* MenuBar1;
wxMenu* Menu2;
Create(parent, id, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("id"));
MenuBar1 = new wxMenuBar();
Menu1 = new wxMenu();
MenuItem1 = new wxMenuItem(Menu1, idMenuQuit, _("Quit\tAlt-F4"), _("Quit the application"), wxITEM_NORMAL);
Menu1->Append(MenuItem1);
MenuBar1->Append(Menu1, _("&File"));
Menu2 = new wxMenu();
MenuItem2 = new wxMenuItem(Menu2, idMenuAbout, _("About\tF1"), _("Show info about this application"), wxITEM_NORMAL);
Menu2->Append(MenuItem2);
MenuBar1->Append(Menu2, _("Help"));
SetMenuBar(MenuBar1);
StatusBar1 = new wxStatusBar(this, ID_STATUSBAR1, 0, _T("ID_STATUSBAR1"));
int __wxStatusBarWidths_0[1] = { -1 };
int __wxStatusBarStyles_0[1] = { wxSB_NORMAL };
StatusBar1->SetFieldsCount(1,__wxStatusBarWidths_0);
StatusBar1->SetStatusStyles(1,__wxStatusBarStyles_0);
SetStatusBar(StatusBar1);
Connect(idMenuQuit,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&testFrame::OnQuit);
Connect(idMenuAbout,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&testFrame::OnAbout);
//*)
}
testFrame::~testFrame()
{
//(*Destroy(testFrame)
//*)
}
void testFrame::OnQuit(wxCommandEvent& event)
{
Close();
}
void testFrame::OnAbout(wxCommandEvent& event)
{
wxString msg = wxbuildinfo(long_f);
wxMessageBox(msg, _("Welcome to..."));
}
--- End code ---
My libs:
--- Code: ---under Release -> 3 Fails!?!?!
libwxmsw28u_core.a
libwxbase28u.a
libwxjpeg.a
libwxpng.a
libwxtiff.a
libwxzlib.a
under Debug -> EXE Works
libwxmsw28ud_core.a
libwxbase28ud.a
libwxjpegd.a
libwxpngd.a
libwxtiffd.a
libwxzlibd.a
Other libs ->
libkernel32.a
libuser32.a
libgdi32.a
libwinspool.a
libcomdlg32.a
libadvapi32.a
libshell32.a
libole32.a
liboleaut32.a
libuuid.a
libcomctl32.a
libwsock32.a
libodbc32.a
--- End code ---
Settings
--- Code: ---New Project -> Wx Template -> WX Builder (wxsmith) -> Frame Based -> Enable Unicode
Other settings all Disable.
Last Page enable wxjpeg and wxtiff
--- End code ---
I create new CodeBlocks project and build debug (works) and release (fails).
I use WXpack 2.8.6.02
I try self compiled, debug (work) release not.
ps: sorry for my bad english. my german is better ;D
stahta01:
--- Quote from: IsiPrimax on November 01, 2007, 03:38:20 am ---
I create new CodeBlocks project and build debug (works) and release (fails).
I use WXpack 2.8.6.02
I try self compiled, debug (work) release not.
ps: sorry for my bad english. my german is better ;D
--- End quote ---
Was it monolithic or Multilib build of wxWidgets?
( You info seems to conflict about which build you are trying to use.)
Did you compile both debug and release versions of wxWidgets?
What was the command used to compile wxWidgets?
Tim S
--- Quote from: IsiPrimax on October 31, 2007, 09:32:39 pm ----------------- Build: Release in test ---------------
mingw32-g++.exe -LI:\wxWidgets-2.8.6\lib\gcc_lib -LF:\MinGW\lib -o bin\Release\test.exe obj\Release\testApp.o obj\Release\testMain.o obj\Release\resource.res -s -lwxmsw28u
--- End quote ---
The wxmsw28u library implies Monolithic Build, but the libraries, wxmsw28u_core.a and wxbase28u.a, you listed are for MultiLib build of wxWidgets.
IsiPrimax:
I use wxpack (http://wxpack.sourceforge.net/), give all files.
Debug (ansi)
Debug (unicode)
Release (ansi)
Release (unicode)
I try Tutorial -> http://wxpack.sourceforge.net/Tutorials/CodeBlocksWxWizardGCC
--- Code: ----------------- Build: Release in wxtest2 ---------------
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -Wall -O2 -DWIN32 -D_DEBUG -D_WINDOWS -II:\wxWidgets-2.8.6\include -II:\wxWidgets-2.8.6\contrib\include -II:\wxWidgets-2.8.6\lib\gcc_dll\mswu -IF:\MinGW\include -IF:\cppinclude -c G:\Coden\wx\wxtest2\wx_pch.h -o wx_pch.h.gch\Release_wx_pch_h_gch
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -Wall -O2 -DWIN32 -D_DEBUG -D_WINDOWS -II:\wxWidgets-2.8.6\include -II:\wxWidgets-2.8.6\contrib\include -II:\wxWidgets-2.8.6\lib\gcc_dll\mswu -IF:\MinGW\include -IF:\cppinclude -c G:\Coden\wx\wxtest2\wxtest2App.cpp -o obj\Release\wxtest2App.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -Wall -O2 -DWIN32 -D_DEBUG -D_WINDOWS -II:\wxWidgets-2.8.6\include -II:\wxWidgets-2.8.6\contrib\include -II:\wxWidgets-2.8.6\lib\gcc_dll\mswu -IF:\MinGW\include -IF:\cppinclude -c G:\Coden\wx\wxtest2\wxtest2Main.cpp -o obj\Release\wxtest2Main.o
windres.exe -i G:\Coden\wx\wxtest2\resource.rc -J rc -o obj\Release\resource.res -O coff -II:\wxWidgets-2.8.6\include -II:\wxWidgets-2.8.6\lib\gcc_dll\mswu -IF:\MinGW\include -IF:\cppinclude
mingw32-g++.exe -LI:\wxWidgets-2.8.6\lib\gcc_dll -LF:\MinGW\lib -o bin\Release\wxtest2.exe obj\Release\wxtest2App.o obj\Release\wxtest2Main.o obj\Release\resource.res -s -lwxmsw28u -mwindows
obj\Release\wxtest2App.o:wxtest2App.cpp:(.rdata$_ZTV10wxtest2App[vtable for wxtest2App]+0x90): undefined reference to `wxAppConsole::OnAssertFailure(wchar_t const*, int, wchar_t const*, wchar_t const*, wchar_t const*)'
obj\Release\wxtest2App.o:wxtest2App.cpp:(.rdata$_ZTV10wxtest2App[vtable for wxtest2App]+0x94): undefined reference to `wxAppConsole::OnAssert(wchar_t const*, int, wchar_t const*, wchar_t const*)'
obj\Release\wxtest2Main.o:wxtest2Main.cpp:(.text$_ZNK12wxWindowBase7GetNameEv[wxWindowBase::GetName() const]+0x8d): undefined reference to `_imp___Z10wxOnAssertPKwiPKcS0_S0_'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 17 seconds)
3 errors, 0 warnings
--- End code ---
stahta01:
Did you get this message?
--- Quote ---A matching configuration cannot be found in the wxWidgets directory you specified. This means that your project will not build. Do you want to continue with these settings?
--- End quote ---
What did you do on step 10?
--- Quote ---This page lets you fine tune the libraries you are going to use to build your application. Leave the settings as they came by default. See the list below for the exact setting used.
Use wxWidgets DLL: Checked
wxWidgets is built as a monolithic library: Checked
Enable Unicode: Checked (see below)
Use the debugging libraries: Un-Checked
Configuration: <blank>
Create and use precompiled header (PCH): Checked
Click 'Finish' to create your project files.
(More information: Note for the Unicode checkbox, if you are going to use this you should know that your application will only run on Windows 2k and Windows XP.)
--- End quote ---
Your prior info disagrees on these two items, what did you really do?
Use wxWidgets DLL: Checked
wxWidgets is built as a monolithic library: Checked
Tim S
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version