What are .hint files in Visual Studio? - c++

While writing a program in C++ I came across a piece of code:
#define _DEPRE_ [[deprecated("This is deprecated")]]
and used it above a function definition to show that the function is deprecated. But Intellisense showed
to rectify the error by adding it into another file having an extension of .hint.Why is it so?

A hint file contains macros that would otherwise cause regions of code
to be skipped by the C++ Browsing Database Parser. When you open a
Visual Studio C++ project, the parser analyzes the code in each source
file in the project and builds a database with information about every
identifier. The IDE uses that information to support code browsing
features.
For more details, I suggest you could refer to the Doc:Hint Files

Related

Visual Studio 2013 - c++ code map error message

I've used Visual Studio's 'Code Maps' extensively for my C# projects in the past. I'm now working on a native c++ project and running into problems. When I add a class or method to a Code Map I get the following error message with no context or help available. Any ideas what the cause is?
Error Fail to get symbol's namespace
I should not that the project compiles and runs without a problem.
This MSDN page on Code Maps notes under Requirements that C++ has limited support.
Turns out it was my mistake and not a bug. I had incorrectly put includes in my headers such that almost all .cpp files included all .h files even if they weren't needed. It appears this caused the codemap application to crash. I went through and correctly included only the required .h files and correctly created my precompiled headers. This makes the codemap run as it should.

Function call without definition(in header, no dlls or static libs)

I have a embedded controller code handed over, it has a bunch on .c files and some headers and a lot of associated files for the embedded processor, its a motorola MC9S12DT256 and it uses a not-so-good compiler - Cosmic. i used Visual studio(just a txt editor) for modifying the code and it changes the hex file being burned to the processor.
I got it earlier this week and spent most of my time on it and it worked ok for minor changes (where changin a value in the code and compiling again made the necessary changes) Now i have to make some major changes. The code calls certain functions which are not to be found any where in the all of the .hpp/.h/.cpp i got. there are no associated dlls as well. I tried to find some basic link and put it in a .sln and still most data is not recognized (as in i cant go to declaration of defn).
So my question is - how to get to the function definiton to where it is called when VS blanks out. Find all references also does no help
Thanks
PM
They may be compiler intrinsics (functions provided by the compiler rather then in a library). But it is not clear how you have determined that they do not exist in a static library or why you think you should be able to see a definition (as opposed to a declaration).
When using Visual Studio as an embedded project IDE, you should create the project as a "makefile project" (even if you don't actually have a makefile), and you need to add all the necessary header paths for your embedded code and the Cosmic compiler standard header folder as include files to the project - VS scans the header files for declarations for Intellisense code completion and browser navigation.

Redeveloping MFC application

I've got a program written in c++ and have to make some modifications to it. Howerver, I haven't got any solution file or a like, just a bunch of .h, .cpp, .obj, .dpb, .dll, .mdi, .dfm, .res, .tds, .bpl files and an .exe file.
So I can start an application, see what it's doing and what the controls are, but when it comes to adding changes trying do to map behaviour of UI to source code files seems just to tedious.
Is it possible to recreate some kind of solution file or just to simply the process? (I am using VS 2012 and an app was written in 2002).
These file extensions indicate the source is from a Borland IDE. That .mdi file I think signifies Borland's multiple-document-interface... I'll venture to guess this project would be quite difficult to "recompile" using Visual Studio. I don't even see a .rc (resource file) in your list. Rewriting may be the easiest path, depending on the complexity of the application...

Problems creating a static C++ library

Greetings fellow programmers! I am trying to create a C++ library to use in other projects. This library is to be a static library that will be linked to other projects.
Problem: The compiler doesn't seem to catch errors that it otherwise would if it were configured as an executable program under Project->Properties>General. In fact I purposely made a syntax error and the compiler
gave me a success regardless.
Is there a way to force the compiler to check everything while building a static lib?
Build Environment: Visual Studio 2010
EDIT: As it turns out, it was a rather simple, yet incredibly subtle mistake. It turns out that Visual studio was treating some of my .cpp files as header files. Because of this, the compiler was not running through the code at all (no one includes .cpp files). When adding files to the library, I must have accidentally selected header instead of C++ file. I thought Visual Studio would only rename the header file. I guess I was wrong!
This is nonsensical. It cannot happen. What is probably happening is that you think that the compiler is compiling your source file, (the one with the syntax error,) but it does not. Perhaps you have not added your source file to your project.
(Then again, C++ has a pretty quirky syntax; I hope you are sure that what you made was in fact a syntax error, and not a syntactically valid language construct.)
If you have more than one project in the workspace (solution) like exe and lib, make sure you click on the exact one to build or set it as the startup project (showing up in bold letters) if you hit the F7 button.

C++ VS Express 2010 Intellisense

I'm trying to use Visual Studio Express 2010 to write an openGL program, so It's a win32 console application. And I can't get Intellisense to show up for anything, openGL or otherwise.
What am I doing wrong, and how can I force Intellisense to show? (Like you can force the Xcode equivalent with Esc)
From MSDN:
IntelliSense can stop working under certain conditions. Use the following steps to help determine why IntelliSense does not work for C++ projects.
To investigate IntelliSense failure in C++ projects
Make sure that the Visual C++ project contains no compilation errors.
1) If the project is a Makefile project, see How to: Enable IntelliSense for Makefile Projects.
2) Make sure that stdafx.h is on the include path. For more information about include paths in Visual C++ projects, see #include Directive (C/C++) and /I (Additional Include Directories).
Also :*General, All Languages, Text Editor, Options Dialog Box
Provides information about how to turn off IntelliSense.
NB.
IntelliSense LimitationsIntelliSense does not work in C++ projects under the following circumstances: ( there more then this one below )
IntelliSense is not fully supported when you reference a header file multiple times by using the #include directive, and the meaning of that header file changes because of various macro states that are defined through the #define directive. In other words, when you include a header file several times and the header usage changes under different macro states, IntelliSense does not always work.
Please find *.sdf file in project directory and delete it relaunch the solution file. It will show your intellisense