PDA

Click to See Complete Forum and Search --> : __forceinline


noble
Mar 3rd, 2002, 10:03 PM
does anyone know if the __forceinline declaration is part of the
SDK or something? I'm attempting to build a project and it's
complaining about every occurrence of __forceinline. i did not find
documentation for this in the packaged MS help files.

any help on this would be greatly appreciated

kedaman
Mar 4th, 2002, 05:23 AM
what version of MSVC are you using? if you aren't using MSVC then its inline

noble
Mar 4th, 2002, 05:57 AM
i'm using msvc 5 but i know the project was created in msvc 6

i attempted to use the lib file from it but i have to build a version
of the dll so i can use the lib with vc 5.

it complains heavily of this function

kedaman
Mar 4th, 2002, 06:45 AM
hmm i don't have msvc5 but i guess it doesn't have __forceinline then, you can always try inline instead, what does it say?

noble
Mar 4th, 2002, 06:59 AM
First it complains about the __forceinline declaration
the errors following are probably a result of the __forceinline
error but here's the specific error for __forceinline


buffer.h(22) : error C2501: '__forceinline' : missing decl-specifiers



if i replace all occurrences of __forceinline with the inline or
__inline declaration, i get 100 or more errors that complain
that there are errors in the atlctl.cpp file which i never even touch.


C:\Program Files\DevStudio\VC\ATL\include\atlctl.cpp(19) : error C2653: 'CComDispatchDriver' : is not a class or namespace name
C:\Program Files\DevStudio\VC\ATL\include\atlctl.cpp(29) : error C2653: 'CComDispatchDriver' : is not a class or namespace name
C:\Program Files\DevStudio\VC\ATL\include\atlctl.cpp(56) : error C2653: 'CFirePropNotifyEvent' : is not a class or namespace name
C:\Program Files\DevStudio\VC\ATL\include\atlctl.cpp(86) : error C2653: 'CFirePropNotifyEvent' : is not a class or namespace name
C:\Program Files\DevStudio\VC\ATL\include\atlctl.cpp(116) : error C2653: 'CComControlBase' : is not a class or namespace name
C:\Program Files\DevStudio\VC\ATL\include\atlctl.cpp(133) : error C2065: 'ControlQueryInterface' : undeclared identifier
C:\Program Files\DevStudio\VC\ATL\include\atlctl.cpp(198) : error C2653: 'CComControlBase' : is not a class or namespace name
C:\Program Files\DevStudio\VC\ATL\include\atlctl.cpp(199) : error C2061: syntax error : identifier 'ATL_PROPMAP_ENTRY'


.......

ghey

thx for any help

CornedBee
Mar 4th, 2002, 09:25 AM
Maybe ATL changed from VC5 to VC6? Few compilers provide upward-compatibility ;)

inline is a C++ keyword
__inline is a VC6 keyword (works in C too, does not work in VC5)
_inline is a VC5 keyword (works in C and VC6 too)
__forceinline is a VC6 keyword (works in C too, does not work in VC5)

CornedBee
Mar 4th, 2002, 09:33 AM
But if you want a lib with downward compatibility to VC5 you can create it in VC6 with this linker option:
/LINK50COMPAT

This will tell the linker that the lib must be compatible with VC5

noble
Mar 4th, 2002, 09:38 AM
thx for your help cornedbee, i will submit a request for the
author of the program to make it 5.0 compatible