Sign in to follow this  
Habba

Error C2065: "undeclared identifier"

Recommended Posts

this line of code gives me the error: AddFontResourceEx("FLATBN__.TTF",FR_PRIVATE,0); And here's the description of the error: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/c2065.asp As I undestand it the problem is that my compiler (Visual C++ 6) can't find declarition for that function. It's declared in wingdi.h, which is included in windows.h. I included windows.h and added gdi32.lib to my linking list. It's not working. Got any ideas?

Share this post


Link to post
Share on other sites
Have a look at this: Using the Windows Headers. This should help you solving the problem, since this function is only defined starting with Windows 2000, according to the Platform SDK documentation.

Edit: Don't have the VC 6 headers by hand, but you may need the latest headers that are included in the Platform SDK. You serach in WinGDI.h for AddFontResourceEx and you should see if it is defined at all (guarded by #if (_WIN32_WINNT >= 0x0500)).

Share this post


Link to post
Share on other sites
Quote:
Original post by Sparhawk42
Where is FR_PRIVATE declared?
Are they declared in some namespace?


FR_PRIVATE is also declared in wingdi.h, right next to the function. Both of them gives me the error.

Share this post


Link to post
Share on other sites
Have you tried to define _WIN32_WINNT to be 0x0500 either in stdafx.h (if you use precompiled headers), before including the very first header or in the compiler settings tab?

Share this post


Link to post
Share on other sites
Quote:
Original post by VolkerG
Have you tried to define _WIN32_WINNT to be 0x0500?


I tried that couple of times and finally it worked. This was the source of problems. Thank you both very much for your troubles.

Although I've programmed new for several years, I'm still quite a beginner with C++. It's so... complicated, compared to Visual Basic, Java, PERL, javascript...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this