@doublemax--thank you for replying to my post, and for giving me helpful suggestions.
I took your advice and modified the value of my environment variable WXCFG until wx-config accepted WXCFG as being valid. Then I ran the wx-config --cxxflags command. Here is what I got.
Code: Select all
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Colleen>tohw
C:\Users\Colleen>cd F:\Prototypes_CPP\wxHelloWorld
C:\Users\Colleen>f:
F:\Prototypes_CPP\wxHelloWorld>wx-config --cxxflags
-mthreads -DHAVE_W32API_H -D__WXMSW__ -D__WXDEBUG__ -D_UNICODE -IF:\wxWidgets\lib\gcc_dll\mswu -IF:\wxWidgets\include -D
WXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -Wl,--subsystem,windows -mwindows -Wl,--enable-auto-import "
-std=gnu++11"
F:\Prototypes_CPP\wxHelloWorld>wx-config --cxxflags > output.txt
F:\Prototypes_CPP\wxHelloWorld>
As you can see, I ran the command again, but this time I piped the output into file output.txt.
Here is what output.txt contains:
Code: Select all
F:\Prototypes_CPP\wxHelloWorld>type output.txt
-mthreads -DHAVE_W32API_H -D__WXMSW__ -D__WXDEBUG__ -D_UNICODE -IF:\wxWidgets\lib\gcc_dll\mswu -IF:\wxWidgets\include -D
WXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -Wl,--subsystem,windows -mwindows -Wl,--enable-auto-import "
-std=gnu++11"
F:\Prototypes_CPP\wxHelloWorld>
(The actual text in output.txt is all on one line.)
Then I tried to link my program again, piping in the output from output.txt as arguments. Here is the beginning of what came back.
Code: Select all
F:\Prototypes_CPP\wxHelloWorld>g++ -o hello hello.o < output.txt
hello.o:hello.cpp:(.text+0x43): undefined reference to `wxEntry(HINSTANCE__*, HINSTANCE__*, char*, int)'
hello.o:hello.cpp:(.text+0x6d): undefined reference to `wxAppConsoleBase::CheckBuildOptions(char const*, char const*)'
hello.o:hello.cpp:(.text+0x1a8): undefined reference to `wxFrameNameStr'
hello.o:hello.cpp:(.text+0x2b2): undefined reference to `wxEmptyString'
hello.o:hello.cpp:(.text+0x2c8): undefined reference to `wxEmptyString'
hello.o:hello.cpp:(.text+0x33e): undefined reference to `wxEmptyString'
hello.o:hello.cpp:(.text+0x354): undefined reference to `wxEmptyString'
hello.o:hello.cpp:(.text+0x3b7): undefined reference to `wxMenuBar::wxMenuBar()'
hello.o:hello.cpp:(.text+0x44f): undefined reference to `wxFrameBase::SetMenuBar(wxMenuBar*)'
hello.o:hello.cpp:(.text+0x45c): undefined reference to `wxStatusLineNameStr'
hello.o:hello.cpp:(.text+0x491): undefined reference to `wxFrameBase::CreateStatusBar(int, long, int, wxString const&)'
hello.o:hello.cpp:(.text+0x4cd): undefined reference to `wxFrameBase::SetStatusText(wxString const&, int)'
hello.o:hello.cpp:(.text+0x5c6): undefined reference to `wxFrame::~wxFrame()'
hello.o:hello.cpp:(.text+0x5f4): undefined reference to `wxWindowBase::Close(bool)'
hello.o:hello.cpp:(.text+0x660): undefined reference to `wxMessageBox(wxString const&, wxString const&, long, wxWindow*,
int, int)'
hello.o:hello.cpp:(.text+0x6cd): undefined reference to `wxLOG_COMPONENT'
hello.o:hello.cpp:(.text+0x73e): undefined reference to `wxLOG_COMPONENT'
hello.o:hello.cpp:(.text+0x7fe): undefined reference to `wxEventHashTable::~wxEventHashTable()'
hello.o:hello.cpp:(.text+0x86d): undefined reference to `wxEventHashTable::wxEventHashTable(wxEventTable const&)'
hello.o:hello.cpp:(.text+0x8a1): undefined reference to `wxEVT_MENU'
hello.o:hello.cpp:(.text+0x8ad): undefined reference to `wxEVT_MENU'
hello.o:hello.cpp:(.text+0x908): undefined reference to `wxEVT_MENU'
hello.o:hello.cpp:(.text+0x914): undefined reference to `wxEVT_MENU'
hello.o:hello.cpp:(.text+0x96b): undefined reference to `wxEVT_MENU'
hello.o:hello.cpp:(.text+0x977): more undefined references to `wxEVT_MENU' follow
hello.o:hello.cpp:(.text+0x9d2): undefined reference to `wxEVT_NULL'
hello.o:hello.cpp:(.text$_Z16wxGet_wxConvLibcv[__Z16wxGet_wxConvLibcv]+0x7): undefined reference to `wxConvLibcPtr'
hello.o:hello.cpp:(.text$_Z16wxGet_wxConvLibcv[__Z16wxGet_wxConvLibcv]+0x10): undefined reference to `wxGet_wxConvLibcPt
r()'
hello.o:hello.cpp:(.text$_Z16wxGet_wxConvLibcv[__Z16wxGet_wxConvLibcv]+0x15): undefined reference to `wxConvLibcPtr'
hello.o:hello.cpp:(.text$_Z16wxGet_wxConvLibcv[__Z16wxGet_wxConvLibcv]+0x1a): undefined reference to `wxConvLibcPtr'
hello.o:hello.cpp:(.rdata+0x7c): undefined reference to `wxFrame::sm_eventTable'
hello.o:hello.cpp:(.text$_ZNK14wxFormatStringcvPKwEv[__ZNK14wxFormatStringcvPKwEv]+0xf): undefined reference to `wxForma
tString::AsWChar()'
hello.o:hello.cpp:(.text$_ZN8wxString7ImplStrEPKcRK8wxMBConv[__ZN8wxString7ImplStrEPKcRK8wxMBConv]+0x9): undefined refer
ence to `wxString::npos'
hello.o:hello.cpp:(.text$_ZN8wxString7ImplStrEPKcRK8wxMBConv[__ZN8wxString7ImplStrEPKcRK8wxMBConv]+0x26): undefined refe
rence to `wxString::ConvertStr(char const*, unsigned int, wxMBConv const&)'
hello.o:hello.cpp:(.text$_ZN8wxObjectaSERKS_[__ZN8wxObjectaSERKS_]+0x1d): undefined reference to `wxObject::Ref(wxObject
const&)'
hello.o:hello.cpp:(.text$_ZN10wxListBaseC2E9wxKeyType[__ZN10wxListBaseC2E9wxKeyType]+0xe): undefined reference to `vtabl
e for wxListBase'
hello.o:hello.cpp:(.text$_ZN10wxListBaseC2E9wxKeyType[__ZN10wxListBaseC2E9wxKeyType]+0x1e): undefined reference to `wxLi
stBase::Init(wxKeyType)'
hello.o:hello.cpp:(.text$_ZN50wxStringToStringHashMap_wxImplementation_HashTable5clearEv[__ZN50wxStringToStringHashMap_w
xImplementation_HashTable5clearEv]+0x24): undefined reference to `_wxHashTableBase2::DeleteNodes(unsigned int, _wxHashTa
ble_NodeBase**, void (*)(_wxHashTable_NodeBase*))'
hello.o:hello.cpp:(.text$_ZN47wxStringToNumHashMap_wxImplementation_HashTable5clearEv[__ZN47wxStringToNumHashMap_wxImple
mentation_HashTable5clearEv]+0x24): undefined reference to `_wxHashTableBase2::DeleteNodes(unsigned int, _wxHashTable_No
deBase**, void (*)(_wxHashTable_NodeBase*))'
hello.o:hello.cpp:(.text$_ZN23wxCriticalSectionLockerC1ER17wxCriticalSection[__ZN23wxCriticalSectionLockerC1ER17wxCritic
alSection]+0x19): undefined reference to `wxCriticalSection::Enter()'
hello.o:hello.cpp:(.text$_ZN23wxCriticalSectionLockerD1Ev[__ZN23wxCriticalSectionLockerD1Ev]+0x11): undefined reference
to `wxCriticalSection::Leave()'
hello.o:hello.cpp:(.text$_ZN8wxThread6IsMainEv[__ZN8wxThread6IsMainEv]+0x7): undefined reference to `wxThread::ms_idMain
Thread'
hello.o:hello.cpp:(.text$_ZN8wxThread6IsMainEv[__ZN8wxThread6IsMainEv]+0x10): undefined reference to `wxThread::GetCurre
ntId()'
hello.o:hello.cpp:(.text$_ZN8wxThread6IsMainEv[__ZN8wxThread6IsMainEv]+0x17): undefined reference to `wxThread::ms_idMai
nThread'
hello.o:hello.cpp:(.text$_ZN15wxLogRecordInfoC1EPKciS1_S1_[__ZN15wxLogRecordInfoC1EPKciS1_S1_]+0x41): undefined referenc
e to `wxThread::GetCurrentId()'
hello.o:hello.cpp:(.text$_ZN5wxLog9IsEnabledEv[__ZN5wxLog9IsEnabledEv]+0x13): undefined reference to `wxLog::IsThreadLog
gingEnabled()'
hello.o:hello.cpp:(.text$_ZN5wxLog9IsEnabledEv[__ZN5wxLog9IsEnabledEv]+0x1c): undefined reference to `wxLog::ms_doLog'
hello.o:hello.cpp:(.text$_ZN5wxLog14IsLevelEnabledEm8wxString[__ZN5wxLog14IsLevelEnabledEm8wxString]+0x35): undefined re
ference to `wxLog::GetComponentLevel(wxString)'
hello.o:hello.cpp:(.text$_ZN8wxLogger11DoCallOnLogEmRK8wxStringPc[__ZN8wxLogger11DoCallOnLogEmRK8wxStringPc]+0x25): unde
fined reference to `wxString::FormatV(wxString const&, char*)'
hello.o:hello.cpp:(.text$_ZN8wxLogger11DoCallOnLogEmRK8wxStringPc[__ZN8wxLogger11DoCallOnLogEmRK8wxStringPc]+0x3b): unde
fined reference to `wxLog::OnLog(unsigned long, wxString const&, wxLogRecordInfo const&)'
hello.o:hello.cpp:(.text$_ZN14wxEventFunctorC2Ev[__ZN14wxEventFunctorC2Ev]+0xe): undefined reference to `vtable for wxEv
entFunctor'
hello.o:hello.cpp:(.text$_ZN21wxEventTableEntryBaseC2EiiP14wxEventFunctorP8wxObject[__ZN21wxEventTableEntryBaseC2EiiP14w
xEventFunctorP8wxObject]+0x2d): undefined reference to `wxTheAssertHandler'
hello.o:hello.cpp:(.text$_ZN21wxEventTableEntryBaseC2EiiP14wxEventFunctorP8wxObject[__ZN21wxEventTableEntryBaseC2EiiP14w
xEventFunctorP8wxObject]+0x6b): undefined reference to `wxOnAssert(char const*, int, char const*, char const*, char cons
t*)'
hello.o:hello.cpp:(.text$_ZN21wxEventTableEntryBaseC2EiiP14wxEventFunctorP8wxObject[__ZN21wxEventTableEntryBaseC2EiiP14w
xEventFunctorP8wxObject]+0x72): undefined reference to `wxTrapInAssert'
hello.o:hello.cpp:(.text$_ZN21wxEventTableEntryBaseC2EiiP14wxEventFunctorP8wxObject[__ZN21wxEventTableEntryBaseC2EiiP14w
xEventFunctorP8wxObject]+0x8c): undefined reference to `wxTrapInAssert'
hello.o:hello.cpp:(.text$_ZN21wxEventTableEntryBaseC2EiiP14wxEventFunctorP8wxObject[__ZN21wxEventTableEntryBaseC2EiiP14w
xEventFunctorP8wxObject]+0x92): undefined reference to `wxTrap()'
hello.o:hello.cpp:(.text$_ZN12wxEvtHandler9TryParentER7wxEvent[__ZN12wxEvtHandler9TryParentER7wxEvent]+0x15
...blah, blah, blah, it goes on from there. Obviously there are files missing from the link or path or something I don't even know about, or some combination of all of them. But what files? Where? How do I find out? How do I add them to the link command?
Suggestions?
doublemax, I've been struggling with getting wxWidgets to work for two weeks, and this is as far as I've gotten. I try to follow directions, but they often don't work, and I find out later that the directions are for Unix or Code::Blocks or Visual Studios or some other development platform. Or they're for Netbeans, like I want, but the directories given in things like environment variables, don't match any directory structure that I have.
Why is this so HARD?
Is ALL coding with wxWidgets like this?
If you don't mind my asking--you said you coded with wxWidgets in Visual Studios. How does that work? You make your screens using wxWidgets commands, or what?