CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Apr 2010
    Posts
    6

    [RESOLVED] #include-ing wxWidgets

    So I recently installed and compiled wxWidgets, and since this is the first time I've done such a thing, I'm not sure how to successfully #include .h or .hpp files from the library.

    Specifically, I'm trying to #include "wx/wx.h"

    The source code I'm attempting to compile is here: http://www.wxwidgets.org/docs/tutorials/hworld.txt

    Also, I have to admit to being self-taught, and don't have much knowledge of how a compiler works. If anybody could be so kind, I'd be very thankful for an article or something to give me a good understanding of compilers. I'd like to learn about the entire compilation process and pre-compiler processes. And I've heard about (and used, when I compiled wxWidgets) makefiles. I'd also like to learn how to create and use them.

    If you need to know, I'm using MinGW.

    Thank you in advance.

  2. #2
    Join Date
    Apr 2004
    Location
    Canada
    Posts
    1,342

    Re: #include-ing wxWidgets

    Hi elarsen7823, welcome to CodeGuru!

    Are you using a makefile to compile your program right now? If not, what is your IDE?

    If you're using a makefile, you need to tell the compiler where to look for the wx/wx.h file. This is done by adding an option "-I path" to the g++ command line, where "path" is the parent folder of the wx folder that contains wx.h.

    So if your makefile looks something like this right now:

    Code:
    hworld.exe : hworld.cpp
            g++ -o hworld.exe hworld.cpp
    you need to change it to something like this:

    Code:
    hworld.exe : hworld.cpp
            g++ -o hworld.exe -I C:\path\to\wxwidgets\include hworld.cpp
    where the wx.h file is located at C:\path\to\wxwidgets\include\wx\wx.h

    You will undoubtedly need to add other options as well, such as "-L path" for where to find the wxWidgets library files you need to link to, "path" being something like C:\path\to\wxwidgets\lib.

    If you're still having problems, please post some details (e.g. the exact error you're getting when you call "make").
    Old Unix programmers never die, they just mv to /dev/null

  3. #3
    Join Date
    Apr 2010
    Posts
    6

    Re: #include-ing wxWidgets

    Hey HighCommander. Thanks for the response and sorry for the time it took me to reply.

    I'm not using a makefile for this program, and I'm not using an IDE. I have no idea how to create a makefile, and I'm just using gedit and MinGW g++.

    Anyway, I added the -I and -L path flags and it sort of worked. The compiler is now able to find wx\wx.h, but it threw me a bunch of other errors from all over the place. I tracked those down to a filename mistake and fixed it, and now I'm getting only one error. That is

    Code:
    g++ -o Hellowx.exe -I C:\wxWidgets-2.8.10\include -L path C:\wxWidgets-2.8.10\lib Hellowx.cpp
    
    In file included from C:\wxWidgets-2.8.10\include\wx\platform.h : 293,
                            from C:\wxWidgets-2.8.10\include\wx\defs.h : 21,
                            from C:\wxWidgets-2.8.10\include\wx\wx.h : 15,
                            from Hellowx.cpp : 1 :
    C:\wxWidgets-2.8.10\include\wx\chkconf.h:1817:9: #error "wxClipboard requires wxDataObject"
    chkconf.h is a header that, as the name implies, checks the configuration of something (I'm assuming the compiler?) during the precompiler phase. The block of code being referred to is:

    Code:
    #if wxUSE_CLIPBOARD && !wxUSE_DATAOBJ
    
    #   ifdef wxABORT_ON_CONFIG_ERROR
    
    #       error "wxClipboard requires wxDataObject"
    
    #   else
    
    #       undef wxUSE_DATAOBJ
    
    #       define wxUSE_DATAOBJ 1
    
    #   endif
    
    #endif /* wxUSE_CLIPBOARD */
    Which means that the
    Code:
    #ifdef wxUSE_CLIPBOARD && !wxUSE_DATAOBJ
    and the
    Code:
     #ifdef wxABORT_ON_CONFIG_ERROR
    statements are both evaluating positive. Is there some way to fix this? And what does the code really mean? I can only assume that my (something) is missing the definition for wxUSE_DATAOBJ.


    Also, I'd still like to know if there are any good articles or papers or something dealing with compilers and makefiles. I know very little about either.
    Last edited by elarsen7823; April 5th, 2010 at 02:34 AM.

  4. #4
    Join Date
    Apr 2004
    Location
    Canada
    Posts
    1,342

    Re: #include-ing wxWidgets

    Don't bother to try and understand the contents of files like chkconf.h - whatever went wrong in chkconf.h is the immediate cause of your problem, not the real cause, and "fixing" the immediate cause will almost certainly not fix the real cause.

    The real cause of your problem is that you're not building your program with the proper compiler options - you need a few more options than what you have right now.

    You said you've compiled and installed wxWidgets. I'm assuming you used either MSYS or cygwin to do this.

    Open up your MSYS (or cygwin) shell and navigate to the directory where wxWidgets was compiled. There should be a shell script there called "wx-config". Run it with the parameter --cppflags, like this:

    ./wx-config --cppflags

    The output of that is all the compiler options you need to use. Note that the file paths are in Unix format, so if you're building from the Windows command prompt you need to change them to Windows format (if you're building from MSYS/cygwin then leave them as is).

    You will also need to do

    ./wx-config --libs

    which gives you all the options necessary for linking.

    With regards to makefiles, even if you know nothing about makefiles you should have a very basic one like this:

    Code:
    Hellowx.exe : Hellowx.cpp
            [insert your g++ command line here]
    Put those lines in a file called "makefile" in your project folder. Note that before the g++ command line on the second line, there is a tab, not spaces (it matters for makefiles).

    Then you can just call "make" to compile your program instead of typing out the whole g++ command line (which will be long with all the required options).

    Then as your learn more about makefiles over time (read some online tutorials, I don't know of a good one off hand, just google them), you can make your makefile more sophisticated.
    Last edited by HighCommander4; April 5th, 2010 at 12:14 AM.
    Old Unix programmers never die, they just mv to /dev/null

  5. #5
    Join Date
    Apr 2010
    Posts
    6

    Re: #include-ing wxWidgets

    Okay, I originally had compiled it using the makefiles with MinGW by itself, without MSYS. So I uninstalled wxWidgets and reinstalled it and built it with MSYS and the configure script. Then I ran the wx-config script with --cppflags and --libs and put those in a g++ command line in my makefile:

    Code:
    Hellowx.exe : Hellowx.cpp
    	g++ -o Hellowx.exe -I/c/wxWidgets-2.8.10/build-debug/lib/wx/include/msw-ansi-debug-static-2.8 -I/c/wxWidgets-2.8.10/include -I/c/wxWidgets-2.8.10/contrib/include -D__WXDEBUG__ -D__WXMSW__ -L/c/wxWidgets-2.8.10/build-debug/lib  -mthreads  -Wl,--subsystem,windows -mwindows /c/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_richtext-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_aui-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_xrc-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_qa-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_html-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_adv-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_based_xml-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_based_net-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_based-2.8.a -lwxregexd-2.8 -lwxexpatd-2.8 -lwxtiffd-2.8 -lwxjpegd-2.8 -lwxpngd-2.8 -lwxzlibd-2.8 -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32 Hellowx.cpp
    Like so. When I ran it though, I got about a million errors:

    Code:
    $ make -f makefile.gcc
    g++ -o Hellowx.exe -I/c/wxWidgets-2.8.10/build-debug/lib/wx/include/msw-ansi-deb
    ug-static-2.8 -I/c/wxWidgets-2.8.10/include -I/c/wxWidgets-2.8.10/contrib/includ
    e -D__WXDEBUG__ -D__WXMSW__ -L/c/wxWidgets-2.8.10/build-debug/lib  -mthreads  -W
    l,--subsystem,windows -mwindows /c/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_r
    ichtext-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_aui-2.8.a /c/wxWidg
    ets-2.8.10/build-debug/lib/libwx_mswd_xrc-2.8.a /c/wxWidgets-2.8.10/build-debug/
    lib/libwx_mswd_qa-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_html-2.8.
    a /c/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_adv-2.8.a /c/wxWidgets-2.8.10/b
    uild-debug/lib/libwx_mswd_core-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_b
    ased_xml-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_based_net-2.8.a /c/wxWi
    dgets-2.8.10/build-debug/lib/libwx_based-2.8.a -lwxregexd-2.8 -lwxexpatd-2.8 -lw
    xtiffd-2.8 -lwxjpegd-2.8 -lwxpngd-2.8 -lwxzlibd-2.8 -lrpcrt4 -loleaut32 -lole32
    -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lctl3d32 -ladvapi32 -
    lwsock32 -lgdi32 Hellowx.cpp
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0x15e): undefined
     reference to `wxAppConsole::CheckBuildOptions(char const*, char const*)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0x204): undefined
     reference to `wxEntry(HINSTANCE__*, HINSTANCE__*, char*, int)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0x42a): undefined
     reference to `wxFrameNameStr'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0x541): undefined
     reference to `wxEmptyString'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0x63b): undefined
     reference to `wxEmptyString'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0x745): undefined
     reference to `wxMenuBar::wxMenuBar()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0x81d): undefined
     reference to `wxFrameBase::SetMenuBar(wxMenuBar*)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0x825): undefined
     reference to `wxStatusLineNameStr'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0x861): undefined
     reference to `wxFrameBase::CreateStatusBar(int, long, int, wxString const&)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0x8e1): undefined
     reference to `wxFrameBase::SetStatusText(wxString const&, int)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0x9c9): undefined
     reference to `wxFrame::~wxFrame()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0xa40): undefined
     reference to `wxFrameNameStr'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0xb57): undefined
     reference to `wxEmptyString'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0xc51): undefined
     reference to `wxEmptyString'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0xd5b): undefined
     reference to `wxMenuBar::wxMenuBar()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0xe33): undefined
     reference to `wxFrameBase::SetMenuBar(wxMenuBar*)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0xe3b): undefined
     reference to `wxStatusLineNameStr'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0xe77): undefined
     reference to `wxFrameBase::CreateStatusBar(int, long, int, wxString const&)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0xef7): undefined
     reference to `wxFrameBase::SetStatusText(wxString const&, int)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0xfdf): undefined
     reference to `wxFrame::~wxFrame()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0x102f): undefine
    d reference to `wxWindowBase::Close(bool)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0x10fc): undefine
    d reference to `wxMessageBox(wxString const&, wxString const&, long, wxWindow*,
    int, int)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0x11c5): undefine
    d reference to `wxEventHashTable::wxEventHashTable(wxEventTable const&)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0x1215): undefine
    d reference to `wxEVT_COMMAND_MENU_SELECTED'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0x1252): undefine
    d reference to `wxEVT_COMMAND_MENU_SELECTED'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0x128f): undefine
    d reference to `wxEVT_NULL'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text+0x12d5): undefine
    d reference to `wxEventHashTable::~wxEventHashTable()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata+0x0): undefined
    reference to `wxFrame::sm_eventTable'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN5MyAppC1Ev[MyA
    pp::MyApp()]+0xd): undefined reference to `wxApp::wxApp()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN12wxAppConsole
    11GetInstanceEv[wxAppConsole::GetInstance()]+0x4): undefined reference to `wxApp
    Console::ms_appInstance'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN12wxStringBase
    C2EPKc[wxStringBase::wxStringBase(char const*)]+0x7): undefined reference to `wx
    StringBase::npos'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN12wxStringBase
    C2EPKc[wxStringBase::wxStringBase(char const*)]+0x25): undefined reference to `w
    xStringBase::InitWith(char const*, unsigned int, unsigned int)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_Z16wxGetTranslat
    ionPKcS0_[wxGetTranslation(char const*, char const*)]+0x7): undefined reference
    to `wxGetLocale()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN10wxMenuBase15
    AppendSeparatorEv[wxMenuBase::AppendSeparator()]+0x39): undefined reference to `
    wxEmptyString'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN10wxMenuBase15
    AppendSeparatorEv[wxMenuBase::AppendSeparator()]+0x5a): undefined reference to `
    wxEmptyString'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN10wxMenuBase6A
    ppendEiRK8wxStringS2_10wxItemKind[wxMenuBase::Append(int, wxString const&, wxStr
    ing const&, wxItemKind)]+0x31): undefined reference to `wxMenuItemBase::New(wxMe
    nu*, int, wxString const&, wxString const&, wxItemKind, wxMenu*)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN6wxMenuC1El[wx
    Menu::wxMenu(long)]+0x53): undefined reference to `vtable for wxMenu'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN6wxMenuC1El[wx
    Menu::wxMenu(long)]+0x7a): undefined reference to `wxMenu::Init()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN6wxMenuC1El[wx
    Menu::wxMenu(long)]+0xc6): undefined reference to `wxMenuBase::~wxMenuBase()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN18wxAccelerato
    rArrayD1Ev[wxAcceleratorArray::~wxAcceleratorArray()]+0xd): undefined reference
    to `wxBaseArrayPtrVoid::~wxBaseArrayPtrVoid()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN18wxAccelerato
    rArrayC1Ev[wxAcceleratorArray::wxAcceleratorArray()]+0xd): undefined reference t
    o `wxBaseArrayPtrVoid::wxBaseArrayPtrVoid()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN10wxMenuBaseC2
    El[wxMenuBase::wxMenuBase(long)]+0x43): undefined reference to `wxEvtHandler::wx
    EvtHandler()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN10wxMenuBaseC2
    El[wxMenuBase::wxMenuBase(long)]+0x4c): undefined reference to `vtable for wxMen
    uBase'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN10wxMenuBaseC2
    El[wxMenuBase::wxMenuBase(long)]+0x90): undefined reference to `wxMenuBase::Init
    (long)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN10wxMenuBaseC2
    El[wxMenuBase::wxMenuBase(long)]+0xf6): undefined reference to `wxEvtHandler::~w
    xEvtHandler()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN14wxMenuItemLi
    stD1Ev[wxMenuItemList::~wxMenuItemList()]+0x16): undefined reference to `wxListB
    ase::~wxListBase()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN10wxListBaseC2
    E9wxKeyType[wxListBase::wxListBase(wxKeyType)]+0x45): undefined reference to `vt
    able for wxListBase'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN10wxListBaseC2
    E9wxKeyType[wxListBase::wxListBase(wxKeyType)]+0x5e): undefined reference to `wx
    ListBase::Init(wxKeyType)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN8wxObjectD2Ev[
    wxObject::~wxObject()]+0xb): undefined reference to `vtable for wxObject'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN8wxObjectD2Ev[
    wxObject::~wxObject()]+0x16): undefined reference to `wxObject::UnRef()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN8wxObjectC2Ev[
    wxObject::wxObject()]+0x8): undefined reference to `vtable for wxObject'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN12wxStringBase
    4InitEv[wxStringBase::Init()]+0x7): undefined reference to `wxEmptyString'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN7wxFrameC2EP8w
    xWindowiRK8wxStringRK7wxPointRK6wxSizelS4_[wxFrame::wxFrame(wxWindow*, int, wxSt
    ring const&, wxPoint const&, wxSize const&, long, wxString const&)]+0x43): undef
    ined reference to `wxFrameBase::wxFrameBase()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN7wxFrameC2EP8w
    xWindowiRK8wxStringRK7wxPointRK6wxSizelS4_[wxFrame::wxFrame(wxWindow*, int, wxSt
    ring const&, wxPoint const&, wxSize const&, long, wxString const&)]+0x4c): undef
    ined reference to `vtable for wxFrame'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN7wxFrameC2EP8w
    xWindowiRK8wxStringRK7wxPointRK6wxSizelS4_[wxFrame::wxFrame(wxWindow*, int, wxSt
    ring const&, wxPoint const&, wxSize const&, long, wxString const&)]+0x5e): undef
    ined reference to `wxFrame::Init()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN7wxFrameC2EP8w
    xWindowiRK8wxStringRK7wxPointRK6wxSizelS4_[wxFrame::wxFrame(wxWindow*, int, wxSt
    ring const&, wxPoint const&, wxSize const&, long, wxString const&)]+0x9a): undef
    ined reference to `wxFrame::Create(wxWindow*, int, wxString const&, wxPoint cons
    t&, wxSize const&, long, wxString const&)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.text$_ZN7wxFrameC2EP8w
    xWindowiRK8wxStringRK7wxPointRK6wxSizelS4_[wxFrame::wxFrame(wxWindow*, int, wxSt
    ring const&, wxPoint const&, wxSize const&, long, wxString const&)]+0xbd): undef
    ined reference to `wxFrameBase::~wxFrameBase()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x8): undefined reference to `wxApp::GetClassInfo() const'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x14): undefined reference to `wxObject::CreateRefData() const'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x18): undefined reference to `wxObject::CloneRefData(wxObjectRefDa
    ta const*) const'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x1c): undefined reference to `wxEvtHandler::ProcessEvent(wxEvent&)
    '
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x20): undefined reference to `wxEvtHandler::SearchEventTable(wxEve
    ntTable&, wxEvent&)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x28): undefined reference to `wxEvtHandler::TryParent(wxEvent&)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x2c): undefined reference to `wxApp::GetEventTable() const'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x30): undefined reference to `wxApp::GetEventHashTable() const'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x34): undefined reference to `wxEvtHandler::DoSetClientObject(wxCl
    ientData*)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x38): undefined reference to `wxEvtHandler::DoGetClientObject() co
    nst'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x3c): undefined reference to `wxEvtHandler::DoSetClientData(void*)
    '
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x40): undefined reference to `wxEvtHandler::DoGetClientData() cons
    t'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x44): undefined reference to `wxApp::Initialize(int&, char**)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x50): undefined reference to `wxAppBase::OnInitGui()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x54): undefined reference to `wxAppBase::OnRun()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x58): undefined reference to `wxAppBase::OnExit()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x5c): undefined reference to `wxApp::CleanUp()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x64): undefined reference to `wxAppBase::Exit()'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x68): undefined reference to `wxAppBase::OnInitCmdLine(wxCmdLinePa
    rser&)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x6c): undefined reference to `wxAppBase::OnCmdLineParsed(wxCmdLine
    Parser&)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x70): undefined reference to `wxAppConsole::OnCmdLineHelp(wxCmdLin
    eParser&)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x74): undefined reference to `wxAppConsole::OnCmdLineError(wxCmdLi
    neParser&)'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x78): undefined reference to `wxAppConsole::FilterEvent(wxEvent&)'
    
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x7c): undefined reference to `wxAppConsole::HandleEvent(wxEvtHandl
    er*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const'
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x84): undefined reference to `wxAppConsole::ProcessPendingEvents()
    '
    C:/Users/Eric/AppData/Local/Temp/cctLVRDj.o:Hellowx.cpp:(.rdata$_ZTV5MyApp[vtabl
    e for MyApp]+0x88): undefined reference to `wxApp::Yield(bool)'
    And so on for about 30000 characters. The tail end of it was:
    Code:
    collect2: ld returned 1 exit status
    make: *** [Hellowx.exe] Error 1
    I don't think this is ever going to work.

  6. #6
    Join Date
    Apr 2004
    Location
    Canada
    Posts
    1,342

    Re: #include-ing wxWidgets

    Hmm... that's strange.

    You definitely have the libraries that include those missing symbols (e.g. the wxAppConsole stuff is in libwx_based-2.8.a), and g++ is definitely finding the libraries at the paths you gave it (otherwise it would complain that it doesn't).

    My only suggestion is to try tweaking the order of things in your command line. I remember having some strange errors in the past that got resolved my changing around the order of things in the command line.

    The makefile for the wxWidgets program that I'm developing has this order:
    Code:
    g++ [all options except libraries] -o [output file] [source files] [libraries]
    where libraries are all the .a files and all the options starting with -l.

    If changing your command line to match that order doesn't work, I'm out of ideas - try asking for helping in the wxWidgets forums or the wxWidgets mailing list.
    Old Unix programmers never die, they just mv to /dev/null

  7. #7
    Join Date
    Apr 2010
    Posts
    6

    Re: #include-ing wxWidgets

    The error list got significantly shorter. New makefile:

    Code:
    Hellowx.exe : Hellowx.cpp
    	g++ -I/c/wxWidgets-2.8.10/build-debug/lib/wx/include/msw-ansi-debug-static-2.8 -I/c/wxWidgets-2.8.10/include -I/c/wxWidgets-2.8.10/contrib/include -D__WXDEBUG__ -D__WXMSW__ -L/c/wxWidgets-2.8.10/build-debug/lib  -mthreads  -Wl,--subsystem,windows -lwxregexd-2.8 -lwxexpatd-2.8 -lwxtiffd-2.8 -lwxjpegd-2.8 -lwxpngd-2.8 -lwxzlibd-2.8 -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32 -o Hellowx.exe Hellowx.cpp -mwindows /c/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_richtext-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_aui-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_xrc-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_qa-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_html-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_adv-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_based_xml-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_based_net-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_based-2.8.a
    New output:

    Code:
    $ make -f makefile.gcc
    g++ -I/c/wxWidgets-2.8.10/build-debug/lib/wx/include/msw-ansi-debug-static-2.8 -
    I/c/wxWidgets-2.8.10/include -I/c/wxWidgets-2.8.10/contrib/include -D__WXDEBUG__
     -D__WXMSW__ -L/c/wxWidgets-2.8.10/build-debug/lib  -mthreads  -Wl,--subsystem,w
    indows -lwxregexd-2.8 -lwxexpatd-2.8 -lwxtiffd-2.8 -lwxjpegd-2.8 -lwxpngd-2.8 -l
    wxzlibd-2.8 -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lco
    mctl32 -lcomdlg32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32 -o Hellowx.exe Hellowx.
    cpp -mwindows /c/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_richtext-2.8.a /c/w
    xWidgets-2.8.10/build-debug/lib/libwx_mswd_aui-2.8.a /c/wxWidgets-2.8.10/build-d
    ebug/lib/libwx_mswd_xrc-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_qa-
    2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_html-2.8.a /c/wxWidgets-2.8
    .10/build-debug/lib/libwx_mswd_adv-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/lib
    wx_mswd_core-2.8.a /c/wxWidgets-2.8.10/build-debug/lib/libwx_based_xml-2.8.a /c/
    wxWidgets-2.8.10/build-debug/lib/libwx_based_net-2.8.a /c/wxWidgets-2.8.10/build
    -debug/lib/libwx_based-2.8.a
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_app.o):c:\
    wxWidgets-2.8.10\build-debug/../src/msw/app.cpp:307: undefined reference to `Ini
    tCommonControls@0'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_app.o): In
     function `Z15wxOleInitializev':
    c:\wxWidgets-2.8.10\build-debug/../include/wx/msw/ole/oleutils.h:43: undefined r
    eference to `OleInitialize@4'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_app.o): In
     function `Z17wxOleUninitializev':
    c:\wxWidgets-2.8.10\build-debug/../include/wx/msw/ole/oleutils.h:59: undefined r
    eference to `OleUninitialize@0'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_statbr95.o):c:
    \wxWidgets-2.8.10\build-debug/../src/msw/statbr95.cpp:105: undefined reference t
    o `CreateStatusWindowA@16'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_droptgt.o):c:\
    wxWidgets-2.8.10\build-debug/../src/msw/ole/droptgt.cpp:371: undefined reference
     to `CoLockObjectExternal@12'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_droptgt.o):c:\
    wxWidgets-2.8.10\build-debug/../src/msw/ole/droptgt.cpp:378: undefined reference
     to `RegisterDragDrop@8'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_droptgt.o):c:\
    wxWidgets-2.8.10\build-debug/../src/msw/ole/droptgt.cpp:382: undefined reference
     to `CoLockObjectExternal@12'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_droptgt.o):c:\
    wxWidgets-2.8.10\build-debug/../src/msw/ole/droptgt.cpp:401: undefined reference
     to `RevokeDragDrop@4'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_droptgt.o):c:\
    wxWidgets-2.8.10\build-debug/../src/msw/ole/droptgt.cpp:409: undefined reference
     to `CoLockObjectExternal@12'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_droptgt.o):dro
    ptgt.cpp:(.data+0x0): undefined reference to `IID_IUnknown'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_droptgt.o):dro
    ptgt.cpp:(.data+0x4): undefined reference to `IID_IDropTarget'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_spinbutt.o
    ):c:\wxWidgets-2.8.10\build-debug/../src/msw/spinbutt.cpp:172: undefined referen
    ce to `CreateUpDownControl@48'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_imaglist.o
    ):c:\wxWidgets-2.8.10\build-debug/../src/msw/imaglist.cpp:94: undefined referenc
    e to `ImageList_Create@20'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_imaglist.o
    ): In function `~wxImageList':
    c:\wxWidgets-2.8.10\build-debug/../src/msw/imaglist.cpp:108: undefined reference
     to `ImageList_Destroy@4'
    c:\wxWidgets-2.8.10\build-debug/../src/msw/imaglist.cpp:108: undefined reference
     to `ImageList_Destroy@4'
    c:\wxWidgets-2.8.10\build-debug/../src/msw/imaglist.cpp:108: undefined reference
     to `ImageList_Destroy@4'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_imaglist.o
    ):c:\wxWidgets-2.8.10\build-debug/../src/msw/imaglist.cpp:122: undefined referen
    ce to `ImageList_GetImageCount@4'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_imaglist.o
    ):c:\wxWidgets-2.8.10\build-debug/../src/msw/imaglist.cpp:130: undefined referen
    ce to `ImageList_GetIconSize@12'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_imaglist.o
    ):c:\wxWidgets-2.8.10\build-debug/../src/msw/imaglist.cpp:144: undefined referen
    ce to `ImageList_Add@12'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_imaglist.o
    ):c:\wxWidgets-2.8.10\build-debug/../src/msw/imaglist.cpp:162: undefined referen
    ce to `ImageList_AddMasked@12'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_imaglist.o
    ):c:\wxWidgets-2.8.10\build-debug/../src/msw/imaglist.cpp:174: undefined referen
    ce to `ImageList_ReplaceIcon@12'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_imaglist.o
    ):c:\wxWidgets-2.8.10\build-debug/../src/msw/imaglist.cpp:192: undefined referen
    ce to `ImageList_Replace@16'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_imaglist.o
    ):c:\wxWidgets-2.8.10\build-debug/../src/msw/imaglist.cpp:206: undefined referen
    ce to `ImageList_ReplaceIcon@12'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_imaglist.o
    ):c:\wxWidgets-2.8.10\build-debug/../src/msw/imaglist.cpp:218: undefined referen
    ce to `ImageList_Remove@8'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_imaglist.o
    ):c:\wxWidgets-2.8.10\build-debug/../src/msw/imaglist.cpp:257: undefined referen
    ce to `ImageList_SetBkColor@8'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_imaglist.o
    ):c:\wxWidgets-2.8.10\build-debug/../src/msw/imaglist.cpp:269: undefined referen
    ce to `ImageList_Draw@24'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_imaglist.o
    ):c:\wxWidgets-2.8.10\build-debug/../src/msw/imaglist.cpp:321: undefined referen
    ce to `ImageList_GetIcon@12'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_listctrl.o
    ): In function `HandleSubItemPrepaint':
    c:\wxWidgets-2.8.10\build-debug/../src/msw/listctrl.cpp:2541: undefined referenc
    e to `ImageList_GetImageCount@4'
    c:\wxWidgets-2.8.10\build-debug/../src/msw/listctrl.cpp:2545: undefined referenc
    e to `ImageList_Draw@24'
    c:\wxWidgets-2.8.10\build-debug/../src/msw/listctrl.cpp:2557: undefined referenc
    e to `ImageList_GetIconSize@12'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_oleutils.o): I
    n function `Z22wxConvertStringFromOlePw':
    c:\wxWidgets-2.8.10\build-debug/../src/msw/ole/oleutils.cpp:92: undefined refere
    nce to `SysStringLen@4'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_oleutils.o):c:
    \wxWidgets-2.8.10\build-debug/../include/wx/msw/ole/oleutils.h:221: undefined re
    ference to `SysAllocString@4'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_clipbrd.o)
    :c:\wxWidgets-2.8.10\build-debug/../src/msw/clipbrd.cpp:554: undefined reference
     to `OleIsCurrentClipboard@4'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_clipbrd.o)
    :c:\wxWidgets-2.8.10\build-debug/../src/msw/clipbrd.cpp:557: undefined reference
     to `OleSetClipboard@4'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_clipbrd.o)
    :c:\wxWidgets-2.8.10\build-debug/../src/msw/clipbrd.cpp:574: undefined reference
     to `OleIsCurrentClipboard@4'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_clipbrd.o)
    :c:\wxWidgets-2.8.10\build-debug/../src/msw/clipbrd.cpp:578: undefined reference
     to `OleFlushClipboard@0'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_clipbrd.o)
    :c:\wxWidgets-2.8.10\build-debug/../src/msw/clipbrd.cpp:631: undefined reference
     to `OleSetClipboard@4'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_clipbrd.o)
    :c:\wxWidgets-2.8.10\build-debug/../src/msw/clipbrd.cpp:728: undefined reference
     to `OleGetClipboard@4'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_msw_clipbrd.o)
    :c:\wxWidgets-2.8.10\build-debug/../src/msw/clipbrd.cpp:856: undefined reference
     to `ReleaseStgMedium@4'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_dragimag.o): I
    n function `~wxDragImage':
    c:\wxWidgets-2.8.10\build-debug/../src/msw/dragimag.cpp:82: undefined reference
    to `ImageList_Destroy@4'
    c:\wxWidgets-2.8.10\build-debug/../src/msw/dragimag.cpp:85: undefined reference
    to `ImageList_Destroy@4'
    c:\wxWidgets-2.8.10\build-debug/../src/msw/dragimag.cpp:82: undefined reference
    to `ImageList_Destroy@4'
    c:\wxWidgets-2.8.10\build-debug/../src/msw/dragimag.cpp:85: undefined reference
    to `ImageList_Destroy@4'
    c:\wxWidgets-2.8.10\build-debug/../src/msw/dragimag.cpp:82: undefined reference
    to `ImageList_Destroy@4'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_dragimag.o):c:
    \wxWidgets-2.8.10\build-debug/../src/msw/dragimag.cpp:85: more undefined referen
    ces to `ImageList_Destroy@4' follow
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_dragimag.o):c:
    \wxWidgets-2.8.10\build-debug/../src/msw/dragimag.cpp:137: undefined reference t
    o `ImageList_Create@20'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_dragimag.o):c:
    \wxWidgets-2.8.10\build-debug/../src/msw/dragimag.cpp:143: undefined reference t
    o `ImageList_Add@12'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_dragimag.o):c:
    \wxWidgets-2.8.10\build-debug/../src/msw/dragimag.cpp:151: undefined reference t
    o `ImageList_Add@12'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_dragimag.o):c:
    \wxWidgets-2.8.10\build-debug/../src/msw/dragimag.cpp:167: undefined reference t
    o `ImageList_Destroy@4'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_dragimag.o):c:
    \wxWidgets-2.8.10\build-debug/../src/msw/dragimag.cpp:188: undefined reference t
    o `ImageList_Create@20'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_dragimag.o):c:
    \wxWidgets-2.8.10\build-debug/../src/msw/dragimag.cpp:192: undefined reference t
    o `ImageList_ReplaceIcon@12'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_dragimag.o):c:
    \wxWidgets-2.8.10\build-debug/../src/msw/dragimag.cpp:250: undefined reference t
    o `ImageList_Destroy@4'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_dragimag.o):c:
    \wxWidgets-2.8.10\build-debug/../src/msw/dragimag.cpp:262: undefined reference t
    o `ImageList_Destroy@4'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_dragimag.o):c:
    \wxWidgets-2.8.10\build-debug/../src/msw/dragimag.cpp:280: undefined reference t
    o `ImageList_BeginDrag@16'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_dragimag.o):c:
    \wxWidgets-2.8.10\build-debug/../src/msw/dragimag.cpp:305: undefined reference t
    o `ImageList_Create@20'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_dragimag.o):c:
    \wxWidgets-2.8.10\build-debug/../src/msw/dragimag.cpp:328: undefined reference t
    o `ImageList_ReplaceIcon@12'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_dragimag.o):c:
    \wxWidgets-2.8.10\build-debug/../src/msw/dragimag.cpp:334: undefined reference t
    o `ImageList_SetDragCursorImage@16'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_dragimag.o):c:
    \wxWidgets-2.8.10\build-debug/../src/msw/dragimag.cpp:377: undefined reference t
    o `ImageList_EndDrag@0'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_dragimag.o):c:
    \wxWidgets-2.8.10\build-debug/../src/msw/dragimag.cpp:425: undefined reference t
    o `ImageList_DragMove@8'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_dragimag.o):c:
    \wxWidgets-2.8.10\build-debug/../src/msw/dragimag.cpp:440: undefined reference t
    o `ImageList_DragEnter@12'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_dragimag.o):c:
    \wxWidgets-2.8.10\build-debug/../src/msw/dragimag.cpp:453: undefined reference t
    o `ImageList_DragLeave@4'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_ole_dataobj.o)
    :c:\wxWidgets-2.8.10\build-debug/../src/msw/ole/dataobj.cpp:533: undefined refer
    ence to `ReleaseStgMedium@4'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_ole_dataobj.o)
    :dataobj.cpp:(.data+0x0): undefined reference to `IID_IUnknown'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_ole_dataobj.o)
    :dataobj.cpp:(.data+0x4): undefined reference to `IID_IEnumFORMATETC'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_ole_dataobj.o)
    :dataobj.cpp:(.data+0x8): undefined reference to `IID_IUnknown'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_mswd_core-2.8.a(corelib_ole_dataobj.o)
    :dataobj.cpp:(.data+0xc): undefined reference to `IID_IDataObject'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_based-2.8.a(baselib_filename.o):c:\wxW
    idgets-2.8.10\build-debug/../src/common/filename.cpp:1345: undefined reference t
    o `CoCreateInstance@20'
    c:/wxWidgets-2.8.10/build-debug/lib/libwx_based-2.8.a(baselib_filename.o):c:\wxW
    idgets-2.8.10\build-debug/../src/common/filename.cpp:1351: undefined reference t
    o `IID_IPersistFile'
    collect2: ld returned 1 exit status
    make: *** [Hellowx.exe] Error 1
    Any more suggestions? If not, I'll just play around with the order of my command line.

  8. #8
    Join Date
    Apr 2004
    Location
    Canada
    Posts
    1,342

    Re: #include-ing wxWidgets

    Quote Originally Posted by HighCommander4 View Post
    where libraries are all the .a files and all the options starting with -l.
    You didn't put the -l options at the end.
    Last edited by HighCommander4; April 5th, 2010 at 05:04 AM.
    Old Unix programmers never die, they just mv to /dev/null

  9. #9
    Join Date
    Apr 2010
    Posts
    6

    Re: #include-ing wxWidgets

    Oops, my bad.

    It's working now. Thanks.

  10. #10
    Join Date
    Apr 2004
    Location
    Canada
    Posts
    1,342

    Re: #include-ing wxWidgets

    Quote Originally Posted by elarsen7823 View Post
    Oops, my bad.

    It's working now. Thanks.
    Any time
    Old Unix programmers never die, they just mv to /dev/null

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured