Jump to page: 1 2
Thread overview
VC++ 8.0 x64 compilation errors for scoped_handle
Jul 30, 2007
Matthew Wilson
Aug 03, 2007
Matthew Wilson
Aug 11, 2007
Matthew Wilson
Aug 17, 2007
Matthew Wilson
Aug 17, 2007
Matthew Wilson
Aug 21, 2007
Matthew Wilson
Aug 22, 2007
Matthew Wilson
Aug 17, 2007
Matthew Wilson
July 25, 2007
Hi Mathew,

We are currently starting to port of some of our speed&memory hungry services to the x64 world.
Though when I fliped I ended up getting this compilation errors for scoped_handle<>. Can you help me with this?

Thanks, Kind Regards
Cláudio Albuquerque

\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(426) : error C2535: 'stlsoft::scoped_handle<H>::scoped_handle(H,void (__cdecl *)(H),H)' : member function already defined or declared
\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(371) : see declaration of 'stlsoft::scoped_handle<H>::scoped_handle'

\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(641) : see reference to class template instantiation 'stlsoft::scoped_handle<H>' being compiled

\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(452) : error C2535: 'stlsoft::scoped_handle<H>::scoped_handle(H,R (__cdecl *)(H),H)' : member function already defined or declared

\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(398) : see declaration of 'stlsoft::scoped_handle<H>::scoped_handle'

\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(464) : error C2535: 'stlsoft::scoped_handle<H>::scoped_handle(H *,R (__cdecl *)(H *),H)' : member function already defined or declared

\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(410) : see declaration of 'stlsoft::scoped_handle<H>::scoped_handle'

\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(482) : error C2535: 'stlsoft::scoped_handle<H>::scoped_handle(H,void (__cdecl *)(H),H)' : member function already defined or declared

\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(371) : see declaration of 'stlsoft::scoped_handle<H>::scoped_handle'

\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(493) : error C2535: 'stlsoft::scoped_handle<H>::scoped_handle(H *,void (__cdecl *)(H *),H)' : member function already defined or declared

\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(383) : see declaration of 'stlsoft::scoped_handle<H>::scoped_handle'

\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(508) : error C2535: 'stlsoft::scoped_handle<H>::scoped_handle(H,R (__cdecl *)(H),H)' : member function already defined or declared

\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(398) : see declaration of 'stlsoft::scoped_handle<H>::scoped_handle'

\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(520) : error C2535: 'stlsoft::scoped_handle<H>::scoped_handle(H *,R (__cdecl *)(H *),H)' : member function already defined or declared

\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(410) : see declaration of 'stlsoft::scoped_handle<H>::scoped_handle'

\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(696) : error C2535: 'stlsoft::scoped_handle<void>::scoped_handle(void (__cdecl *)(void))' : member function already defined or declared

\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(671) : see declaration of 'stlsoft::scoped_handle<void>::scoped_handle'

\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(708) : error C2535: 'stlsoft::scoped_handle<void>::scoped_handle(R (__cdecl *)(void))' : member function already defined or declared

\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(683) : see declaration of 'stlsoft::scoped_handle<void>::scoped_handle'

\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(723) : error C2535: 'stlsoft::scoped_handle<void>::scoped_handle(void (__cdecl *)(void))' : member function already defined or declared

\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(671) : see declaration of 'stlsoft::scoped_handle<void>::scoped_handle'

\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(735) : error C2535: 'stlsoft::scoped_handle<void>::scoped_handle(R (__cdecl *)(void))' : member function already defined or declared

\stlsoft\1.9.2\include\stlsoft/smartptr/scoped_handle.hpp(683) : see declaration of 'stlsoft::scoped_handle<void>::scoped_handle'


July 30, 2007
Cláudio

Apologies, but at the moment I have no insight to offer into this. I'm currently subsisting on just a single laptop, with incomplete resources, so wouldn't be in a position to work on this. Further, I don't have access to VC8 64-bit, which might make things a little more protracted.

So, no good news at this point. But I just wanted to acknowledge the post. I hope to be able to spend the time to work through the problem from first principles sometime soon. (It might also help to use the -Wp64 option of VC8. Maybe ...)

Cheers

Matt
July 30, 2007
Mathew,

Ok, no problem. And if you don't have access to VC8 64bit than that just
makes it a really interesting situation.
I always compile with the -Wp64 switch on, and in the 32 bit world no
warning appears.
Looking at the error messages I've just wondering if the change of ABI for
x64 could be the reason for problem?
(http://msdn2.microsoft.com/en-us/library/ms235286(VS.80).aspx)

PS1: Hum maybe this a sign to recheck the chapter on ABI on Imperfect C++. PS2: Just got the new book. Can't say anything about the contents. But just like IC++ sure like the cover / aspect of the book.

Regards
Cláudio Albuquerque



"Matthew Wilson" <no-one@nowhere.none> wrote in message news:f8jnfl$1ose$1@digitalmars.com...
> Cláudio
>
> Apologies, but at the moment I have no insight to offer into this. I'm currently subsisting on just a single laptop, with incomplete resources, so wouldn't be in a position to work on this. Further, I don't have access to VC8 64-bit, which might make things a little more protracted.
>
> So, no good news at this point. But I just wanted to acknowledge the post. I hope to be able to spend the time to work through the problem from first principles sometime soon. (It might also help to use the -Wp64 option of VC8. Maybe ...)
>
> Cheers
>
> Matt


August 03, 2007
Cláudio

> 
> Mathew,
> 
> Ok, no problem. And if you don't have access to VC8 64bit than that just
> makes it a really interesting situation.
> I always compile with the -Wp64 switch on, and in the 32 bit world no
> warning appears.
> Looking at the error messages I've just wondering if the change of ABI for
> x64 could be the reason for problem?
> (http://msdn2.microsoft.com/en-us/library/ms235286(VS.80).aspx)

It could well be. I've update the file (and others throughout the libs) so that there are three pre-processor symbols that determine which calling convention-specific code is included:
 - STLSOFT_CF_CDECL_SUPPORTED
 - STLSOFT_CF_FASTCALL_SUPPORTED
 - STLSOFT_CF_STDCALL_SUPPORTED

So, if you have a mind to, you can play around with the definitions of these in $(STLSOFT)/include/stlsoft/internal/cccap/msvc.h and maybe confirm your hypothesis.

> PS1: Hum maybe this a sign to recheck the chapter on ABI on Imperfect C++.

He he. Well, it's for sure that I need to get hold of VC8x64 for the writing on "Breaking Up The Monolith". ;-)

> PS2: Just got the new book. Can't say anything about the contents. But just like IC++ sure like the cover / aspect of the book.

Great! Don't forget to let me know what you think of it (and to post reviews on amazon.com <g>)


Matthew

August 11, 2007
Hi Mathew,

I've tried out your suggestion, and since I'm flying some what blind, here
are the results for the different definitions of the 1.9.5:
If I define in msvc.h STLSOFT_CF_CDECL_SUPPORTED I get 11 Errors problems
with scoped_handle definitions for STLSOFT_CF_FASTCALL_SUPPORTED and
STLSOFT_CF_STDCALL_SUPPORTED.

If I define in msvc.h STLSOFT_CF_STDCALL_SUPPORTED or STLSOFT_CF_FASTCALL_SUPPORTED I get the following 5 Errors:

Error 50 error C2535: 'stlsoft::scoped_handle<H>::scoped_handle(H,void
(__cdecl *)(H),H)' : member function already defined or declared
D:\stlsoft\1.9.5\include\stlsoft\smartptr\scoped_handle.hpp 488
Error 51 error C2535: 'stlsoft::scoped_handle<H>::scoped_handle(H,R (__cdecl
*)(H),H)' : member function already defined or declared
D:\stlsoft\1.9.5\include\stlsoft\smartptr\scoped_handle.hpp 514
Error 52 error C2535: 'stlsoft::scoped_handle<H>::scoped_handle(H *,R
(__cdecl *)(H *),H)' : member function already defined or declared
D:\stlsoft\1.9.5\include\stlsoft\smartptr\scoped_handle.hpp 526
Error 53 error C2535: 'stlsoft::scoped_handle<void>::scoped_handle(void
(__cdecl *)(void))' : member function already defined or declared
D:\stlsoft\1.9.5\include\stlsoft\smartptr\scoped_handle.hpp 731
Error 54 error C2535: 'stlsoft::scoped_handle<void>::scoped_handle(R
(__cdecl *)(void))' : member function already defined or declared
D:\stlsoft\1.9.5\include\stlsoft\smartptr\scoped_handle.hpp 743


So I think maybe I'm not defining things in the right place, because if I go to line 488 and before the #ifdef STLSOFT_CF_STDCALL_SUPPORTED I add #undef STLSOFT_CF_STDCALL_SUPPORTED all compiles perfectly.

Regards
Cláudio Albuquerque



"Matthew Wilson" <no-one@nowhere.no.com> wrote in message news:f9078v$1ife$1@digitalmars.com...
> Cláudio
>
>>
>> Mathew,
>>
>> Ok, no problem. And if you don't have access to VC8 64bit than that just
>> makes it a really interesting situation.
>> I always compile with the -Wp64 switch on, and in the 32 bit world no
>> warning appears.
>> Looking at the error messages I've just wondering if the change of ABI
>> for
>> x64 could be the reason for problem?
>> (http://msdn2.microsoft.com/en-us/library/ms235286(VS.80).aspx)
>
> It could well be. I've update the file (and others throughout the libs) so
> that there are three pre-processor symbols that determine which calling
> convention-specific code is included:
> - STLSOFT_CF_CDECL_SUPPORTED
> - STLSOFT_CF_FASTCALL_SUPPORTED
> - STLSOFT_CF_STDCALL_SUPPORTED
>
> So, if you have a mind to, you can play around with the definitions of these in $(STLSOFT)/include/stlsoft/internal/cccap/msvc.h and maybe confirm your hypothesis.
>
>> PS1: Hum maybe this a sign to recheck the chapter on ABI on Imperfect C++.
>
> He he. Well, it's for sure that I need to get hold of VC8x64 for the writing on "Breaking Up The Monolith". ;-)
>
>> PS2: Just got the new book. Can't say anything about the contents. But
>> just
>> like IC++ sure like the cover / aspect of the book.
>
> Great! Don't forget to let me know what you think of it (and to post reviews on amazon.com <g>)
>
>
> Matthew
> 


August 11, 2007
Cl�udio Albuquerque Wrote:

> 
> Hi Mathew,
> 
> I've tried out your suggestion, and since I'm flying some what blind, here
> are the results for the different definitions of the 1.9.5:
> If I define in msvc.h STLSOFT_CF_CDECL_SUPPORTED I get 11 Errors problems
> with scoped_handle definitions for STLSOFT_CF_FASTCALL_SUPPORTED and
> STLSOFT_CF_STDCALL_SUPPORTED.
> 
> If I define in msvc.h STLSOFT_CF_STDCALL_SUPPORTED or STLSOFT_CF_FASTCALL_SUPPORTED I get the following 5 Errors:
> 
> Error 50 error C2535: 'stlsoft::scoped_handle<H>::scoped_handle(H,void
> (__cdecl *)(H),H)' : member function already defined or declared
> D:\stlsoft\1.9.5\include\stlsoft\smartptr\scoped_handle.hpp 488
> Error 51 error C2535: 'stlsoft::scoped_handle<H>::scoped_handle(H,R (__cdecl
> *)(H),H)' : member function already defined or declared
> D:\stlsoft\1.9.5\include\stlsoft\smartptr\scoped_handle.hpp 514
> Error 52 error C2535: 'stlsoft::scoped_handle<H>::scoped_handle(H *,R
> (__cdecl *)(H *),H)' : member function already defined or declared
> D:\stlsoft\1.9.5\include\stlsoft\smartptr\scoped_handle.hpp 526
> Error 53 error C2535: 'stlsoft::scoped_handle<void>::scoped_handle(void
> (__cdecl *)(void))' : member function already defined or declared
> D:\stlsoft\1.9.5\include\stlsoft\smartptr\scoped_handle.hpp 731
> Error 54 error C2535: 'stlsoft::scoped_handle<void>::scoped_handle(R
> (__cdecl *)(void))' : member function already defined or declared
> D:\stlsoft\1.9.5\include\stlsoft\smartptr\scoped_handle.hpp 743
> 
> 
> So I think maybe I'm not defining things in the right place, because if I go to line 488 and before the #ifdef STLSOFT_CF_STDCALL_SUPPORTED I add #undef STLSOFT_CF_STDCALL_SUPPORTED all compiles perfectly.

I think we're nearly there. I suspect stdcall is not supported, so you probably just need to change line 512 from stlsoft/internal/cccap/msvc.h rom:

  #define STLSOFT_CF_STDCALL_SUPPORTED

to

  #ifndef WIN64
  # define STLSOFT_CF_STDCALL_SUPPORTED
  #endif /* WIN64 */

If that fixes it, we can add that in permanently.

(Actually, we should do a couple of other tests, to determine which of cdecl, fastcall, stdcall and thiscall calling conventions can be used in Win64, and then verify which ones can be used with scoped_handle. I'll knock something up, once I hear back from you on the step above.)

Cheers

Matt

P.S. You any further into XSTLv1? :-)
August 13, 2007
Hi Mathew,

The list of changes in the msvc.h to allow it to compile is:

/* /////////////////////////////////////////////////////////////////////////

* Calling convention

*/

#ifndef _WIN64 /* Changed */

#define STLSOFT_CF_CDECL_SUPPORTED

#else

#define STLSOFT_CF_FASTCALL_SUPPORTED

#endif /* WIN64 */

#ifndef _MANAGED

# define STLSOFT_CF_FASTCALL_SUPPORTED

#endif /* !_MANAGED */

#ifndef _WIN64 /* Added */

# define STLSOFT_CF_STDCALL_SUPPORTED

#endif /* WIN64 */


Though I do not understand why if STLSOFT_CF_CDECL_SUPPORTED is defined I
get errors on FASTCALL definition of scoped_handle<>.
My only guess is that the compiler is transforming the internal STDCALLs and
CDECL calls into FASTCALLs, causing the duplicate definition errors.


Regards
Cláudio Albuquerque

"Matthew Wilson" <no-one@nowhere.no.com> wrote in message news:f9jctv$2frp$1@digitalmars.com...
> Cl�udio Albuquerque Wrote:
>
>>
>> Hi Mathew,
>>
>> I've tried out your suggestion, and since I'm flying some what blind,
>> here
>> are the results for the different definitions of the 1.9.5:
>> If I define in msvc.h STLSOFT_CF_CDECL_SUPPORTED I get 11 Errors problems
>> with scoped_handle definitions for STLSOFT_CF_FASTCALL_SUPPORTED and
>> STLSOFT_CF_STDCALL_SUPPORTED.
>>
>> If I define in msvc.h STLSOFT_CF_STDCALL_SUPPORTED or STLSOFT_CF_FASTCALL_SUPPORTED I get the following 5 Errors:
>>
>> Error 50 error C2535: 'stlsoft::scoped_handle<H>::scoped_handle(H,void
>> (__cdecl *)(H),H)' : member function already defined or declared
>> D:\stlsoft\1.9.5\include\stlsoft\smartptr\scoped_handle.hpp 488
>> Error 51 error C2535: 'stlsoft::scoped_handle<H>::scoped_handle(H,R
>> (__cdecl
>> *)(H),H)' : member function already defined or declared
>> D:\stlsoft\1.9.5\include\stlsoft\smartptr\scoped_handle.hpp 514
>> Error 52 error C2535: 'stlsoft::scoped_handle<H>::scoped_handle(H *,R
>> (__cdecl *)(H *),H)' : member function already defined or declared
>> D:\stlsoft\1.9.5\include\stlsoft\smartptr\scoped_handle.hpp 526
>> Error 53 error C2535: 'stlsoft::scoped_handle<void>::scoped_handle(void
>> (__cdecl *)(void))' : member function already defined or declared
>> D:\stlsoft\1.9.5\include\stlsoft\smartptr\scoped_handle.hpp 731
>> Error 54 error C2535: 'stlsoft::scoped_handle<void>::scoped_handle(R
>> (__cdecl *)(void))' : member function already defined or declared
>> D:\stlsoft\1.9.5\include\stlsoft\smartptr\scoped_handle.hpp 743
>>
>>
>> So I think maybe I'm not defining things in the right place, because if I
>> go
>> to line 488 and before the #ifdef STLSOFT_CF_STDCALL_SUPPORTED I add
>> #undef
>> STLSOFT_CF_STDCALL_SUPPORTED all compiles perfectly.
>
> I think we're nearly there. I suspect stdcall is not supported, so you probably just need to change line 512 from stlsoft/internal/cccap/msvc.h rom:
>
>  #define STLSOFT_CF_STDCALL_SUPPORTED
>
> to
>
>  #ifndef WIN64
>  # define STLSOFT_CF_STDCALL_SUPPORTED
>  #endif /* WIN64 */
>
> If that fixes it, we can add that in permanently.
>
> (Actually, we should do a couple of other tests, to determine which of cdecl, fastcall, stdcall and thiscall calling conventions can be used in Win64, and then verify which ones can be used with scoped_handle. I'll knock something up, once I hear back from you on the step above.)
>
> Cheers
>
> Matt
>
> P.S. You any further into XSTLv1? :-)


August 17, 2007
Cl�udio Albuquerque Wrote:

> 
> Hi Mathew,
> 
> The list of changes in the msvc.h to allow it to compile is:
> 
> /* /////////////////////////////////////////////////////////////////////////
> 
> * Calling convention
> 
> */
> 
> #ifndef _WIN64 /* Changed */
> 
> #define STLSOFT_CF_CDECL_SUPPORTED
> 
> #else
> 
> #define STLSOFT_CF_FASTCALL_SUPPORTED
> 
> #endif /* WIN64 */
> 
> #ifndef _MANAGED
> 
> # define STLSOFT_CF_FASTCALL_SUPPORTED
> 
> #endif /* !_MANAGED */
> 
> #ifndef _WIN64 /* Added */
> 
> # define STLSOFT_CF_STDCALL_SUPPORTED
> 
> #endif /* WIN64 */
> 
> 
> Though I do not understand why if STLSOFT_CF_CDECL_SUPPORTED is defined I
> get errors on FASTCALL definition of scoped_handle<>.
> My only guess is that the compiler is transforming the internal STDCALLs and
> CDECL calls into FASTCALLs, causing the duplicate definition errors.

I think part of the problem is that stlsoft.h defines STLSOFT_CDECL_SUPPORTED, STLSOFT_CDECL, STLSOFT_FASTCALL and STLSOFT_STDCALL. (I'm changing it for the next release)

I'll change all this round, and verify for Win32 compilers. Can I ask you to download the set of .cpp files in http://synesis.com.au/downloads/stlsoft/cc64test.zip, and execute the following command-line:

"cl -nologo -c test1.cpp test11.cpp test12.cpp test13.cpp test14.cpp test2.cpp test3.cpp test4.cpp test21.cpp test22.cpp test23.cpp test31.cpp"

and send me the output? (Note: some of these are guaranteed not to compile. It's just the difference between what'll compile on Win32 and Win64 that should finally make clear what should be supported in include/stlsoft/internal/cccap/msvc.h).

All being well, this should be sorted and released for 1.9.6. :-)

Thanks

Matt


August 17, 2007
Cl�udio Albuquerque Wrote:

> 
> Hi Mathew,
> 
> The list of changes in the msvc.h to allow it to compile is:
> 
> /* /////////////////////////////////////////////////////////////////////////
> 
> * Calling convention
> 
> */
> 
> #ifndef _WIN64 /* Changed */
> 
> #define STLSOFT_CF_CDECL_SUPPORTED
> 
> #else
> 
> #define STLSOFT_CF_FASTCALL_SUPPORTED
> 
> #endif /* WIN64 */
> 
> #ifndef _MANAGED
> 
> # define STLSOFT_CF_FASTCALL_SUPPORTED
> 
> #endif /* !_MANAGED */
> 
> #ifndef _WIN64 /* Added */
> 
> # define STLSOFT_CF_STDCALL_SUPPORTED
> 
> #endif /* WIN64 */
> 
> 
> Though I do not understand why if STLSOFT_CF_CDECL_SUPPORTED is defined I
> get errors on FASTCALL definition of scoped_handle<>.
> My only guess is that the compiler is transforming the internal STDCALLs and
> CDECL calls into FASTCALLs, causing the duplicate definition errors.

I think part of the problem is that stlsoft.h defines STLSOFT_CDECL_SUPPORTED, STLSOFT_CDECL, STLSOFT_FASTCALL and STLSOFT_STDCALL. (I'm changing it for the next release)

I'll change all this round, and verify for Win32 compilers. Can I ask you to download the set of .cpp files in http://synesis.com.au/downloads/stlsoft/cc64test.zip, and execute the following command-line:

"cl -nologo -c test1.cpp test11.cpp test12.cpp test13.cpp test14.cpp test2.cpp test3.cpp test4.cpp test21.cpp test22.cpp test23.cpp test31.cpp"

and send me the output? (Note: some of these are guaranteed not to compile. It's just the difference between what'll compile on Win32 and Win64 that should finally make clear what should be supported in include/stlsoft/internal/cccap/msvc.h).

All being well, this should be sorted and released for 1.9.6. :-)

Thanks

Matt


August 17, 2007
> I'll change all this round, and verify for Win32 compilers. Can I ask you to download the set of .cpp files in http://synesis.com.au/downloads/stlsoft/cc64test.zip, and execute the following command-line:
> 
> "cl -nologo -c test1.cpp test11.cpp test12.cpp test13.cpp test14.cpp test2.cpp test3.cpp test4.cpp test21.cpp test22.cpp test23.cpp test31.cpp"
> 
> and send me the output? (Note: some of these are guaranteed not to compile. It's just the difference between what'll compile on Win32 and Win64 that should finally make clear what should be supported in include/stlsoft/internal/cccap/msvc.h).

Sigh. Stupid web-news thing.

Please note that the link is:

 http://synesis.com.au/downloads/stlsoft/cc64test.zip

and NOT

 http://synesis.com.au/downloads/stlsoft/cc64test.zip,

;-)

Matt
« First   ‹ Prev
1 2