[MacOS10.4.10, wxMac2.8, gcc 4.0.1] Resuscitating an old thread: "Automating" the use of wx-config

Riccardo Cohen rcohen at articque.com
Fri Sep 14 14:07:10 PDT 2007


I don't know if wxwidget code can work without specific wxwidget 
initializations and deinit (at exit)

I suggest you build a minimal app (like minimal sample) and test from there.

David Goldsmith wrote:
> Riccardo Cohen wrote:
>> I did not know there was a difference between cppflags and cxxflags.
>> Anyway I really suggest not to use wx-config if you don't use 
>> wxwidgets. We have built here a small library with no user interface. 
>> It does not use wxwidgets and we compile it on windows,mac,linux 
>> without wx-config, without wx lib and headers. We use it in many 
>> projects including wxwidgets user interfaces with no problem.
>>
>> Why do you need a "driver" for your class ? what does this class do, 
>> and what do you want to test ?
> Other member functions in the class (which someone else wrote), as well 
> as other classes it is derived from and other member objects and method 
> arguments which are somehow referenced (compilation w/out wx yields a 
> load of unresolved wx reference errors at the linking stage) use wx - 
> it's part of a large wx application, in other words.  However, the 
> particular method I need to test - numerical in nature - does not use 
> wx; I tried compiling it w/out wx and got can't find wx/wx.h and 
> wx/setup.h errors.  I found those, added the paths to them to my CPATH, 
> and got other compile errors which reminded me about wx-config.
> 
> DG
>>
>> David Goldsmith wrote:
>>> David Goldsmith wrote:
>>>> On a hunch, I tried replacing --cppflags w/ -cxxflags and got a 
>>>> whole slew of compile errors - many steps back, but a big step 
>>>> forward???  Also, I remembered: is _the_ problem (semi-rhetorical 
>>>> question: I know it's _a_ problem) that I'm using main, not 
>>>> declaring a wx.App?  Thanks!
>>> Except, I don't want to explicitly use any wx features, all I want is 
>>> a "minimal driver" for a particular class method I want to test; that 
>>> class (as well as it's parents) has some wx dependencies, but the 
>>> method I want to test doesn't - if the only reason I'm building 
>>> against wx is because it seems I have to in order to eliminate 
>>> "unresolved external reference" link errors, must I still use the 
>>> wx.App/wx.Frame formalism instead of the main() formalism?  Thanks 
>>> again!
>>>
>>> DG
>>>>
>>>> David Goldsmith wrote:
>>>>> Riccardo Cohen wrote:
>>>>>> it seems that the resulting config used gcc instead of g++, I 
>>>>>> couldn't say why
>>>>> Thanks Riccardo.  Well, my /usr/bin/gcc is a link to gcc-4.0.1, not 
>>>>> g++-4.0.1.  I can change it manually (I can't see in the gcc_select 
>>>>> man page how to change it to anything other than a version of gcc), 
>>>>> but if wx-config should be calling g++ instead of gcc, I'd rather 
>>>>> fix that, but how?
>>>>>
>>>>> DG
>>>>>>
>>>>>> David Goldsmith wrote:
>>>>>>> Matt Connolly wrote:
>>>>>>>> Actually, to fully make use of the "wx-config" command you can do:
>>>>>>>>
>>>>>>>> For compiling:
>>>>>>>>
>>>>>>>> `wx-config --cc` `wx-config --cppflags` <my_flags> 
>>>>>>>> <source_files> ...
>>>>>>>>
>>>>>>>> For linking:
>>>>>>>>
>>>>>>>> `wx-config --ld` `wx-config --libs` <my_flags> <object_files> ...
>>>>>>>>
>>>>>>>> -matt
>>>>>>> Hi, folks!  Haven't used this method in a while and I don't 
>>>>>>> remember if I had the same problem last time I did.  The above 
>>>>>>> implies to me that `wx-config --cc` `wx-config --cppflags` 
>>>>>>> <my_flags> <source_files> will stop after compiling, i.e., not 
>>>>>>> proceed on to linking, but that is not what I'm observing:
>>>>>>>
>>>>>>> dg$ `wx-config --cc` `wx-config --cppflags` -Wno-deprecated -I 
>>>>>>> ../../../Source/CompCore *cpp ../../../Source/CompCore/*.cpp
>>>>>>> /usr/bin/ld: Undefined symbols:
>>>>>>> __Unwind_Resume
>>>>>>> wxThread::TestDestroy()
>>>>>>> wxThread::~wxThread()
>>>>>>> typeinfo for wxThread
>>>>>>> vtable for __cxxabiv1::__si_class_type_info
>>>>>>> operator delete(void*)
>>>>>>> operator new(unsigned long)
>>>>>>> ___gxx_personality_v0
>>>>>>> wxStringBase::npos
>>>>>>> wxStringBase::InitWith(char const*, unsigned long, unsigned long)
>>>>>>> wxMessageBox(wxString const&, wxString const&, long, wxWindow*, 
>>>>>>> int, int)
>>>>>>> vtable for __cxxabiv1::__class_type_info
>>>>>>> ___cxa_begin_catch
>>>>>>> ___cxa_end_catch
>>>>>>> operator new[](unsigned long)
>>>>>>> _dgbtrf_
>>>>>>> _dgbtrs_
>>>>>>> collect2: ld returned 1 exit status
>>>>>>>
>>>>>>> i.e., `wx-config --cc` `wx-config --cppflags` <my_flags> 
>>>>>>> <source_files> is proceeding on to linking - am I just 
>>>>>>> misinterpreting "For compiling:"?
>>>>>>>
>>>>>>> Second Q: why am I getting the (wx) linking errors?
>>>>>>>
>>>>>>> DG
>>>>>>>
>>>>>>> --------------------------------------------------------------------- 
>>>>>>>
>>>>>>> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
>>>>>>> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
> 

-- 
Très cordialement,

Riccardo Cohen
ligne directe : 02-47-49-63-24
-------------------------------------------
Articque
http://www.articque.com
149 av Général de Gaulle
37230 Fondettes - France
tel : 02-47-49-90-49
fax : 02-47-49-91-49





More information about the wx-users mailing list