tags:

views:

63

answers:

3

For some reason I keep getting

error C3861: '__typeof': identifier not found

when I compile my program!

I'm including the following libraries:

<iostream>
<stdlib>
<stdio>

Any ideas?

thanks

Edit:

More example

User.h
class User{}

main.cpp
void f(User* p)
{
.
.
.
__typeof(p) ...
.
.
.
.
}
A: 

Perhaps the function __typeof() doesn't exist? Do you mean typeof()?

http://stackoverflow.com/questions/1540086/how-to-typeof-in-c

eruciform
+1  A: 

http://msdn.microsoft.com/en-us/library/x2xw8750%28VS.71%29.aspx

__typeof only exists for /clr:oldSyntax. Are you trying to use Managed extensions to C++ or are you expecting __typeof to work like C++0x's decltype? If so, if you are using VS 2010 you can use decltype.

Logan Capaldo
thank you, `decltype` works perfectly
Gootik
A: 

Try adding:

#using <mscorlib.dll>
using namespace System;

to the top of your C file and compile with /clr /LD.

Link

bta