Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: KirkD on December 08, 2009, 06:27:41 pm

Title: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: KirkD on December 08, 2009, 06:27:41 pm
I just downloaded the latest trunk (5964) and am trying to build on a LINUX platform (Centos 5.4.3, all updates present, GCC 4.4.2, wx 2.9, etc.)

./boostrap and ./configure seem to go fine, then when I start the build process (make) I get the following errors:

In file included from ../../../src/include/sdk_common.h:59,
                 from ../../../src/include/sdk_precomp.h:13,
                 from tinywxuni.cpp:1:
/usr/include/wx-2.8/wx/filename.h: In static member function 'static wxChar wxFileName::GetPathSeparator(wxPathFormat)':
/usr/include/wx-2.8/wx/filename.h:393: error: ambiguous overload for 'operator[]' in 'wxFileName::GetPathSeparators(wxPathFormat)()[0u]'
/usr/include/wx-2.8/wx/filename.h:393: note: candidates are: operator[](const wxChar*, long int) <built-in>
/usr/include/wx-2.8/wx/string.h:822: note:                 wxChar& wxString::operator[](int)
/usr/include/wx-2.8/wx/string.h:824: note:                 wxChar& wxString::operator[](size_t)



Is this a code error or a build error on my part?  It seems to be a code problem.

Any suggestions?

-Kirk



-
Title: Re: ambiguous overload for 'operator[
Post by: KirkD on December 08, 2009, 06:46:36 pm
I also see this list of warnings in the ./configure output - seems important.

checking fcntl.h usability... no
checking fcntl.h presence... yes
configure: WARNING: fcntl.h: present but cannot be compiled
configure: WARNING: fcntl.h:     check for missing prerequisite headers?
configure: WARNING: fcntl.h: see the Autoconf documentation
configure: WARNING: fcntl.h:     section "Present But Cannot Be Compiled"
configure: WARNING: fcntl.h: proceeding with the preprocessor's result
configure: WARNING: fcntl.h: in the future, the compiler will take precedence
configure: WARNING:     ## ------------------------------------- ##
configure: WARNING:     ## Report this to the codeblocks lists.  ##
configure: WARNING:     ## ------------------------------------- ##
checking for fcntl.h... yes
checking limits.h usability... no
checking limits.h presence... yes
configure: WARNING: limits.h: present but cannot be compiled
configure: WARNING: limits.h:     check for missing prerequisite headers?
configure: WARNING: limits.h: see the Autoconf documentation
configure: WARNING: limits.h:     section "Present But Cannot Be Compiled"
configure: WARNING: limits.h: proceeding with the preprocessor's result
configure: WARNING: limits.h: in the future, the compiler will take precedence
configure: WARNING:     ## ------------------------------------- ##
configure: WARNING:     ## Report this to the codeblocks lists.  ##
configure: WARNING:     ## ------------------------------------- ##
checking for limits.h... yes
checking for stdlib.h... (cached) no
checking for string.h... (cached) no
checking sys/param.h usability... no
checking sys/param.h presence... yes
configure: WARNING: sys/param.h: present but cannot be compiled
configure: WARNING: sys/param.h:     check for missing prerequisite headers?
configure: WARNING: sys/param.h: see the Autoconf documentation
configure: WARNING: sys/param.h:     section "Present But Cannot Be Compiled"
configure: WARNING: sys/param.h: proceeding with the preprocessor's result
configure: WARNING: sys/param.h: in the future, the compiler will take precedence
configure: WARNING:     ## ------------------------------------- ##
configure: WARNING:     ## Report this to the codeblocks lists.  ##
configure: WARNING:     ## ------------------------------------- ##
checking for sys/param.h... yes
checking for unistd.h... (cached) no
checking malloc.h usability... no
checking malloc.h presence... yes
configure: WARNING: malloc.h: present but cannot be compiled
configure: WARNING: malloc.h:     check for missing prerequisite headers?
configure: WARNING: malloc.h: see the Autoconf documentation
configure: WARNING: malloc.h:     section "Present But Cannot Be Compiled"
configure: WARNING: malloc.h: proceeding with the preprocessor's result
configure: WARNING: malloc.h: in the future, the compiler will take precedence
configure: WARNING:     ## ------------------------------------- ##
configure: WARNING:     ## Report this to the codeblocks lists.  ##
configure: WARNING:     ## ------------------------------------- ##
Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: stahta01 on December 08, 2009, 07:00:54 pm
What version of wxwidgets are you trying to use 2.8.?? or 2.9.?? please say which and fill in the ?? marks?

OS 32 or 64 bits?
Build 32 or 64 bits?

Tim S.
Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: KirkD on December 08, 2009, 07:23:39 pm
Tim:

I have wxBase 2.8.9 installed as per yum info wx*.  I also have wxGTK 2.8.10 and wxGTK-devel 2.8.10 installed.

In the./configure output I see:

checking for wxWidgets version > 2.8.0... yes (version 2.8.9). 

OS is 64-bit.

As for build 64-bit vs 32-bit, I'm not sure I understand the question.  I'm building in a 64-bit environment using 64-bit libraries.  Obviously there are 32-bit libraries floating around and compatibility libraries available, but I would assume I'm all 64-bit.

-Kirk




Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: stahta01 on December 08, 2009, 07:26:38 pm
Tim:

I have wxBase 2.8.9 installed as per yum info wx*.  I also have wxGTK 2.8.10 and wxGTK-devel 2.8.10 installed.

In the./configure output I see:

checking for wxWidgets version > 2.8.0... yes (version 2.8.9).  

OS is 64-bit.

As for build 64-bit vs 32-bit, I'm not sure I understand the question.  I'm building in a 64-bit environment using 64-bit libraries.  Obviously there are 32-bit libraries floating around and compatibility libraries available, but I would assume I'm all 64-bit.

-Kirk

wxWidgets 2.8 is NOT 64 bit capable under windows; not sure what the status is for Linux.

Edit: The errors you are getting look like 32/64 bit issues.

Tim S.
Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: oBFusCATed on December 08, 2009, 07:29:29 pm
Tim: wx works 100% under linux 64bit

KirkD: do you have the -dev packages? linux-headers, full gcc. What is the output of wx-config?
Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: KirkD on December 08, 2009, 07:36:05 pm
All of my installs are x86_64 - usually i386 are also carried along.

I do have the -devel packages installed for wxGTK.  wxBase doesn't seem to have a -devel package.  If I do

yum info wxBase*

I get this:

Package wxBase is obsoleted by wxGTK, trying to install wxGTK-2.8.10-1.el5.rf.x86_64 instead
Package wxGTK-2.8.10-1.el5.rf.x86_64 already installed and latest version
Package wxBase is obsoleted by wxGTK, trying to install wxGTK-2.8.10-1.el5.rf.x86_64 instead
Package wxGTK-2.8.10-1.el5.rf.x86_64 already installed and latest version
Nothing to do


The LINUX headers (kernel-headers, kernel-devel) are also there.  I have the full GCC package also - built from scratch, full install, used to compile about a dozen other packages from source over the past week.

Output of wx-config is:

wx-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--release] [--version-full]
           [--list] [--selected-config] [--host=HOST] [--toolkit=TOOLKIT]
           [--universal[=yes|no]] [--unicode[=yes|no]] [--debug[=yes|no]]
           [--static[=yes|no]] [--version[=VERSION]] [--basename] [--cc]
           [--cppflags] [--cflags] [--cxxflags] [--rescomp] [--libs] [--cxx]
           [--ld] [--linkdeps] [--utility=UTIL] [LIB ...]

    wx-config returns information about the wxWidgets libraries available on
  your system.  It may be used to retrieve the information required to build
  applications using these libraries using --cppflags, --cflags,  --cxxflags
  and --libs options.

    If multiple builds of wxWidgets  are available,  you can use the options
  --prefix, --host, --toolkit, --unicode, --debug, --static, --universal and
  --version to select from them. The --selected-config option shows the name
  of the current configuration and --list shows available alternatives which
  match specified criteria. The --utility option returns the correct version
  of UTIL to use with the selected build. The --linkdeps option returns only
  static libraries for your makefile link rule dependencies.

    Optional LIB arguments (comma or space separated) may be used to specify
  the wxWidgets libraries that  you wish  to use.  The magic "std" label may
  be used to import all libraries that would be used by default if none were
  specified explicitly, e.g. wx-config --libs core,base.


Is there a specific command I should give?

-Kirk


Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: stahta01 on December 08, 2009, 07:42:25 pm
wx-config --list

IIRC, The above is a common way to see which wx libs you have under Linux.

Tim S.
Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: KirkD on December 08, 2009, 08:19:10 pm
wx-config --list gives:

Default config is gtk2-unicode-release-2.8

  Default config will be used for output



I'm beginning to wonder if the wx libraries available in the RH repos aren't the complete set needed to compile Code::Blocks.
Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: KirkD on December 08, 2009, 08:58:42 pm
I've just started a build on a fresh Fedora 12 install and it appears to be going fine.  It at least got past the point where the CentOS machine failed.  Unfortunately, this is an i386 install of Fedora, so I can't say for certain that there is no difference there.  I would suspect this is a distant possibility and that there is some difference in the installed libraries.  If anyone has any guess on how to diagnose the library differences, I would be very appreciative to hear them.

-Kirk

Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: KirkD on December 08, 2009, 09:07:33 pm
Could there be a difference between wx 2.8.9 (on my failing CentOS install) and 2.8.10 (on the currently working Fedora install)?

Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: Jenna on December 08, 2009, 11:35:46 pm
Could there be a difference between wx 2.8.9 (on my failing CentOS install) and 2.8.10 (on the currently working Fedora install)?



If I understood correctly:
I have wxBase 2.8.9 installed as per yum info wx*.  I also have wxGTK 2.8.10 and wxGTK-devel 2.8.10 installed.
you have wxWidgets 2.8.9 and 2.8.10 mixed. This might cause problems.

I suggest removing 2.8.9 and only using 2.8.10.

I use wxWidgets from rpmforge on my virtual centos 5.4 box (but it's only 32-bit at the moment).

By the way: wxWidgets definitely works on 64-bit linuxes. I use it everyday on my debian machine, without any problems.

Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: KirkD on December 09, 2009, 12:25:35 am

you have wxWidgets 2.8.9 and 2.8.10 mixed. This might cause problems.

I suggest removing 2.8.9 and only using 2.8.10.



Yes, seems odd.  When I install via yum install wxGTK-devel I end up with wxGTK-2.8.10 which has wxBase-2.8.9 as a dependency.  Seems off, but that's the nature of it.

At this point it seems clear that there is something wrong with my wx configuration.  I've gone through a few iterations of building wx (ansi vs unicode - unicode fixes a few errors, --with-GTK vs. without - GTK fixes a few errors) but I still have a few errors.  I've removed all my installs (make uninstall in each directory) and yum erase'd all wx vestiges.  I'm actively working on this for wx:

../configure --enable-xrc --enable-monolithic --enable-unicode

Interestingly, on my fresh install of Fedora 12 (running in VirtualBox), the Code::Blocks build went first try, no errors, no dependencies.

-Kirk

Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: Jenna on December 09, 2009, 12:41:08 am
If wxGTK-2.8.10 has wxBase-2.8.9 as dependency, something went wrong.
I don't think that this can work properly.

As written before I have wxwidgets from rpmforge (http://wiki.centos.org/AdditionalResources/Repositories/RPMForge (http://wiki.centos.org/AdditionalResources/Repositories/RPMForge)) and it works without any such strange errors.
I don't know, whether 64-bit packages are also available fom there, but I think so.
Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: KirkD on December 09, 2009, 12:50:08 am
RPMForge is in my repolist and that is where the packages I mentioned are coming from.  I just double checked and indeed if I issue

yum install wxGTK-devel

I get wxGTK-devel 2.8.10 along with wxBase 2.8.9.  This could be the source of the problem as you mentioned.  

Like I said, I removed all traces of wx from my system (packages and my custom builds) and then I went back to rebuild wx as per this page:  http://vunh.blogspot.com/2009/05/codeblocks-installation-in-centos.html

wx built fine and I now have it in a custom directory - /opt/wx/2.8 - I can't see that this should matter much.   Currently the Code::Blocks build as per:

./configure --with-contrib-plugins=all
make

is cruising along nicely.  It has definitely gone further than ever before.  Once it finishes - if it finishes - I'll post back here my results.

-Kirk


EDIT:  I corrected ./configure --enable-contrib-plugins=all to ./configure --with-contrib-plugins=all.
Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: Jenna on December 09, 2009, 12:54:14 am
--enable-contrib-plugins=all should lead to an "unrecognized option"-warning, --with-contrib-plugins=all is correct.
Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: KirkD on December 09, 2009, 12:58:08 am
--enable-contrib-plugins=all should lead to an "unrecognized option"-warning, --with-contrib-plugins=all is correct.


You are correct.  I corrected the original message.  Thank you.
Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: KirkD on December 09, 2009, 01:37:56 am
Done.

It seemed to work just fine following that web page.  It wasn't able to find the wx libraries and gave a shared object not found (file not found) error at first, which seemed to correct itself.  Regardless, it works fine now.

Oddly, the downloaded version was 5964 and the splash screen says 5961.  Not that it matters.

-Kirk

Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: Jenna on December 09, 2009, 08:25:05 am
Oddly, the downloaded version was 5964 and the splash screen says 5961.  Not that it matters.
That's because the revision 5962 to 5964 are commits to other (test-branches), not to trunk.
Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: Jenna on December 10, 2009, 11:48:00 am
I just finished an install of centos 5.4 64-bit.

I did not install anything non-standard except for wxWidgets from rpmforge, using this instructions: http://wiki.centos.org/AdditionalResources/Repositories/RPMForge (http://wiki.centos.org/AdditionalResources/Repositories/RPMForge).

No wxWidgets 2.8.9 on my system, also no wxbase (not even available).
After installing automake, libtool, gcc,  g++ (both 4.1) and bzip2-devel (the automake-system should look for it if needed [help-plugin as far as I know needs it], but I will fix this [most likely this weekend]), everything compiles without error and runs flawlessly.

So I think something on your system is terribly messed up.
Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: KirkD on December 10, 2009, 05:37:06 pm
Well, "terribly messed up" seems a bit of an extreme assessment.

What do you get from

yum list wx*

and

yum deplist wxGTK*


?
Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: Jenna on December 10, 2009, 06:29:44 pm
Code
[jens@localhost ~]$ yum list wx*
Loaded plugins: fastestmirror, priorities
443 packages excluded due to repository priority protections
Installed Packages
wxGTK.x86_64                         2.8.10-1.el5.rf                   installed
wxGTK-devel.x86_64                   2.8.10-1.el5.rf                   installed
Available Packages
wxGTK-gl.x86_64                      2.4.2-5.el5.rf                    rpmforge
wxGTK-stc.x86_64                     2.4.2-5.el5.rf                    rpmforge
wxGTK-xrc.x86_64                     2.4.2-5.el5.rf                    rpmforge
wxPython.x86_64                      2.8.9.1-1.el5.rf                  rpmforge
wxPython-devel.x86_64                2.8.9.1-1.el5.rf                  rpmforge
wxsvg.x86_64                         1.0-0.2.b7.el5.rf                 rpmforge
wxsvg-devel.x86_64                   1.0-0.2.b7.el5.rf                 rpmforge
Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: KirkD on December 10, 2009, 07:22:06 pm
And yum deplist wxGTK*?

or better yet:

yum deplist wxGTK* | grep wxBase

Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: Jenna on December 10, 2009, 07:56:08 pm
yum deplist wxGTK* | grep wxBase

nothing
Title: Re: Building Code::Blocks: error: ambiguous overload for 'operator[]'
Post by: KirkD on December 10, 2009, 08:15:44 pm
Interesting.  Even on a Fedora 10 install I see references to wxBase 2.8.9.  A fresh F12 install refers to wxBase 2.8.10, but there's still wxBase there.  Not that it matters too much as I have CodeBlocks installed on all these systems.  The Fedora installs went flawlessly, as you mentioned. 

As if the case with LINUX, it is always an adventure.

Code
yum deplist wxGTK* | grep wxBase > out.txt

   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.10-5.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.10-5.fc10
  dependency: wxBase = 2.8.10-5.fc10
   provider: wxBase.i386 2.8.10-5.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.10-5.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.10-5.fc10
   provider: wxBase.i386 2.8.10-5.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.10-5.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.10-5.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.10-5.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.10-5.fc10
  dependency: wxBase = 2.8.9-1.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.10-5.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.10-5.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.10-5.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.10-5.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.10-5.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.10-5.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.10-5.fc10
  dependency: wxBase = 2.8.9-1.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.10-5.fc10
  dependency: wxBase = 2.8.10-5.fc10
   provider: wxBase.i386 2.8.10-5.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.10-5.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.10-5.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.10-5.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.10-5.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.10-5.fc10
   provider: wxBase.i386 2.8.9-1.fc10
   provider: wxBase.i386 2.8.10-5.fc10