Visual Studio - lib is not a valid Win32-Application - c++

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!!

Related

Exe file from a console project in Visual Studio?

I want to execute a C++ program in a second machine without any IDE.
I tried to launch the .exe file which is located in the debug folder of the project and to generate a .exe file following this guide.
Both .exe gave me the same errors (launched manually and from a prompt):
The program can’t start because
- VCRUNTIME140D.dll
- MSVCP140D.dll
- VCRUNTIME140_1D.dll
- ucrtbased.dll
is missing from your computer. [...]
So i try to uninstall and reinstall Microsoft Visual C++ Redistributable per Visual Studio 2015, 2017 e 2019 from there, but still the same errors.
What am I missing? How can I run it without install the whole Visual Studio IDE? Thanks for your time.
You need to compile your program to a Release exe file. Compiling your program using Debug will never work on any device unless it has Visual Studio installed on it.
Why this happens?
If you select debugging, before the program runs it loads some DLL files for debugging in visual studio. Now, on other machines visual studio may not be installed, so it couldn't find the DLL files so it will just not start. But Release, it is like its name, when you want to send your program to a friend or use it on another computer or share it on the internet, use Release. But if you are testing bugs and still working on the program, use Debug.

Visual Studio 2017 C++ built executable refuses to launch on another PC

I have a C++ project in Visual Studio 2017, which I built an executable file from, using the answer from this question found on MSDN , the .exe was built successfully, but when I copy this file to another PC and try to launch it, it returns me an error message, which says that launching of this app is impossible, because libcurl.dll is absent, what should be done, for avoiding this problem ?
Here's the preset which I'm using for .exe creation
P.S.
If it is of any help, when I created the project, I've chosen Empty Visual C++ Project.

Cocos 2d x not generating libcoco2d.vcxproj or libspine.vcxproj

My config:
Windows 10, python 2.7, Visual Studio 2015 community
I downloaded cocos, I successfully run setup.py
Then I proceed to execute "cocos new -l cpp -p com.whatever.Test -d D:\Projects\Cocos\Test".
Everything seems to run ok, no error message whatsoever. If I go to my folder, I can see all the project folders etc.
I open the sln file within Win32 and it opens the project in visual studio 2015.
Here comes the problem: the solution has 6 projects. 2 of them are not loading and, as a consequence, the main project fails. The failing projects are libcocos2d and libspine. There are no project files generated in their respective folders, so VS can't find the required libcoco2d.vcxproj or libspine.vcxproj.
I'm lost here people, I don't have a single clue on what do I have to do to generate both projects.
Any help will be very much appreciated.
Thanks
I found what was wrong. The cocos.py script, at some point, calls CMake. I downloaded CMake and I built the projects using that. It failed. Then I realized that CMake was using the wrong compiler. Even having Visual Studio 2015, the correct compiler is Visual Studio 2014, not Visual Studio 2015 (Thanks a lot M$...). Then CMake was working. After that I tried the script again, and everything is perfect now.

Missing MFC71.DLL for new empty VC++ Console Project

I am trying to get an slightly older project running again. I used the code last summer just fine. Unfortunately I did not keep the VC++ project files, just the code. As such I created a new VC++ console project and selected the "empty project" option in the process. Upon adding the code and pointing the compiler and linker to the appropriate folder I compile successfully. From there I attempt to debug and receive the message
The program can't start because MFC71.DLL is missing from your
computer. Try reinstalling the program to fix this problem.
From what I see this DLL is in the Visual Studio .NET 2003 which as far as I can tell my project should have no dependency on. I am using a robotics simulation library called callisto which I suppose could depend on it. However that project seems to be gone so I can't confirm as much from the project website. How does one go about using MS development tools to determine as much? In the event that it does not, what other possible reasons would a new project depend on such an old DLL?
Note that if you are using that library in form of DLL (already compiled code that internally depends on redists of VS 2003), you can verify this by using the Dependency Walker (it is a simple .exe file that you can download here: http://www.dependencywalker.com/ and just drag-n-drop this DLL on it).
Also note that you don't need to install whole Visual Studio. Redistributable package for VS 2003 will do.
EDIT: "The Visual C++ 2003 runtime was not available as a seperate download" ~ check Where to download Microsoft Visual c++ 2003 redistributable

TInyXML++ Premake with Visual Studio 2010

I tried to compile TinyXML++(or TICPP) using premake4 with these settings: "premake4 vs2010 [--unicode] [--ticpp-shared] [--dynamic-runtime]". It compiles the .libs but I can't compile TiCPP.vcxproj because the compiler says "Unable to start program c:\ticpp\lib\ticpp.lib. This file is an unrecognized or unsupported binary file." Anyone got a clue how to make this work? Oh and one more thing, why does Windows ask me if I want to open a .vcxproj with Visual Studio 2010 or Visual Studio 10? How do I make it so that it only picks one, and what's the difference. I tried the first answer, but it didn't work.
Download last version of premake, it does support VS2010
I have compiled tinyXML++ using it, by executing:
premake4 vs2010
it does generate valid sln and vcxproj files.
From oolua build instructions
Visual Studio 2010 (vs10) is not currently supported by premake yet if you have vs10 installed you can run the following command, it will generate vs9 projects and update them using the vs10 command line tool.
premake4 vs2010
As vs10 adds files which have not been created directly by premake, a specific clean operation has been added to the premake script.
premake4 cleanVS10
Scripts to build a local install, build and run unit test etc. have been added for vs10 in the script directory.
Notes:
* oolua's premake4 script may not be the same as yours.
* VS2010 support is borked in premake. Current workaround is to make a 2008 project and make VS2010 convert it for you.