Author Topic: undefined reference to `wxAppConsole::CreateLogTarget()  (Read 8840 times)

skyplus

  • Guest
undefined reference to `wxAppConsole::CreateLogTarget()
« on: October 24, 2007, 05:23:48 am »
my codeblocks version is 4425.
It used to be good, but now, it will fail linking for every project, including its defualt little project with a single button.
Even with my old projects which work good before.
This ever happened weeks ago, i re-installed CodeBlock and deleted all its configuration files that time, then it became
work again, so i though that's the problem with configure issues.
Now, i do the same thing but the problem remains. That's killing me...Please help   

Build log:
-------------- Build: Debug in renjie ---------------
Compiling: renjieApp.cpp
Compiling: renjieMain.cpp
Linking executable: bin/Debug/renjie
obj/Debug/renjieApp.o:(.rodata._ZTV9renjieApp[vtable for renjieApp]+0x78): undefined reference to `wxAppConsole::CreateLogTarget()'
obj/Debug/renjieApp.o:(.rodata._ZTV9renjieApp[vtable for renjieApp]+0x7c): undefined reference to `wxAppConsole::CreateMessageOutput()'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 7 seconds)
2 errors, 0 warnings


For every Project, the SAME two undefined references.

skyplus

  • Guest
Re: undefined reference to `wxAppConsole::CreateLogTarget()
« Reply #1 on: October 24, 2007, 06:54:29 am »
sorry, forgot to tell the OS, it's Ubuntu 7.04
with gtk+2.x.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: undefined reference to `wxAppConsole::CreateLogTarget()
« Reply #2 on: October 24, 2007, 07:16:03 am »
Please turn on full command line. And post build info.

Compiling: Settings -> Compiler and Debugger -> Tab "Other" -> Compiler logging = "Full command line".

Edit: wxWidgets version and type will help a lot also.

Tim S


« Last Edit: October 24, 2007, 07:17:53 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

skyplus

  • Guest
Re: undefined reference to `wxAppConsole::CreateLogTarget()
« Reply #3 on: October 31, 2007, 02:12:47 pm »
Please turn on full command line. And post build info.

Compiling: Settings -> Compiler and Debugger -> Tab "Other" -> Compiler logging = "Full command line".

Edit: wxWidgets version and type will help a lot also.

Tim S

Thanks Tim!
The problem has been solved.  :D





IsiPrimax

  • Guest
Re: undefined reference to `wxAppConsole::CreateLogTarget()
« Reply #4 on: October 31, 2007, 09:32:39 pm »
Hi i have self problem

Windows XP SP2, CodeBlocks, MinGW 3.4.5 and wxwidgets 2.8.6

Debug = works!
Release = error?!

-------------- 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 -lwxpng -lwxjpeg -lwxtiff -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32  -mwindows
obj\Release\testApp.o:testApp.cpp:(.rdata$_ZTV7testApp[vtable for testApp]+0x90): undefined reference to `wxAppConsole::OnAssertFailure(wchar_t const*, int, wchar_t const*, wchar_t const*, wchar_t const*)'
obj\Release\testApp.o:testApp.cpp:(.rdata$_ZTV7testApp[vtable for testApp]+0x94): undefined reference to `wxAppConsole::OnAssert(wchar_t const*, int, wchar_t const*, wchar_t const*)'
obj\Release\testMain.o:testMain.cpp:(.text$_ZNK12wxWindowBase7GetNameEv[wxWindowBase::GetName() const]+0x8c): undefined reference to `wxOnAssert(wchar_t const*, int, char const*, wchar_t const*, wchar_t const*)'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 4 seconds)
3 errors, 0 warnings
 
cya

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: undefined reference to `wxAppConsole::CreateLogTarget()
« Reply #5 on: November 01, 2007, 12:37:54 am »
@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
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

IsiPrimax

  • Guest
Re: undefined reference to `wxAppConsole::CreateLogTarget()
« Reply #6 on: November 01, 2007, 03:38:20 am »
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..."));
}

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

Settings
Code
New Project -> Wx Template -> WX Builder (wxsmith) -> Frame Based -> Enable Unicode

Other settings all Disable.

Last Page enable wxjpeg and wxtiff

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
« Last Edit: November 01, 2007, 03:44:29 am by IsiPrimax »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: undefined reference to `wxAppConsole::CreateLogTarget()
« Reply #7 on: November 01, 2007, 07:13:44 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

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

-------------- 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

The wxmsw28u library implies Monolithic Build, but the libraries, wxmsw28u_core.a and wxbase28u.a, you listed are for MultiLib build of wxWidgets.
« Last Edit: November 01, 2007, 07:23:19 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

IsiPrimax

  • Guest
Re: undefined reference to `wxAppConsole::CreateLogTarget()
« Reply #8 on: November 01, 2007, 05:12:00 pm »
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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: undefined reference to `wxAppConsole::CreateLogTarget()
« Reply #9 on: November 01, 2007, 05:32:11 pm »
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?

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.)

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
« Last Edit: November 01, 2007, 06:02:21 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

IsiPrimax

  • Guest
Re: undefined reference to `wxAppConsole::CreateLogTarget()
« Reply #10 on: November 01, 2007, 05:59:40 pm »
I have install CodeBlocks, Mingw and WXPack to my old pc p3 800.

I make self step.

Code
-------------- Build: Release in wxtest1 ---------------
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -Wall  -O2    -ID:\wxWidgets2.8\include -ID:\wxWidgets2.8\contrib\include -ID:\wxWidgets2.8\lib\gcc_dll\mswu -ID:\MinGW\include  -c D:\cppProjekte\wxtest1\wxtest1App.cpp -o obj\Release\wxtest1App.o

mingw32-g++.exe -LD:\wxWidgets2.8\lib\gcc_dll -LD:\MinGW\lib  -o bin\Release\wxtest1.exe obj\Release\wxtest1App.o obj\Release\wxtest1Main.o  obj\Release\resource.res  -s  -lwxmsw28u  -mwindows

Output size is 75.50 KB
Process terminated with status 0 (0 minutes, 2 seconds)
0 errors, 0 warnings
 

works o_O

IsiPrimax

  • Guest
Re: undefined reference to `wxAppConsole::CreateLogTarget()
« Reply #11 on: November 01, 2007, 06:29:54 pm »
lol,

I have renamend my wx dir to orginal wxpack name, wxWidgets2.8 (before wxWidgets-2.8.6) and now works o_O  :shock:

thx for help