wxConfig compile problem

Samuel Bisbee-vonKaufmann sbisbee at bu.edu
Sun Nov 5 20:47:52 PST 2006


Greetings,

I am having trouble using wxConfig. My system info:

Ubuntu Dapper
g++ (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5)
libgtk2.0-0 version: 2.8.17-1ubuntu5
wxWidgets 2.7.1, compiled with: `../configure --with-gtk --enable-unicode 
--enable-debug --enable-shared --with-libjpeg`

I have included <wx/config.h> and <wx/confbase.h> in the header 
file. Source code (I have other stuff, but stripped it down to the basics 
for debugging):

Environment::Environment(wxString fname) //line 11
{
   //set up config
   configName = fname;
   configFile* = new wxConfig(configName);//line 15

   //store default values
   configMap[wxT("foo")] = wxT("bar");
   configMap[wxT("yes")] = wxT("1");
}					 //line 20

Environment::~Environment()
{
   //save changes, creating file if needed
   delete configFile;			 //line 25
}

Output from make:

g++ -g -D__LINUX__ -I/usr/local/lib/wx/include/gtk2-unicode-debug-2.7 
-I/usr/local/include/wx-2.7 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES 
-D__WXDEBUG__ -D__WXGTK__ -pthread -I/usr/local/include -I/usr/include -o 
TuxWorx wxTuxcards.cc tc_filepage.cc about.cc Environment.cc
wxTuxcards.cc: In constructor MyFrame::MyFrame(wxWindow*, wxWindowID, 
const wxString&, const wxPoint&, const wxSize&, long int):
wxTuxcards.cc:87: warning: SetFrame is deprecated (declared at 
/usr/local/include/wx-2.7/wx/aui/framemanager.h:455)
Environment.cc: In constructor Environment::Environment(wxString):
Environment.cc:15: error: configFile was not declared in this scope
Environment.cc:15: error: expected primary-expression before = token
Environment.cc: In destructor Environment::~Environment():
Environment.cc:25: error: configFile was not declared in this scope
make: *** [TuxWorx.o] Error 1

Others have compiled this code without error. Please disregard the 
deprecation warning as the program was originaly written in pre-2.7.1 
wxWidgets.

I have tried searching Google and talking to a wxWidgets developer, both 
without successful results.

Thanks,

-----
Samuel Kotel Bisbee-vonKaufmann | "A computer once beat me at chess, but
   Boston University, Undergrad. | it was no match for me at kick boxing."
   OFTC.net, Network Operator    | -Emo Philips




More information about the wx-users mailing list