How to attach Visual Studio to a C++ node module? - c++

I wrote a node.js module in C++ with Visual Studio. I created the project with node-gyp configure --debug. This seems to work fine and I can compile my code and a loadable binary is created in the Debug folder. I am then able to require('./build/Debug/mymodule) this file from a server.js file and when I start the server from the command line (node server.js), the module runs. But I am struggling to figure out how to attach the Visual Studio Debugger.
According to this question it sounds like gdb is automatically attached (?), but how do I invoke my server.js with the Visual Studio debugger?
Edit: I run Visual Studio 2015 and node v4.1.2

Seems like I figured it out.
Goto: Project->Properties
Open "Debugging" options under "Configuration Properties"
Set path for your node.js installation and the path to your "server.js" (or whatever you called your file)
Start node with the green debug button directly from Visual Studio

Related

Creating Visual Studio Project from CMake, Visual studio does not find executable

Basically, I've got the same question as in
How to configure CMake so that the generated Visual Studio project finds the executable?. None of the answers there worked for me.
I have a CMake project, and I just want to create a Visual Studio 2019 Project from it:
So I just run cmake . from the root directory.
Then I have a *.sln file in my root directory.
After opening it with Visual Studio 2019, I press the "Local Widows Debugger" button, it compiles successfully but then the IDE complains with:
Unable to start program 'C:\Users...\x64\Debug\ALL_BUILD'. The system is unable to find the specified file.
Using travis everything compiles fine, too: https://travis-ci.com/Necktschnagge/markov_chain_analyzer/builds/144941090
You can see the code here: https://github.com/Necktschnagge/markov_chain_analyzer/tree/old
What do I need to do so that CMake creates a VS solution, that is well-configured so that I can run the debugger?
When you create a Visual Studio solution with CMake, it automatically sets the Startup Project to ALL_BUILD. This is a CMake pre-defined target, which builds all of the projects in the solution. It is not a project containing an executable that can be debugged.
You must change the Startup Project in your Solution Explorer to one of your executable projects before debugging. You can do this by right-clicking on the project you want to debug, and selecting Set as Startup Project. There are some more instructions here if you're using VS with CMake integration.
You can also tell CMake to set a different Startup Project by default when building CMake from scratch, using VS_STARTUP_PROJECT. Put something like this in your top-level CMake file:
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT MyExeTarget)
Now, CMake will set MyExeTarget as the Startup Project in Visual Studio, instead of ALL_BUILD.

Cannot open source file “nuitrack/Nuitrack.h”

I am trying to run Nuitrack bodytracking with my Intel Realsense Camera, I am using VisualStudio 2017 and trying to run this sample project
http://download.3divi.com/Nuitrack/doc/nuitrack_console_sample_2src_2main_8cpp-example.html.
I successfully CMAKE the project, however when I run it on Visual Studio I get the error cannot open source file “nuitrack/Nuitrack.h”
I followed the installation step and the sample executables work for me, its just my Visual Studio projects are unable to import nuitrack.h
My environment variables look like this
Are you show that the properties dialog is from the right build settings?
For example your active build target
x64 Debug
is also where you set the include path?

Unable to add app.config file in Visual Studio 2017?

Working in Visual Studio 2017; I have added a class library in my project. Now I want to add an app.config file.
When I try to add by "Add new Item" but config file is missing from item list.
How can I do it?
You probably forgot to install workload .NET desktop development.
Go to installation, click to modify and include the workload .NET desktop development.
Check image of installation screen
Just right click your class library. Click on Add -> New Item and you should find Application Configuration file
Note:
If you have a solution without any project or all project are unloaded, you would not find the Application Configuration File
If you are missing visual studio templates,then Close all instance of Visual Studio and Open visual studio command prompt and type,
devenv /installvstemplates
Press Enter. Let the process be complete and now open visual studio. You will get all missing templates under Visual Studio installed templates.
I couldn't add app.config using the GUI tools for my web project. However, I have added the app.config file manually and the build process picked it up and used it.

Using UE4 with Visual Studio 2017

I recently did some cleaning of my drives. I decided to install visual studio 2017 after cleaning the drives up. I have been trying to continue work on my old UE4 project using the engine pulled from GitHub. I tried rebuilding the project with VS2017 which I know is not fully supported yet. I did run into quite a few problems, including the missing corecrt.h files. I reinstalled the Windows SDK to fix this.
The current problem is a new missing file called windows.h, and I believe it is missing due to the build tools looking for the wrong version of the SDK. I was wondering, has anyone else successfully integrated Visual Studio 2017 with their UE4 project after running into similar problems?
-- Edited due to poor grammar.
As I know Version 4.15 supports both Visual Studio 2015 (default) and Visual Studio 2017. If you are building the Engine from source code, you would want to open a command prompt after running Setup.bat and run the command GenerateProjectFiles.bat -2017. This will give you a Visual Studio 2017 solution for the Engine.
To use Visual Studio 2017 for projects, you can set your preference for which version projects use by going to Edit -> Editor Preferences -> General -> Source Code and choosing Visual Studio 2017 in the Source Code Editor setting.
If regenerating the Engine's VS project files doesn't help. Try regenerating your own UE4 project's VS project files.
With Visual Studio and UE4 closed, find the .uproject file, right click and select Generate Visual Studio project files.
Open the solution, make sure your UE4 game (e.g. MyProject) under the Games folder is set as the StartUp project (right click, Set as StartUp project), then try a compile.

Visual Studio - lib is not a valid Win32-Application

I want to run the opensource C++ library "VRPH" on VS 2015 (http://www.coin-or.org/projects/VRPH.xml).
I successfully perfomed the "make" command using cygwin/g++. Doing so leads to some more folders in the VRPH directory.
As described in the install.txt I openend the file VRPH.sln with Visual Studio.
Now VS does the "migration-process" and fires an UpgradeLog.htm with lots of warnings in it (mainly because of the software was created on a 2008 VS-Version), but no errors!
If I now click on "Local-Windows-Debug", the Debug-Window informs about serveral compile processes and the main project "VRPH" creates a VRPH.lib in the Debug-folder.
Having done that the Debugger says: "VRPH.lib is not a valid Win32-Application"
Any idea what to do?
Thank you so much for help!!