Author Topic: Can't build C::B (SVN 4698) for Redhat Enterprise 4.0 ("wxChoice undeclared")  (Read 6098 times)

Offline bgolding

  • Multiple posting newcomer
  • *
  • Posts: 10
Hi all,

As part of my "day job" I'm trying to build C::B from SVN on a RedHat system. Following these instructions:
http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux

I've successfully:
  • built wxGTK 2.8.7 from source
  • ./bootstrap
  • ./configure --with-contrib-plugins=all --prefix=/blah/foo/bar

I'm using a version of g++ 3.3.6 built at our site, and also have set LINK=g++ (is this correct?) to avoid linking with 'ld', on the advice of other Linux developers here.

I've added these to my .cshrc:
  • setenv PATH "${HOME}/wx2.8.7/bin:${PATH}"
  • setenv LD_LIBRARY_PATH "${HOME}/wx2.8.7/lib:${LD_LIBRARY_PATH}"
  • setenv ACLOCAL_FLAGS "-I ${HOME}/wx2.8.7/share/aclocal ${ACLOCAL_FLAGS}"

When running 'make' I get 'wxChoice undeclared' errors (see attached). I suspect I'm missing a preprocessor define of 'wxUSE_CHOICE'. This makes me think that something went wrong earlier in the configure.

Any pointers appreciated :)
I can provide more info about my setup but I'm not sure what would be relevant.

[attachment deleted by admin]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Try adding an include <wx/choice.h> to file advancedcompileroptionsdlg.cpp.

If that does not work, it could be as you think an error in setup.h, but that is rare. While missing includes are common.

Tim S

Code
Index: src/plugins/compilergcc/advancedcompileroptionsdlg.cpp
===================================================================
--- src/plugins/compilergcc/advancedcompileroptionsdlg.cpp (revision 4699)
+++ src/plugins/compilergcc/advancedcompileroptionsdlg.cpp (working copy)
@@ -1,6 +1,7 @@
 #include "sdk.h"
 #ifndef CB_PRECOMP
 #include <wx/checkbox.h>
+#include <wx/choice.h>
 #include <wx/combobox.h>
 #include <wx/intl.h>
 #include <wx/listbox.h>
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Try adding an include <wx/choice.h> to file advancedcompileroptionsdlg.cpp.
Hmm... I don't think anyone has touched that source file for 4-6 weeks. Thus, if this #include was missing, one of the several hundred Linux users building Code::Blocks regularly should have had that problem several weeks ago already, I think. (Otherwise, we seriously need to work on our communication, guys ;)).

But it's worth a shot anyway. Try it, and if it works for you, then that is better than nothing. Just, be aware that you might indeed have a setup error, so don't be surprised if you see that same error again in another project later.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline oswaldm

  • Single posting newcomer
  • *
  • Posts: 7

Yup, I had the problem on several files in some builds. Since it were only include-files I simply added them and didn't bother of reporting it. It did improve a lot over the last two months.

Maybe it's system specific because I cannot imagine, that from large count of people who built it, nobody else reported it. My system is a SuSE Linux Enterprise Server 9 (the OP has a Redhat Enterprise 4), so maybe it's an "Enterprise" issue :))

lg,
Michael

Offline bgolding

  • Multiple posting newcomer
  • *
  • Posts: 10
Up and running  :D :D :D

Can someone please commit Tim S's patch. I guess most Linux users have precompiled headers enabled so they don't see this.



[attachment deleted by admin]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Added comment to Nightly Build thread.

http://forums.codeblocks.org/index.php/topic,7402.msg56342.html#msg56342

It would be best if you confirmed it fixed the issue and state details of your system
wxWidgets Version
Linux Edition and Version

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org