Linkage error with glui32.lib and libcd.lib on Visual Studio - visual-studio

I am trying to port a (very) old project of mine from Visual Studio 6 to Visual Studio 2010.
The project is an OpenGL application, and as such, it uses the following libraries (amongst others):
glu32.lib
glui32.lib
glut32.lib
opengl32.lib
The glui32.lib library links the libcd.lib library, which is not supported on Visual Studio 2010.
So I need to find a version of the glui32.lib library, which links the libcmtd.lib library instead.
My questions are:
Is there any such version of the glui32.lib library?
If yes - where can I download it?
If no - can I use the libcd.lib library on Visual Studio 2010?
If yes - where can I download it?
If no - is there any other way for me to solve this linkage error?
UPDATE
I'm leaving the answer below as the accepted one, but here is a workaround for porting an OpenGL project from Visual Studio 6 to Visual Studio 2010 (after creating the project in Visual Studio 2010):
Right click the project and choose Properties.
Open Configuration Properties --> C/C++ --> Preprocessor.
In the Preprocessor Definitions entry, add GLUT_BUILDING_LIB.
In the Runtime Library entry, choose Multi-threaded (/MT) or Multi-threaded Debug (/MTd).
Open Configuration Properties --> Linker -->Input.
In the Additional Dependencies entry, add glu32.lib;glui32.lib;glut32.lib;opengl32.lib.
In the Ignore Specific Default Libraries entry, add libcd.lib.

You can rebuild GLUI. The MSVS project they ship converts without issue to VS2010.
You will have to point it at your GLUT build though.

Related

missing dll errors after creating installer for my project in Visual Studio 2010

I have a fairly large project in Visual Studio 2010
I can build the project in both Debug and Release mode, copy the generated exe file along with a custom dll I need for a function in the program to another computer, and the exe file works without any problems
I am trying to make an installer for this project in Visual Studio 2010, following the instructions here: https://www.technical-recipes.com/2011/how-to-create-an-installer-in-microsoft-visual-studio/
I do not get any errors while building the installer, and I get a setup.exe and an msi file as a result, but if I install my program in another computer (not by development machine), when I try to run my program after installation I get a missing api-ms-win-crt-runtime-l1-1-0.dll error
How do I debug this problem? Since I can simply copy my Release or Debug build to the computer and make it work, doesn't it mean all the dll files my program is dependent on already exists in the other computer? And if this already works, why isn't the installer version working? How do I make sure that everything I need for this program is included in the installer?
My project in MFC dialog based and uses one third party library, for which I have both .lib and .dll file available. I need to do this in Visual Studio 2010. My development machine is Windows 10 64 bit Home edition version 1909. The installer I currently create installs my program in Program Files (x86) folder.
Static Linking MFC: It appears this issue was solved by making sure to statically link to MFC libraries. In the VC++ project: enable the setting: "include MFC in a static library". This enables static linking of MFC components, eliminating the dependency on shared dlls.
This is a common "missing runtime error" - there are generic check lists below which include this as one source for application launch problems.
Warning: Generally static linking should be avoided in order to benefit from security updates to shared dll files via other update mechanisms.
Short Version: In Visual Studio Installer Projects, check if the Visual C++ Runtime is available in the Prerequisites list.
See this answer, here is a quick screen shot:
Tools: If your project is large you might want to consider another MSI tool. There are many limitations with Visual Studio Installer Projects.
Merge Modules: There are merge modules to install the Visual Studio C++ Runtime, but it is recommended to use the setup.exe for these reasons.
Visual C/C++ Runtime: You are probably just missing the Visual Studio C/C++ Runtime. It needs to be deployed with your application, it is not on there by default (unless you link statically, in which case it should not be needed). Skim this list quickly for other ideas.
You can download the VC++ redistributables at ("The latest supported Visual C++ downloads"):
https://support.microsoft.com/en-us/kb/2977003
More Information:
More on the Visual C/C++ Runtime
Secondary Links:
Detecting presence of Visual C/C++ runtime on box
Missing Dependencies and check lists
Scan for application dependencies
Installing VC++ Runtime with merge modules

How do I use Qt in my Visual Studio 2015 projects?

We have large project that used .NET Framework for showing forms/windows. Recently I decided to deprecate CLR dependency and move to Qt.
While learning Qt, we've migrated from Visual studio 2013 to 2015 and then I noticed that there is no qt support for MSVC 14 version which vs2015 use.
Additionally, Qt vs addin was not working jn visual studio express/community edition we use. Is there any chance for me to use Qt and qt addin in our projects?
Searching web did not help, and it looks like no one use Qt with latest Visual Studio?
Building
You can use Qt in Visual Studio 2015 without any problems. As already stated in the comments, you have to build it from source but Qt is pretty straightforward to build. You can download the current (5.5) sources here and then follow this step by step example on building it.
I would also suggest reading more about the configure options, this might save you a lot of time. It might possibly save you some external dependencies as well if you skip components you do not need. My configuration for instance contains -skip qtwebkit -skip qtwebchannel so I do not need ruby or python.
I could totally omit step 3 from the link. Just be sure to open the Visual Studio Command Prompt (32/64 is important here) for configure and nmake.
Usage
For Visual Studio 2015, the Qt Add-In is not available anymore. But there is an Extension (Tools > Extensions & Updates) called Qt5Package or QtPackage which has the same functionality. After installing it, you have the Qt entry on your main toolbar where you have to specify a version and the path to the directory where you built it. This version will also be associated with the current project via the same menu.
If you load an existing project, you also have to convert it so the whole Qt functionality is used automatically. You can do this by opening the solution and right click on it; there should be an entry for the conversion to a QtAddin generated project.
I am using Qt 5.5 on Visual Studio 2015 with an old project and it is working without any issues.
As of now, you can just download Qt for Visual Studio 2015. Here.
Qt have finally added support for Visual Studio 2013 and 2015 although it's only in beta right now. See QTVSADDINBUG-404 for progress and read the blog post From Visual Studio Add-In To Qt VS Tools (Beta).
The Qt Windows could be added to the current project by copying all relating necessary files from the Qt stand-alone project to the current project. Specifically, the following steps must be conducted carefully.
Create an example project of Qt inside a Visual C++ project by using a Qt Plugin Program. The windows must be designed inside this project carefully before adding to the existing project.
Inside the existing project, add carefully the file heloqt.cpp, helloqt.h, ui_helloqt.h, qrc_helloqt.cpp, moc_helloqt.cpp in case of the Qt Project having the name of helloqt.
Add some configurations of Additional include directories and Additional library directories and Additional Dependencies into the existing project.
Compile and add some required *.dll files for running the program.
I have to do that because I want to use a graphic user interface in my big project, and this project is too big to be added into the Qt project inside the Visual C++ Studio.

Lowering a Visual C++ 2010 framework target

I've browsed around StackOverflow but couldn't find any pratical solution to something that would seem to have such an easy solution: I had a bunch of .Net projects that were developed back in VS2005 or VS2008 and I imported them into VS2010. One of them is a C++ project, which currently targets framework 4.0 (not by my choice). One of our clients is having a problem running this application, the lack of a MSVCP100D.dll. I checked this thread what is MSVCP100D.dll? and the most accepted answer is simple: having the client install Microsoft Visual C++ 2010 Redistributable Package. However, the client is stubborn enough not to install it and I know for a fact that they have Microsoft Visual C++ 2008 Redistributable installed. So, if I'm correct in my conclusions and MSVCP100D.dll is new to VS2010, I could just target a previous framework version, rebuild the project in VS2010 and I'd be good to go. The problem is: how do I chance a VC++ target framework? I could find several guidelines to change C# and VB projects, but none about VC++. Any pointers?
Edit: To you guys who suggested that I compile it in Release mode: I am! It's been pointed out that the "D" stands for debug, which is rather strange.
Actually, you are using the debug version of the runtime (That's the "D"). Did you try compiling with a non-debug version?
Another possibility to consider would be to statically link with the runtime library. Your program will be larger, but will not have the DLL dependency.
Go into the project's properties.
On the lefthand side, go into Configuration Properties > General.
Look at the Platform Toolset value. Select v90 from the drop down list to target 2008.
See here for further details:
Visual C++ 2010 compatibility with VC 2008
See here for yet even more details:
http://blogs.msdn.com/b/vcblog/archive/2009/12/08/c-native-multi-targeting.aspx
Also as Dark Falcon mentions, that's the debug version of the runtime.

load c++ dll in ironpython

I have an ironpython app that uses dlls.
Some of the dlls written in c#, and one is in managed c++.
The app works fine on my host, and on any host that includes visual studio (2010) installation.
When I tried to run this app on hosts without vs, It failed. After some checking I discovered that ironpython cannot load the c++ dll.
After installing vs - the app runs fine.
I narrowed it down: the dll can be uploaded after the installation of:
-Microsoft application error reporting
-VC 9.0 Runtime(x86)
-VC 10.0 Runtime(x86)
-Microsoft visual studio macro tools
I tried to install Microsoft Visual C++ 2010 Redistributable Package http://www.microsoft.com/download/en/details.aspx?id=5555 and it didn't do the trick.
Why? what exactly happens in installation of vs, that doesn't occur when I install Microsoft Visual C++ 2010 Redistributable Package component?
How can I monitor errors that arise when loading dlls with ipy?
Thank you!
The DLL that is written in managed C++ uses a DLL for its standard libraries. You can change it to static libraries. Follow these steps
Open your project properties in Visual Studio (right click on the project)
Click you way to Configuration Properties > C++ > Code Generation
On the right, find Runtime Library and select Multi-Threaded Debug (/MTd)
Do the same for the Release build, but this time select Multi-Threaded (/MT)
Rebuild all
As for your specific questions :
1. The redistribuable installer will copy the DLL in the system path. Visual Studio will do the same thing. So if it doesn't work, make shure that you have the 32 or 64 bit binaries (same as your code, not the platform you are running). +If you are running from a console, close it and start a new one to get the updated path.
2. Use Dependency Walker. Loading your DLL will show you what it is looking for, it should be enough. To monitor its runtime execution, load IronPython. In the "Profile" menu, select "Start Profiling" and provide a command line that will reproduce your problem.

How to build MFC library from source with Visual Studio 2010

Visual Studio has historically always included the MFC library as source so you can build it yourself with the supplied makefile. But in Visual Studio 2010 there is no makefile for MFC. So, how can you rebuild it?
There is documentation on MS implying the makefile should be there:
http://msdn.microsoft.com/en-us/library/bs046sh0.aspx
.. so perhaps its an oversight, or perhaps they migrated it to msbuild but forgot to include the mfc msbuild project file.
If anyone has succesfully built a custom MFC based on that in VS2010 how did you build it?
Can the makefile from VS2008 be used with minimal tweaks? Or does anyone have an msbuild script for it?
I'm only interested in a statically linked library to be used with a specific app.
since in the end MFC is a library as any other, you can just create a new project in visual studio and add all MFC source files to it. Set the options to create a static library, set compilation/linker options as desired (eventually based on the 2008 makefile) and you're ready to go.

Resources