How to build a library from solution file in Visual Studio 2015 - c++

I am somewhat frustrated because what I am asking seems to be common knowledge and isnt explained in any tutorials:
When I download some kind of library/framework (for example assimp), and create a "solution" file with cmake. So far everything is fine. But now I have got a solution file but I want to have a .lib file, right? How can I get it? When I open the solution with VS and click "Build", there is some processing, but after the processing and some console messages, nothing really changed. Is there some kind of way to tell VS: "I want a lib file from this in C:/myDirectory"?
Would really appreciate your help!

It depends on the project properties where the exact output directory for each configuration is.
You can look it up here:

Related

How do I publish my visual studio project as a stand alone

I'm currently working on a large project with a lot of potential bugs and glitches. I enlisted a few of my friends to help me test the program to find potential bugs but a lot of them aren't very tech savvy and have no idea how visual studio works.
Is there a way I can compile my project so it could run as a stand alone executable? I tried building it and getting the vcxproj file but I still have no idea how to make that a click to run type of program. Any help?
As far as I'm concerned, there is no way to "publish" C++ code.
I suggest you could refer to the link: https://social.msdn.microsoft.com/Forums/en-US/6998eadb-36fb-4a97-bba5-0de49d533732/how-can-i-publish-a-visual-c-project-?forum=vsclassdesigner
If you want to make a stand alone .exe file. I suggest you could try to use "Release" to build a stand alone .exe file. Check the .exe program Configuration Manager, ensure your set Release for your .exe program. (open your .exe program under Solution Explorer, right-click solution and select Configuration Manager).

Can I make Visual Studio show a notification or alert when I open a particular project or solution

I would like to perform an action upon opening a particular Visual Studio 15/17/19 solution.
I need to inform anyone who is about to work on the project that there are important notes (included in the project) that they should read first. Ideally it would be a pop up so as to be very obvious.
When googling I can only find solutions that involve Visual Studio extensions but I need something that does not rely on anyone else doing anything (e.g. installing the extension) - it needs to be something dependent only on the project itself.
I'm hoping for something that I can add in the .sln or .scproj file that VS will see when it loads the solution and take action, but anything that achieves the same purpose would be good.
I'd be grateful if someone is able to let me know how I can achieve this.
You've got an extension called Solution Open Pop Up supported on many versions of Visual Studio.
In the Overview tab there is a Features section where you can see a short example of how to use it. From the extension's website:
If a file called SolutionOpenPopUp.txt and/or ReadMe.txt exists in the root folder of the solution, the contents are shown in a pop-up when the solution is open.

Include files are not being recognized, even though they are in the right directory?

This is my first post on here, but from what I've seen, you guys like precise and concise problems. I think this qualifies. I have googled hi and lo and might have a case of the dumb, but cannot solve this.
I'm trying to compile a program I found that uses the portaudio library. I downloaded all of them, and HAVE all the relevant files, but visual studio is giving me issues.
This is the error I get:
So, I decided found the source path, and tracked down the file, which was in a different folder in portaudio, and copy/pasted it in the appropriate location (can't post third link, but it's there. I can provide that in the comments if necessary, I suppose). . I also have tried putting it in the same directory as the file that actually includes it, adding it to the project as an existing item, and adding that entire directory to the preprocessor include things (project settings > c++ > general > additional include directories).
The second error is very similar and is basically doing the same thing. I have the file, put it in the right place, visual studio can't find it.
Thank you all for your help.
One possible answer to your problem is that you don't have the right permissions. Are you able to open the file in a text editor?
I ended up figuring it out. For the second error, I had to save the .c file to .cpp through visual studio instead of just changing the extension. For the first one, I'm honestly not sure what I did, but it just sort of fixed itself. Such is the magic of programming, I suppose.

VS2010SP1: Project always out of date when debugging

I experienced this problem in VS2010 before, and solved it looking at this SO question. However, now that I upgraded my VS to SP1, it appeared again. I tried to solve it the same way, enabling C++ projects logging and using DebugView. But I can't get to see any output in DebugView, no matter what I do. I also tried raising the Build output verbosity (Tools->Options->Projects and Solutions->Build And Run), but couldn't find any clue.
As in the original problem, the projects reported as out of date are always unmanaged C++ projects. The solution has C#, VB.NET, C++/CLI and C++ projects. What I'm trying to run is a VB.NET exe which uses some C++ projects through C++/CLI wrappers.
Any hint on how to troubleshoot this?
UPDATE: Solved it with a clean checkout. However, it's a shame that there is no longer a way to troubleshoot this kind of errors...
Is it possible you were testing with the date in the future and saved a source file in the future? While clean/rebuild all should fix this, VS seems to go batty and stay there until I resave the file in the present.
Another last-ditch thing that sometimes solves these problems that works 'like a reboot' if you have just the source-code in version control: Check everything in, close VS and anything using files in your project, move all your project folders to a backup folder, and do a force-get latest version of each. Sometimes 'clean project' doesn't cut it.
If that doesn't work and you can't find a missing .h ... You can always fire up Process Monitor, set a filter, and dig in there.
Admittely all just stabs in the dark. Hope one hits the burgler! ;-)
After a compiler upgrade you should do a rebuild-all, if you haven't done that already.
For native C++ projects you can get "project out of date", but still nothing to build, if you have some include files in your project that doesn't actually exits. Like if you have deleted some unused .h files, but they are still part of the project.

Intellisense in vs2010 with c++

I can't get intellisense to work. Even if I start with an empty project and add just one file to it with only an include for iostream and an int main() function that prints a char with cout (basically the most basic program), if I try to get intellisense to show anything (say by typing cout.) I get
IntelliSense: 'No additional information available' (See 'Troubleshooting IntelliSense in C++ Projects' for further help.)
Hours of googling have yielded a couple of articles over at the Microsoft sites that suggest a bunch of things to try or reasons why it wouldn't work. I have tried and eliminated them all, except for one that mentions that stdafx.h has to be in the path.
What is this file?
How do I know if it is in the path if I don't know where it is?
What does it have to do with IntelliSense?
Should I add this file to my project to get it to work?
Thank you.
I got it solved by the Microsoft team at http://connect.microsoft.com/VisualStudio/feedback/details/652838/intellisense-not-creating-ipch-folder
It had to do with a certain Windows Update installed on WinXP. The solution was to install VS2010_SP1 and then a certain update over it.
Look at this question :C++ VS Express 2010 Intellisense
It was solved by pressing CTRL+J .
EDIT: maybe it's the stdafx.h problem !
Add a file stdafx.cpp and a file stdafx.h to the project !
Use #include "stdafx.h" as yhe first line of code in all your .cpp files.
Include all rarely/never changing and frequently used header-files in stdafx.h.
Turn on precompiler-headers in your project and rebuild the project.
(Create a dummy project which have precompiled headers on to see how it's been done)
Do you use the /UseEnv switch when opening visual studio? It breaks Intellisense for c++ projects.
Please find *.sdf file (Intellisence database cache) in project directory and delete it and relaunch project solution this will bring back your intellisence.
There are a couple of threads about similar problems:
click on Help at VS2010 and look for Intellisense.
http://social.msdn.microsoft.com/Search/en-US?query=intellisense%20settings&refinement=123&beta=0&ac=1
http://social.msdn.microsoft.com/Forums/en/vswpfdesigner/thread/75c4cc8d-9a81-4bda-84f0-f619f7493b3b
stdafx.h should be added automatically when you create a New Project.
From the file:
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
Just throwing this out there, you are using namespace std? eg:
std::cout.
because intellisense wont work if it doesn't see cout
edit: I over looked that error message so this isn't the case but leaving the answer in case it might help someone down the line.
Maybe it never got installed, have you tried a repair install?, it's worth a shot..
I thought I should mention this:
In Visual Studio 2012 I noticed that Intellisense suddenly stopped working in my C++ project (same error as the poster described). This happened because I had added "DEBUG" as a Preprocessor definition under Project Properties -> C/C++ -> Preprocessor.
Once I removed it from that list and instead put it in the code ( #define DEBUG ) intellisense suddenly started working again.
I don't know why this happens, I just know it screws up my intellisense. I hope this helps someone.
WIN32;_WINDOWS;_DEBUG;Append _DEBUG;
remove Append _DEBUG;
baruch's answer worked for me. for completion, here is also the link to the VS2010-SP1:
http://www.microsoft.com/en-us/download/details.aspx?id=23691
so first installing this and then the hot-fix that baruch referred to solved me the problem, although the whole installation took almost 1:30 hour! (including one restart on my Win-XP machine.)
I know this is an old question, but I had a similar problem IntelliSense: 'No additional information available' (See 'Troubleshooting IntelliSense in C++ Projects' for further help.). My problem wasn't related with stdafx.h.
To solve my problem, I closed VS2010, deleted the .sdf and .suo files as well as the ipch directory inside the project's main folder.
Then I restarted VS2010, waited for it to build all its metadata again and Intellisense (autocompletion) worked nicely.
EDIT: I am not aware if this "maneuver" has negative side effects.
IntelliSense stores it's data in the SQL Server, which is installed during VS2010 setup. I recommend you check if the SQL Server Service is running.