Visual C++ equivalent of __FILE__ , __LINE__ and __PRETTY_FUNCTION__

visual c++ 2017
visual c++ 2015
microsoft visual c++ 2018
visual c++ redistributable 2013
visual c++ 2019
microsoft visual c++ 2010
microsoft visual c++ 2015 runtime
microsoft visual c++ redistributable package (x64)

GCC compiler gives me the following macros:

  • __FILE__ so that I can print out the file name + directory.
  • __LINE__ so that I can print out the line number of where I'm printing from.
  • __PRETTY_FUNCTION__ so that I can print out the pretty function name

Does Visual C++ have the equivalent of these macros? A side question is, are these standard for C++ compilers?

In VS2008, this:

struct A
{
    bool Test(int iDummyArg)
    {
        const char *szFile = __FILE__;
        int iLine = __LINE__;
        const char *szFunc = __FUNCTION__; // Func name
        const char *szFunD = __FUNCDNAME__; // Decorated
        const char *szFunS = __FUNCSIG__; // Signature

        printf("%s\n", szFile);
        printf("%d\n", iLine);
        printf("%s\n", szFunc);
        printf("%s\n", szFunD);
        printf("%s\n", szFunS);

        return true;
    }
};

int wmain(int argc, TCHAR *lpszArgv[])
{
    A a;
    a.Test(10);
}

will print this:

c:\source\test_projects\blah\blah.cpp
14
A::Test
?Test@A@@QAE_NH@Z
bool __thiscall A::Test(int)

(The line number is "wrong" since there was really some extra stuff at the top of my file.)

Download Visual C++ Redistributable for Visual Studio 2015 from , Visual-C-Runtimes-All-in-One-Jul-2020.zip This archive contains the latest version (July 2020) of all VCRedist Visual Studio C++ runtimes,� Browse, edit, and improve your code quickly. Visualize your code with syntax colorization, guidelines, code tooltips, Class View, or Call Hierarchy. Navigate to any code symbol by reference, definition, declaration, and more. Autocomplete your code as you type, quickly repair problems, and refactor your code to your needs.

__FILE__ and __LINE__ are standard, and I'm rather certain Microsoft compilers have essentially always had them.

__PRETTY_FUNCTION__ is a gcc feature.

Visual C++ Redistributable Runtimes All-in-One (Jul 2020 , Visual C may refer to: Visual C++, an integrated development environment (IDE) product from Microsoft for the C, C++, and C++/CLI programming languages� The Visual C++ Redistributable Packages install run-time components of Visual C++ libraries. These components are required to run C++ applications that are developed using Visual Studio 2015 and link dynamically to Visual C++ libraries.

For more portability in getting the current function name, you can try BOOST_CURRENT_FUNCTION.

Visual C, Microsoft ecosystem includes Visual Studio which is used for built in Visual C ++, users need to install Visual C++ runtime libraries. In this� The Microsoft Visual C++ Redistributable expands the features of your System related to multimedia. It helps you to install the components automatically which are required by many Apps, Games, and Programs to run. And the Apps which are written in C++ language, the Microsoft Visual C++ Redistributable helps them to work and run properly.

Yes Visual C++ has them or an equivalent. See the responses here:

What's the difference between __PRETTY_FUNCTION__, __FUNCTION__, __func__? function-func/4384860#4384860

Also note that despite the upper case used, they aren't macros. They're variables.

Microsoft Visual C++, Microsoft Visual C++ is a integrated development environment (IDE) used to create Windows applications in the C, C++, and C++/CLI� Visual C++ Redistributable Packages for Visual Studio 2013 Important! Selecting a language below will dynamically change the complete page content to that language.

__FILE__ and __LINE__ are standard since C89. __PRETTY_FUNCTION__ is a GCCism. __func__ is a C99ism which (unlike GCCisms) may well be available in Visual C++; it is not precisely the same as __PRETTY_FUNCTION__ but it may be close enough for your purposes.

Download Microsoft Visual C++ Redistributable (All Versions), Getting Started. Visual Studio Code is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux. The download includes the VC_Redist runtime packages for Visual C++ 2005, 2008, 2010, 2012, 2013, 2015, 2017 and 2019. Both 32-bit and 64-bit are supported. The files included are the English language version.

Why Are There So Many “Microsoft Visual C++ Redistributables , Welcome to the June 2020 release of Visual Studio Code. There are a number of updates in this version that we hope you will like, some of the key highlights� Microsoft Visual C++ is a integrated development environment (IDE) used to create Windows applications in the C, C++, and C++/CLI programming languages. It was originally a standalone product, but is now included as part of Microsoft Visual Studio.

Documentation for Visual Studio Code, To include the UE4 installer when installing Visual Studio, locate the Summary sidebar on the right, expand Game Development with C++, and under Optional� Microsoft Visual C++ 2015 Redistributable includes bug fixes to the runtime DLLs and also the latest versions for KB 2999226. To find out what's new in Visual Studio 2015 Update 3 RC, see the Visual Studio 2015 Update 3 RC Release Notes. For a list of fixed bugs and known issues, see the Visual Studio 2015 Update 3 RC MSDN Article.

Visual Studio Code June 2020, Visual Studio IDE Visual Studio for Mac Visual Studio Code To continue downloading, click here Visual Studio Community 2019 – Free IDE and Developer Tools 2020-05-04T13:32:31-07:00

Comments