__func__ on VC++

Posted on 2006-04-28
Last Modified: 2012-06-21

I'm trying to build a project in Visual Studio 6.0 and it's telling me that __func__ is an unrecoginzed symbol. Is there some header file I need to include for this, or is there another macro in VC++ I should be using


Question by:nerdmike
    LVL 48

    Expert Comment

    VC++ has __FUNCTION__ predefined macro:

    If this is what you need, use this constant or add line:

    #define __func__ __FUNCTION__

    Author Comment

    odd, i added the #define statement and I get a similar error

    "error C2065: '__FUNCTION__' : undeclared identifier"

    after reading the link you posted, I read the following

    "__FUNCTION__ is not expanded if you use /EP (Preprocess to stdout Without #line Directives) or /P (Preprocess to a File) compiler options."

    How can I check to see if these settings are not used (sorry, I don't usually use VC++ and hence don't know what to do about this)

    LVL 48

    Accepted Solution

    Sorry, it looks like VC++ 6.0 doesn't support __FUNCTION__:

    My previous link pointed to VC++ 8.0, so I haven't solution for you.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    This article will show, step by step, how to integrate R code into a R Sweave document
    This is about my first experience with programming Arduino.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now