User forums > Using Code::Blocks

Building Code::Blocks: error: ambiguous overload for 'operator[]'

(1/5) > >>

KirkD:
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



-

KirkD:
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:     ## ------------------------------------- ##

stahta01:
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.

KirkD:
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




stahta01:

--- Quote from: 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

--- End quote ---

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.

Navigation

[0] Message Index

[#] Next page

Go to full version