Author Topic: Codeblocks compile errs on 1889  (Read 5244 times)

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2162
Codeblocks compile errs on 1889
« on: January 28, 2006, 12:49:59 am »
I'm getting the following errs trying to use codeblocks
to compile itself for svn 1889.

Any way around this?

Code: [Select]
Compiling: sdk/compilerfactory.cpp

Compiling: sdk/compileroptions.cpp

Compiling: sdk/compiletargetbase.cpp

Compiling: sdk/configmanager.cpp
sdk/configmanager.cpp: In static member function ‘static wxString ConfigManager::GetConfigFolder()’:
sdk/configmanager.cpp:372: error: ‘wxDir’ has not been declared
sdk/configmanager.cpp:372: error: cannot call member function ‘bool ConfigManager::Exists(const wxString&)’ without object


Process terminated with status 1 (29 minutes, 30 seconds)
2 errors, 89 warnings



Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5177
Re: Codeblocks compile errs on 1889
« Reply #1 on: January 28, 2006, 12:55:43 am »
I just did my nightly build with this, and everyting went OK. (on windows that was)

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2162
Re: Codeblocks compile errs on 1889
« Reply #2 on: January 28, 2006, 12:57:20 am »
I tried this three times, This is ubuntu 510 and
did an svn update twice. Second one said it had
nothing to do.

thanks
pecan

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5177
Re: Codeblocks compile errs on 1889
« Reply #3 on: January 28, 2006, 12:59:21 am »
tomorrow I will try it also on my linux box. But hey, maybe it will be fixed by then. ;-)
Lucky for me, but that does not help you of course.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2162
Re: Codeblocks compile errs on 1889
« Reply #4 on: January 28, 2006, 01:03:02 am »
Ok, I'll call it a night. I was just excited about trying
some changes I'd make to cbDragScroll. Wanted to see
if they worked on linux.

thanks
pecan

Offline atwins

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Codeblocks compile errs on 1889
« Reply #5 on: January 28, 2006, 02:36:53 am »
#include <wx/dir.h>

is not listed in sdk.h,  That's all.


Offline atwins

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Codeblocks compile errs on 1889
« Reply #6 on: January 28, 2006, 02:53:55 am »
...along with several others.  Compare sdk.h with sdk_precomp.h.

I know I'm new here, and I apologize for jumping on this forum, but why have the same huge set of includes in 2 different places? Should there not be a single set of wx includes that could be used in all cases?

I just completed a "make && make install" of 1889.  Runs fine.  Still has that annoying "Close Project with editor windows open" bug.  But other than that, It's cool.

Offline polygon7

  • Multiple posting newcomer
  • *
  • Posts: 104
    • Home site
best regards,
p7
 Free open source UML modeling tool: ArgoUML

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Codeblocks compile errs on 1889
« Reply #8 on: January 28, 2006, 02:12:36 pm »
Hmmm... this sounds like a stupid question, but how can this patch fix that error?

configmanager.cpp includes sdk_precomp.h (which already includes the files added by the patch), but the patch modifies sdk.h which is only used by the sources in the src directory, but not by the SDK. The sources in src are not #ifdefed though, so they include the files they require anyway.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Der Meister

  • Regular
  • ***
  • Posts: 307
Re: Codeblocks compile errs on 1889
« Reply #9 on: January 28, 2006, 02:18:50 pm »
I don't know how it solves the problem but it does. I also had to add <wx/dir.h> and <wx/wfstream.h> (but no more) to sdk.h to compile revision 1889 with gcc 3.4.4 on Linux...
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5177
Re: Codeblocks compile errs on 1889
« Reply #10 on: January 28, 2006, 02:47:43 pm »
how about doing the simple thing :
add include of <wx/dir.h> in configmanager.cpp  (like always).

Basic rule : include what you need, don't depend on others (other header files) including it for you, in that way it is more obvious and visible to the programmer also. It seems it is also included ifndef CB_PRECOMP.
I am not so up to data on precompiled headers (and because of that, not so fond of them), I know some things about it, have read stuff about it, but on for example mfc projects on windows  I have experienced several problems with them. I don't like them, but as said maybe I should study them a bit more.

Back to the problem : my compile on linux also fails with the above mentioned problem. I have GCC 4.0.2.
So that would mean that CB_PRECOMP is probably defined, did not test or look for it yet. So forgive my possible ignorance.




Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Codeblocks compile errs on 1889
« Reply #11 on: January 28, 2006, 06:52:04 pm »
OK, finally found the reason. As usual, the solution that you fail to see is the obvious one :lol:

sdk_precomp.h contains this:
Code: [Select]
#ifndef __WXMSW__
// For non-windows platforms, one PCH (sdk.h) is enough...
#include <sdk.h>
#else
...
All the includes are in the else branch. I have no idea what the reasoning behing this is, but hey ;)

Committed patch :)


Quote
how about doing the simple thing : add include of <wx/dir.h> in configmanager.cpp  (like always).
This is done, but only if no precompilation is used.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline atwins

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Codeblocks compile errs on 1889
« Reply #12 on: January 28, 2006, 11:29:03 pm »
OK, look.  The reason for the non-compiling problem was that the same list of includes is in 2 places: sdk.h and sdk_precomp,h.  Linux uses sdk.h and windows gets the other.  Updating sdk_precomp.h with a wx include (eg wx/dir.h) does not automatically put it in sdk.h.  Somebody has to KNOW to put it in 2 places.  Never the way to go if it is easy to avoid. 

That huge list of includes should be independent and in its own file and included in both sdk.h and sdk_precomp.h.  This is the brute-force solution.  The subtle solution is to have all the includes that are common to both platforms in one file and only the unique Windows or Unix or whatever in separate files.  But that would take a bit more knowledge of the entire program and its architecture than I have at this time.

I'll try to be quiet now...