const wxString DESCR = _("Welcome to ") + APP_NAME + _T(" v") + APP_VERSION + _T("!\n") + APP_NAME +
_(" is a full-featured IDE (Integrated Development Environment) "
"aiming to make the individual developer (and the development team) "
"work in a nice programming environment offering everything he/they "
"would ever need from a program of that kind.\n"
"Its pluggable architecture allows you, the developer, to add "
"any kind of functionality to the core program, through the use of "
"plugins...\n");
I know for a fact that it crashes on APP_NAME..... C::B fails to load with the above code why????
I think APP_NAME stopped being a macro and began being a variable.
Yes, someone who changed APP_NAME and their friends to be a variable, forgot to update all the code.
Just do a Find in Files search and you'll notice. :)
Move it to appglobals.cpp
That code above is in dlgabout.cpp no way it can go to appglobals.cpp. I want to know why the above code crashes and other code that uses APP_NAME doesn't.....
APP_NAME.c_str() ...................
Quote from: Takeshi Miya on January 24, 2006, 03:30:03 AM
APP_NAME.c_str() ...................
Hmmm...
const wxString DESCR = _("Welcome to ") + APP_NAME.c_str() + _T(" v") + APP_VERSION.c_str() +
_T("!\n") + APP_NAME.c_str() +
_(" is a full-featured IDE (Integrated Development Environment) "
"aiming to make the individual developer (and the development team) "
"work in a nice programming environment offering everything he/they "
"would ever need from a program of that kind.\n"
"Its pluggable architecture allows you, the developer, to add "
"any kind of functionality to the core program, through the use of "
"plugins...\n");
src\dlgabout.cpp:32: error: invalid operands of types `const wxChar*' and `const wxChar*' to binary `operator+'
Heh, that's true, trying to add pointers to char... :P
wxString(APP_NAME) would do the trick then :D
Quote from: Takeshi Miya on January 24, 2006, 03:46:34 AM
Heh, that's true, trying to add pointers to char... :P
wxString(APP_NAME) would do the trick then :D
Alreadey did that. It crashes too. :P
This doesn't crash
wxString(APP_NAME.c_str())
but I get no text.... :lol:
What is going on??? :?
Move it to appglobals.cpp
It's trying to initialize that variable before APP_NAME is set to anything.
I know, I made this change a few days ago...
Sam is right as far as the problem is concerned. It is a problem of order of initialisation.
But his solution is not good, the variable does not belong into app.cpp oops... appglobals.cpp.
Quote from: 280Z28 on January 24, 2006, 05:34:30 AM
Move it to appglobals.cpp
See Sam? That's what I was talking about in our PM conversation the other day...
sethjackson, Sam got it right: it's a global creation order problem.
But for heaven's sake don't move it to appglobals! :shock:
Just move it inside the function where it is used. IIRC it's only used in the constructor.
I renamed it to APP_DESC when I moved it. It seemed reasonable to say that's the description of Code::Blocks, and I put an extern blah blah in appglobals.h.
I'd say it's as relevant in the global scope as APP_NAME is, plus you don't have to worry about going to find it in some dialog code when it's more relevant to the app than it is to that specific dialog. I stand that it should go in appglobals.h/cpp :)
Quote from: mandrav on January 24, 2006, 08:39:40 AM
Quote from: 280Z28 on January 24, 2006, 05:34:30 AM
Move it to appglobals.cpp
See Sam? That's what I was talking about in our PM conversation the other day...
sethjackson, Sam got it right: it's a global creation order problem.
But for heaven's sake don't move it to appglobals! :shock:
Just move it inside the function where it is used. IIRC it's only used in the constructor.
Yeah I won't. I got a PM from thomas about this (sort of)..... I will start coding after lunch. :D