convert visual studio C++ dll project to exe - c++

I'm working on a C++ dynamic library that I want to use in Unity3D, except I'm encountering an error somewhere in it and would like to debug it in visual studio. To do this, I would like to convert the VS2010 project temporarily into an .exe project. What steps would I need to follow to do this? I've already tried changing the target extension, linker output file, and set the entry point but it just won't start.

Found that I can attach the VS debugger to Unity3D process, which does what I need.

Related

Visual Studio c++ dll not found

I am trying to link my .exe file to a .dll in visual studio but I don't understand how (I am using VS2019).
I have looked at this question here but it only provides half the solution. I went to project properties->debugging->Environment and added PATH=LOCATION_OF_MY_DLL and this works when I run the program in the IDE, but when I manually run the .exe it gives the same error that the dll was not found (it is only fixed if I copy the dll to the exe location).
In addition, I am managing the entire project using premake so is there a way to add these setting in there as well?

Create a self-contained program in C++

I'm using Visual Studio 2012. I wish to create a completely self-contained program that can be used on a machine without visual studio installed just by copying the exe file directly. I used to need to first run visual c++ 2012 redistributable to make the program work. Is there any way to make everything run in one exe? I would not like to use an installer either as it is a fairly simple program; the time it takes for the user to use the installer will probably be more than my program...
So is there any way to statically link everything? Right now, it just crashes when run on a new machine, but once I install VS2012 express on that machine, it suddenly starts to work.
Any help would be appreciated.
To get static linking in an MFC project set the project properties (for the release build) as follows:
C/C++ Code Generation, Runtime Library: Multi-threaded (/MT)
Configuration Properties, General: Use of MFC: Use MFC is a Static Library
A simple exe with these properties will run standalone.
Useful information found here http://msdn.microsoft.com/en-us/library/aa235516(v=vs.60).aspx
and here http://msdn.microsoft.com/en-us/library/f22wcbea.aspx
Once you run your program, you can find it's executable in the Debug\ folder of your project.
Hope it helps!
Sarge

visual c++ program issue

I am using Microsoft Visual Studio 2010. When I am building my application in Debug mode, it is producing an EXE file (like it is supposed to be doing). But then (which is very surprising for me), when I change the mode from Debug to the Release mode, the compiler builds the application as a .DLL file?
I have only very recently started to use Visual Studio 2010, so don't know my way around it yet. How do I fix this so that when it is compiling in Release mode, to build the application as an .exe file ?
Set your project type to Windows Application.
In the IDE, right click on your project, and select Properties.
Configuration Properties->General->Configuration Type set to 'Application (.exe)'
In project options you should be able to choose whether you're building a .DLL or .EXE. I thought these were the same for all configurations, but you can check to see for yourself.

Visual Studio 2010 C++ native debug mode resources

I am very desperate now...
I have project in Visual C++ 2010 using Qt and OpenCV. I got to phase I need to load XML file using openCV. But, I have no idea where is the working directory of my project, when run thru VS (F5). I mean, I read all config, copied desired file almost everywhere in my project folders, but it still is not seen by my EXE (OpenCV)...
What Am I doing wrong? Thanks.
right click on your project click on properties/Configuration Properties/debugging you start in whatever working directory is set to.

How to build exe in Visual Studio C++

I am a .NET C# developer and trying to learn C++.
I am having issues in trying to create an exe from a console app from Microsoft Visual Studio when I do a build compile and check the Debug folder. There isn't any exe, just some manifest files and other files. I am asking this because I am not sure if this is how it works? is there any another way of doing this?
I have tried the Microsoft Visual Studio console and c:\cl test.cpp, this gives me an test.exe but can it be done from the MSVS GUI like in C#?
Have you checked the debug folder at the solution level? I believe this is the default target directory. The DEBUG folder in the project is for the output of temporary build files.
Did it compile successfully ? Also, check your active configuration if its debug or Release ?
Also, check the output path to double check the location of executable.
It works the same as C#, so there is no need for command line.