i would like to use OpenGl in Visual Studio 2010. Following Problem: "error LNK1104: Data "GIU32.lib OpenGL32.lib freeglut.lib glut32.lib" could not be oppend"
I read many Tutorials but they don´t help me :-(.
The lib data sets are in "C:\Program Files(x86)\Microsoft SDKs\Windows\v7.0a\lib".
The header data sets are in "C:\Program Files(x86)\Microsoft SDKs\Windows\v7.0a\Include\gl"
The dll data sets are in "C:\Windows\SysWOW64"
I Use Windows 7 Professional 64Bit.
I put "GIU32.lib OpenGL32.lib freeglut.lib glut32.lib" on Project > Properties > Linker > Input.
This is what you need to do.
Obtain GLUT for Windows (OpenGL Utility Toolkit) from Nate Robins’ web page. I put it on my C drive. The current documentation for GLUT tells you to go into the glut project folder and build the glut.dsw Visual Studio project. This is a little misleading since there is no glut.dsw file and all the dll, lib etc files you need are already there! So don’t worry about doing this, just download it.
Create a Visual Studio Project such as a new Console Application. For Windows XP: paste the glut32.dll file into: C:\Windows\System32. For Windows 7: place the glut32.dll inside the C:\Windows\SysWOW64 folder instead.
In the Project properties, select C/C++ -> General -> Additional Include Directories and add the location of the glut.h header file. This might be C:\glut-3.7.6-bin\
In the Project properties, select Linker -> General -> Additional Library Directories and add the location of the glut libraries eg C:\glut-3.7.6-bin\
In the Project properties, select Linker -> Input -> Additional Dependencies and add “glut32.lib”.
It should then compile. For a more detailed explanation, plus advice for installing the latest Windows Drivers from the Intel site, see this blog post.
Your error message lists all missing files in the same error.
That means you didn't set your dependencies correctly, because the linker searched for the file "GIU32.lib OpenGL32.lib freeglut.lib glut32.lib", which doesn't exist, of course.
The file names have to be separated by ";" in the Additional Dependencies section (under Linker > Input).
Or, if you use the edit menu by choosing it from the drop-down selection, each dependency has to be in a new line.
So you have to write "GIU32.lib;OpenGL32.lib;freeglut.lib;glut32.lib".
If error persists, you just put the libs in wrong place. Try to define additional lib path in project properties (sorry, I don't have VS 2010 around to show you exact location).
The DLLs need to be in BOTH system32 and syswow64
See here:
http://www.james-bennet.com/2011/10/using-glut-under-visual-studio-2010/
Has a HOWTO including a screenshot of the linker options you need to set.
Related
How are you?
I am trying to create a video like this:
https://youtu.be/L0JkjIwz2II
or like this:
https://youtu.be/hPCTwxF0qf4
I am trying to getting this code working:
https://github.com/Tubeliar/HAARCascadeVisualization
I am using Visual Studio 2017 on Windows 10.
I have added correctly the include directory and the library directory.
I created it as a console application.
I added the #include "stdafx.h" at the start of the main file.
This are the errors that Microsoft Visual Studio show to me:
Can you help me solve this?
There is anything that I should know for making this work correctly?
Thank you to everyone,
Andrea
Those errors are as has been noted indeed linker errors. If the compiler does not complain that means you have you include paths set up correctly, so you have won half the battle.
For linker errors you can try these things:
Make sure your *.lib files are built for the same target you're building your own project for.
If you use NuGet then you can look in the /packages folder of your project. Browse down to /packages/[package name]/build/native/lib/[architecture]/. There you will find folders like v120 or v140. For Visual Studio 2017 they need to be v141. If they are missing then you can tell VS to target the older platform (project properties -> general -> platform toolset)
If you've built the libraries yourself then maybe you did that similarly targeting a different platform? Try building the OpenCV library again and make sure the target is set to v141 (or whatever you want to use).
Make sure the linker can find your libraries. If you're using NuGet this step isn't necessary but if you built the library yourself or if you downloaded a prebuilt one then go into project settings and:
Go to VC++ directories -> Library Directories, edit that value and make sure the folder that contains the *.lib files is in there.
Go to Linker -> Input -> Additional Dependencies, edit it and put in all the *.lib files. Just their names, not full paths. In your case you'd just put opencv_world331d.lib there.
Be aware that any of the above settings need to be done for each configuration. Usually there is a x86 and x64 architecture combined with debug or release configuration. If you switch any of these you'd have to check the above steps again. This is a bit of a hassle so you're better off defining a property sheet once which you can then reuse every time you do a OpenCV project. There was a tutorial for this in OpenCV 2.4's documentation, and some people have made premade ones.
I am trying to add boost 1_64 (boost 1_65 will also work) to my Visual Studio 2017 project which includes boost/array.hpp and boost/asio.hpp and used various methods of the same.
I have used the following method https://studiofreya.com/2017/04/23/building-boost-1-64-with-visual-studio-2017/ but I am getting error: cannot open source file "boost/array.hpp" and cannot open source file "boost/asio.hpp" and other errors on the methods of boost.
The error implies that you haven't added boost to the VC++ Directories.
To add them:
Open the Property Manager from the View -> Other Windows menu.
Click on the project and navigate down to Microsoft.Cpp.x64.user.
Right click and select Properties.
Open Common Properties and select VC++ Directories
Add the directory where you installed boost to Include Directories
Add the directory where you builtboost libraries to Library Directories
Also see Boost Getting Started on Windows in case you get stuck elsewhere.
I've found the Additional Dependencies thing on Visual C++ 2010, but I can't seem to find any option of adding new .lib files when I go to .
I need to add wsock32.lib to link with my file, how do I make it happen?
Thanks!
Add the wsock32.lib in the text field.
Project Properties -> Linker -> Input -> Additional Dependencies.
When you click in the field, you get a ... button. Click on this button and add one library name per line. Alternatively you can write the names in the field. Separate all entries with space characters.
You can verify that it's on the command line in
Project Properties -> Linker -> Command Line.
Here is a GUI way to add a LIB file to your Visual Studio project in C and C++ Languages (for those of us who like to mouse-around like me). I did this in Visual Studio 2012. But I think it works in previous versions, as well.
Find the LIB or other file you want to add to your project in
Windows Explorer. Drag the LIB file from Windows Explorer onto
Visual Studio's Solution Explorer, to the project to which you wish
to add the LIB file. Now, you will see the file listed in Solution Explorer.
That's it! Just one step! You will not see the file in "Project Properties -> Linker -> Input -> Additional Dependencies." However, it is there hidden in the macro
%(AdditionalDependencies).
edit Additional Dependencies and puts wsock32.lib in it.
and also add the path of lib in Link->general-> additional library directories
I did see some similar questions about this - but I couldn't piece together what I needed.
I'm using boost in a project in Visual Studio 9, and I'm unable to get it to recognize all the header files that I'm trying to include. I'd installed Boost using the Windows installer that also places the binaries on my machine.
In Visual Studio, I modified the Project->Properties->Linker->Additional Libarary Dependencies to include the folder "mypath\boost_1.44\lib", which contains the binaries - but I still can't get VS to recognize my Boost header files. Please help!
Cheers.
edited to clarify some text
You need to modify the project properties to add header locations for the boost headers as well. If you want a global setting, this is how you do it:
Tool->Options->Projects and Settings->VC++ Directories. Then on the right hand side, Open the dropbox labeled "Show Directories For" and pick "Include Files".
Add a new line for your boost header path.
This is a screenshot from VS2008 - it is similar in VS2010 and VS2005.
Additionally, you can also set these directories on a per-project basis by modifying each project's specific properties.
I made a program in Visual Studio 2010 on Windows 7 64-bit.
When I try to run it on Windows XP 32-bit I got message that msvcr100.dll is missing. When I try to copy that file from Win7 to WInXP I got message that msvcr100.dll is wrong.
How to set building in VS so msvcr100.dll would not be necessary?
First you need to make sure you're building a 32 bit executable - 64 bit ones won't run on 32 bit Windows.
Then you can either...
Ship the 32 bit redistributables with your application.
Remove the runtime dependency altogether and link statically to the C++ runtimes. To do this, set Project -> Properties -> Configuration Properties -> C/C++ -> Code Generation -> Runtime Library to Multi-threaded (/MT).
Linking the runtime libraries statically should help. Go to Project Options -> C/C++ -> Code Generation -> Runtime Library and change the value to Multithreaded or Multithreaded Debug and recompile. This way your application shouldn't depend on the runtime DLLs.
Also don't forget to build a 32bit executable.
The answers above helped me along, but I was still getting the error:
fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds
So to help other who may have, like me, spent way too much time stumbling around in search of a clear solution, I'd like to add the bit of information that solved this issue for me. As it turns out, my project had the wrong "Use of MFC" setting to make use of the answer above.
To put it in clear terms:
Open up the project properties (alt-F7 or Project-menu -> [My Project] Properties) and go to Project -> Properties -> Configuration Properties
If General -> Use of MFC is set to Use MFC in a Static Library
you must set
C/C++ -> Code Generation -> Runtime Library
to either Multi-threaded Debug (/MTd) or Multi-threaded (/MT)
and if
General -> Use of MFC is set to Use MFC in a Shared DLL
you must set
C/C++ -> Code Generation -> Runtime Library
to either Multi-threaded DLL (/MD) or Multi-threaded Debug DLL
I got this answer from the Microsoft community answers website and all credit should go to David Wilkinson.
The keyword here is "redistributable" since this error message may occur when attempting to run a .exe that was not developed on the end-user's PC.
The following is a good (and trusted) source to download redistributables without having to download the entire VC++ package or patch:
https://visualstudio.microsoft.com/vs/older-downloads/#microsoft-build-tools-2015-update-3
In my case I needed the "Visual Studio 2010 VC++ Redistributable" even though we are in year 2022.
enter image description here
Step 1.: Go to this website dll-files.com.
enter image description here
dll-files.com is a great repository of Windows DLL files and has almost all the DLL files that are existent on Windows.
Step 2. Now type there your DLL error in the search window of the website.
Step 3. DLL-Files.com will immediately list out the zip file containing that particular DLL file. Download this zip file to your computer and extract it. The extracted folder will contain the DLL error file.
enter image description here
Step 4. Copy the download DLL file (Only that file) and paste this file in your default system folder based on your operating systems below.
C:WindowsSystem (Windows 95/98/Me)
C:WINNT\System32 (Windows NT/2000)
C:\Windows\System32 (Windows XP, Vista, Windows 7/Windows 8.1/Windows 10)
Windows will ask you whether you want to replace the existing DLL file with the new one. Say yes and let Windows copy the file. Restart your computer and voila, you can now run the game/app that was not opening and giving the DLL error, easily.
There are many other websites which will give you DLL files that you want