How to configure Glib on Microsoft Visual Studio 2010? - windows

i'm trying to port to Windows a C project wrote to work on Linux. It's a simple project that depends CUDA and Glib librarys.
I believe the best way is to compile with Microsoft Visual Studio 2010, but i don't have idea how to link Glib to this project. CUDA code is going well, but every call to Glib methods generate a "unresolved external symbol" error.

i just solved my problem using this guide to configure GTK on Visual Studio 2008:
http://www.etechplanet.com/blog/visual-studio-2008-configuration-for-gtk2b-gui-development.aspx
The only change i done was about the Tools/Options/VC++ Directories because this was deprecated on VS2010. I added the paths directly to the project properties.

Related

Can I use qt5 in visual studio without the add-in?

I understand I can use Qt5 in Visual Studio by using the Visual Studio Add-in for Qt as mentioned in Building Qt5 with Visual Studio 2012 / Visual Studio 2013, and integrating with the IDE.
Is it possible to use Qt5 in Visual Studio without using the Add-in?
Also, I would like to use CMake to generate the Visual Studio Project.
Yup.
I have it working for a pretty complex subdirs template.
Qmake can generate the visual studio solution file and vcxproj, look here:
http://doc.qt.io/qt-5/qmake-platform-notes.html#creating-visual-studio-project-files
What I do is use the Qmake project as the master project, and generate the VS stuff out of folder as temporaries. This prevents Visual studio from tangling up in your source files as well as in the qmake stuff. And you can also port it to other OSs without any hassle. Using this approach, if you want to add files to your project, don't do it through VS, but add it to the .PRO file and re-run qmake.
The only thing (that I've found) is if you change anything that needs to be MOC'd, then re-run qmake.
If you want CMake exclusively then this is a nice guide
http://www.kdab.com/using-cmake-with-qt-5/.
The qmake way is a little cleaner as you don't get all the extra noise of finding Qt libraries as you need in CMake.

Visual Studio 2013 generated solution from CMake links VS 2012 libraries

I generate a Visual Studio 2013 solution using CMake 3.0.2. When compiled it gives errors similar to this:
MSVCP110D.dll and Visual Studio 2013
I can't get my head around this, the toolset is v120 so why does it link v110 libraries? I've asked in the CMake IRC channel but they can't help me. It's impossible to debug the program because the redistributable does not include debugging dlls.
Edit: This is an Ogre3D application that i derived from the tutorials cmake zip. I've barely touched the CMakeLists.txt, only set REQUIRED for finding boost and added boost-system to libraries that are copied during install.
I found the solution regarding the Ogre3D-specific issues with this. The latest prebuilt 1.9 package was compiled with VS11 (2012) so that's why the .dll is missing, since I use VS12 (2013) as IDE.
The solution is to build Ogre3D from source, as is explained in depth here: http://www.ogre3d.org/tikiwiki/Building+Ogre
Remember to update your OGRE_HOME environment variable to point at the sdk folder inside the build.
Hope this helps other lost souls!

"program can't start because msvcp100.dll is missing" for Every single code

This error is taking toll of my training schedule.
Everytime I create any C++ application in my VS2010, It runs fine on my machine but if I run it on different machine, It starts with this error.
Error goes if I copy msvcp100.dll in System Folder then it shouts for some other DLL. It requires some 5-6 different DLLs.
Most irritating part is even if I write a simple Console based Addition program, It gives this error.
(I should not but)I would have agree if I design some fancy forms and all... But for simple Addition program????
Am I missing out somethings in Settings? or VS2010 to blame??
Somewhat related question: this But this problem seems different
By default, MSVC projects are set to link against the dynamic run time library which generates a dependency on the visual C++ run time redistributable. As you have already found out, this dependency is not guaranteed so your install utility has to install the visual c++ run time first.
You can avoid this by changing your project settings. Load the project properties and go to: "Configuration Properties"/"C/C++"/"Code Generation"
In the item labelled "Runtime Library", select "Multi Threaded (/MT)"
for the release version"Multi Threaded Debug (/MTd)" for the debug version.
You have to be careful while doing this that all the other libraries that your application links are also compiled against the static run time.
You need to have Visual C++ Libraries installed if you want to run your app.
Using the compiler options to change the runtime library worked for me ("Configuration Properties"/"C/C++"/"Code Generation". In the item labelled "Runtime Library", select "Multi Threaded (/MT)" for the release version and "Multi Threaded Debug (/MTd)" for the debug version). I did have to do both the debug and the release to get the release to work. Don't know why (it is possible that I did not do it correct the first time).
Note: I was using VC2010 Express version on Windows 7 to compile. I tested on an old XP machine.
Another note: MS information at http://msdn.microsoft.com/en-us/library/2kzt1wy3(v=vs.100).aspx
If you have installed a new copy of Windows on your computer or have reinstalled one then you will come across an error called "The program can’t start because MSVCP100.dll is missing from your computer. Try reinstalling the program to fix the problem." on your computer.
The basic reason behind this error is that the Visual C++ doesn’t get installed when you reinstall or install a fresh copy of Windows operating system. In order to check Visual C++ is installed on your PC or not, open Control Panel → All Programs and Features and then search for Visual C++ in the software list. If you don’t find the software installed there then you have to install it.
I would suggest, first of all, install the Visual C++ 2010 package and check if it has solved msvcp100.dll missing error or not. If the issue is not resolved by the Microsoft Visual C++ 2010 then install 2013 or 2015 versions of Microsoft Visual C++. Here is the list of download links of Microsoft Visual C++ for both x86 and x64 architectures:
Microsoft Visual C++ 2010 SP1 Redistributable Package (x64)
Microsoft Visual C++ 2005 SP1 Redistributable Package (x86)
Visual C++ Redistributable Packages for Visual Studio 2013
Visual C++ Redistributable for Visual Studio 2015
→ The latest supported Visual C++ downloads
I hope, now you are able to fix “The program can’t start because MSVCP100.dll is missing error on your computer. To know more details, you can follow this guide.
Thanks

Possible to use Qt Open Source integrated in Visual Studio?

I'm currently having issues installing Qt (Open Source Edition) such that I can use it in integrated into Visual Studio 2010. I realize that the 2008 edition will have deployment issues, and so I installed it from the source, only to be missing qtmaind.lib.
Anyways, I was looking around for a solution to this, and I came upon this: http://doc.qt.io/qt-4.8/install-win.html, which states:
Open Source Versions of Qt is not officially supported for use with
any version of Visual Studio. Integration with Visual Studio is
available as part of the Qt Commercial Edition.
Anyways, I thought maybe this was the reason I was having problems, and so I wanted to ask the following question:
Is it possible to integrate Open Source Qt into Visual Studio?
Absolutely. I use Qt 4.7 integrated with Visual Studio 2005.
I configured Qt this way:
configure -debug-and-release -opensource -shared -ltcg
-no-accessibility -no-qt3support
Once Qt was built (via nmake), I also installed the Qt Visual Studio Add-in.

Building a library with Visual Studio that can be linked to a Qt project?

Right now I have some libraries that link easily to Visual Studio projects but I can't figure out how to link them with Qt. My idea is to write a VS project that wraps the functionality I need from the libraries, then compile that to a library which can be linked to Qt. From my understanding, VS and Qt use compilers that create incompatibile libraries. My questions are:
Can I modify VS or Qt in a way that I can compile a library in VS which can be linked to Qt?
Is there a simpler solution to this problem?
The specific library I'm using is Nitro-Nitf. For my Qt project I'm using Qt Creator and for Visual Studio I'm using VS 2008.
Yes, the Windows binaries provided by Qt are built using MinGW. If you build Qt from source using Visual Studio, then your libraries will be compatible.
Although I haven't tried it, Qt Creator 1.2 introduces support for MS compilers, so you should be able to continue to develop your Qt projects in Creator.
Qt is available as source code, you can build it with whatever toolchain you like. Visual Studio is an IDE (integrated development environment) that normally invokes the microsoft compiler (cl) and linker (ld), although you can configure a Visual Studio project file to do a makefile build, or IIRC, invoke any other program you like to do the build step (at my previous job, we built our Qt apps with cl and ld, and could debug with Visual Studio just fine, since about 2005).
Also, it appears this "NITRO" project is open source, so you can download the source instead of a pre-built binary, and build it using MinGW if you'd like to build Qt apps with MinGW, or if you are using pre-built Qt libraries that were built with MinGW.
To build Qt4.5 with visual studio
Download the source
./configure.exe -platform win32-msvc2008 or win32-msvc2010
nmake
There is even a free release of the visual studio plugin to make handling all the autogenerated code automatic in visual studio

Resources