Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Just installed xe6 and get string of Ambiguity errors when I compile my pro


This question is answered.


Permlink Replies: 2 - Last Post: Jul 13, 2015 12:25 PM Last Post By: Tom Roberts
Tom Roberts

Posts: 102
Registered: 6/21/05
Just installed xe6 and get string of Ambiguity errors when I compile my pro  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 13, 2015 9:20 AM
e.g.
[bcc32 Error] IdZLibHeaders.hpp(62): E2015 Ambiguity between 'alloc_func' and 'System::Zlib::alloc_func'

[bcc32 Error] IdZLibHeaders.hpp(63): E2015 Ambiguity between 'free_func' and 'System::Zlib::free_func'

etc.

and warnings like

[bcc32 Warning] W8123 Path 'd:\embarcadero\studio\14.0\include\vcl' not found - path ignored in option '-I'

Anyone suggest anything? I did google but found nothing.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Just installed xe6 and get string of Ambiguity errors when I compile mypro
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 13, 2015 10:26 AM   in response to: Tom Roberts in response to: Tom Roberts
Tom wrote:

[bcc32 Error] IdZLibHeaders.hpp(62): E2015 Ambiguity between
'alloc_func' and 'System::Zlib::alloc_func'
[bcc32 Error] IdZLibHeaders.hpp(63): E2015 Ambiguity between
'free_func' and 'System::Zlib::free_func'

etc.

Indy uses its own copy of ZLib, it does not use C++Builder's copy. Indy
does not currently wrap its ZLib declarations in a namespace (it probably
should). System.ZLib.hpp does use a namespace (System::Zlib), but like every
other VCL header, it dumps its contents into the global namespace by default.
Something in your project is #include'ing the System.Zlib.hpp file before
#include'ing the IdZLibHeaders.hpp file (Indy does not use System.Zlib.hpp).
That is why there is an ambiguity. To avoid that, either:

1. find out what is #include'ing System.ZLib.hpp and disable it or move it
after IdZLibHeaders.hpp.

2. add NO_USING_NAMESPACE_SYSTEM_ZLIB or DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE
to the Conditionals list in the Project Options to stop System.Zlib.hpp from
dumping its content into the global namespace anymore.

[bcc32 Warning] W8123 Path 'd:\embarcadero\studio\14.0\include\vcl' not
found - path ignored in option '-I'

That is an outdated include path. I am guessing you migrated an old project
to XE6, is that right? There is a reference to "$(BDS)\include\vcl" in the
Includes path in the Project Options. The correct path is now "$(BDS)\include\windows\vcl".

--
Remy Lebeau (TeamB)
Tom Roberts

Posts: 102
Registered: 6/21/05
Re: Just installed xe6 and get string of Ambiguity errors when I compile mypro  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 13, 2015 12:25 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Thanks for the prompt reply Remy. I couldn't find any reference to zlib in my own code so it must have been present in a module my code called. In any case I added NO_USING_NAMESPACE_SYSTEM_ZLIB to the conditionals and got rid of the ambiguity errors. I also removed the include\vcl from the .cbproj file and got rid of those warnings. I'm not entirely up and running yet but I'm not far off it. Thanks again.

Remy Lebeau (TeamB) wrote:
Tom wrote:

[bcc32 Error] IdZLibHeaders.hpp(62): E2015 Ambiguity between
'alloc_func' and 'System::Zlib::alloc_func'
[bcc32 Error] IdZLibHeaders.hpp(63): E2015 Ambiguity between
'free_func' and 'System::Zlib::free_func'

etc.

Indy uses its own copy of ZLib, it does not use C++Builder's copy. Indy
does not currently wrap its ZLib declarations in a namespace (it probably
should). System.ZLib.hpp does use a namespace (System::Zlib), but like every
other VCL header, it dumps its contents into the global namespace by default.
Something in your project is #include'ing the System.Zlib.hpp file before
#include'ing the IdZLibHeaders.hpp file (Indy does not use System.Zlib.hpp).
That is why there is an ambiguity. To avoid that, either:

1. find out what is #include'ing System.ZLib.hpp and disable it or move it
after IdZLibHeaders.hpp.

2. add NO_USING_NAMESPACE_SYSTEM_ZLIB or DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE
to the Conditionals list in the Project Options to stop System.Zlib.hpp from
dumping its content into the global namespace anymore.

[bcc32 Warning] W8123 Path 'd:\embarcadero\studio\14.0\include\vcl' not
found - path ignored in option '-I'

That is an outdated include path. I am guessing you migrated an old project
to XE6, is that right? There is a reference to "$(BDS)\include\vcl" in the
Includes path in the Project Options. The correct path is now "$(BDS)\include\windows\vcl".

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02