How to setup Glew and Glut in Visual Studio 2012 - opengl

By reading question you would get the idea about description.
Steps I done so far:
download glut from internet
copy glut.dll to windowsvow64 (I'm using x64).
Copy glut header files to C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\GL
Copy glut.lib to C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib
and done the same for glew and glfw. I edited additional libraries (glew.lib; glut.lib; etc)
But so far, its not compiling a simple program mentioned in this website.
Here are the errors
error LNK2019: unresolved external symbol _glfwInit referenced in function _main
(and many more are like this)

To add a reference in Visual Basic
In Solution Explorer, double-click the My Project node for the project.
In the Project Designer, click the References tab.
Click the Add button to open the Add Reference dialog box.
In the Add Reference dialog box, select the tab indicating the type of component you want to reference.
Select the components you want to reference, and then click OK.
To add a reference in Visual C#
In Solution Explorer, right-click the project node and click Add Reference.
In the Add Reference dialog box, select the tab indicating the type of component you want to reference.
Select the components you want to reference, and then click OK.
To add a reference in Visual C++
In Solution Explorer, select the project.
On the Project menu, click Add References.
Note In Visual C++ 2005, click References on the Project menu, and then click Add New Reference.
In the Add References dialog box, click the tab that corresponds with the category that you want to add a reference to.
Note In Visual C++ 2005, click the Browse tab in the Add References dialog box.
Click Browse, locate the component that you want on your local drive, and then click OK. The component is added to the Selected Components field.
Note In Visual C++ 2005, locate the component that you want on your local drive.
To add the selected reference to the current tab, click Add.
Note In Visual C++ 2005, click OK to close the dialog box and add the component in the References list box on the Properties Page dialog box of the project.
More about this you can find HERE

First of all, add your dll's to C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin
If you have the includes and libs in the directories above then that should be fine.
Now right click on your project and select Properties
Go to linker and within this, select Input
make sure you have listed the required libraries in here like your glew.lib, freeglut.lib and the following which is recommended on the glfw website:
glfw3.lib, opengl32.lib (I'm assuming you're using glfw3)
See here for more info:
http://www.glfw.org/docs/latest/build.html

You need to specify the libraries for example glut.lib and the others to the project, The compiler cannot scan all libraries looking for the functions you are invoking; only does that for the standard library. So in VS from the project Menu select properties, then for the linker input add the libraries you are using to additional dependencies.

Related

I Don't Know How To Use/Run These Files That Are In A Github C++ Library I'm Trying To Add To My Project?

https://github.com/gladosconn/ecdsa_cxxI have been trying to get this library into my project (C++ using Visual Studio 2022, in Windows) because I need to use the ecdsa signature algorithm, I have copied all the files in src folder to a folder called "ecdsa" in the src folder inside my project, and I didn't do anything with the test folders (I think that I don't need them since they're just tests), but then there are these files (.ytml) ,(.txt) ,(.py), I have no idea what am I supposed to do with them or where to put them, but I sure I need them because the program isn't working, it's giving me this error Cannot open include file: 'secp256k1.h': No such file or directory Libraries.Also I have done everything in the requirements section, my compiler supports C++11, and I have installed openssl, and I have CMake installed.This is my first time using anything from Github so I'm sure what to do.
In Visual Studio, right-click on your project in the Solution Explorer pane. From the menu that pops up, choose the 'Properties' item. It is usually at the very bottom. A dialog box will appear.
In the left pane of the dialog box, expand the options Configuration Properties > C++ > General. Now, in the right pane of the dialog box, probably at or near the top will be an item labeled 'Additional Include Directories`. Add the full path to the folder where you copied the source files from GitHub.
You may need to explicitly add ALL the files you downloaded from GitHub into your Visual Studio project.
Try compiling again.

How to specify an application icon for C++ Visual Studio 2019?

I've seen this documentation for C#/Visual Basic application icons, but there is nothing I can find for how to do this with the C++ version.
This StackOverflow question is for Visual Studio 2008, not 2019. This one is also obsolete, as it works for Visual Studio 2017 but not Visual Studio 2019.
After some fiddling I figured it out. This answer for VS2017 was basically correct, but it didn't fully explain what you have to do to get it to work and the documentation it links to was vague enough to confuse me, so I'll post this answer as the VS2019 version with full and complete easy-to-follow instructions.
Navigate to your Solution Explorer tab.
Find the Resource Files folder in your project, probably near your Header Files and Source Files folders.
Right-click on the Resource Files folder and select "Add > Resource."
In the "Add Resource" window that pops up, select Icon and select Import.
Import either a bitmap file or your custom .ico file.
Now a Resource File (.rc) is created which contains your application Icon, in the form of an Icon node. Click on that .rc file to open the Resource View tab.
You'll see that there's a folder called Icon. It should contain your new icon.
If it contains a default Icon file, probably named IDI_ICON1, you'll have to edit that node to make it the icon you want to use. I don't know why it does that.

Visual Studio 2017 enterprise can not add reference

When I want to add a reference in a project in Visual Studio 2017 Enterprise. I get the following error:
"The operation could not be completed"
I have tried cleaning and rebuilding solution, restart computer, delete bin and obj folder and all .suo files. Also there is no error in my Web.config file.
So I got help from microsoft support.
Open Visual Studio Command Prompt as administrator
Goto the path of your visual studio installation, standard is: C:\Program Files (x86)\Microsoft Visual Studio\2017\
Select your installation type and goto \Common7\IDE\PublicAssemblies
Run command: gacutil -if Microsoft.VisualStudio.Shell.Interop.8.0.dll
Run command gacutil -if Microsoft.VisualStudio.Shell.Interop.11.0.dll
This fixed it for me
I have tried the below steps and it worked for me.
Select the project in which you want to add the reference, then right click on it, Unload the project.
Again go to the same project, right click and then you can see the option of Edit the project. Click on it and for reference click on this link-
Project_Name.csproj file(C#)
Now manually include the namespaces or any project reference present in the same solution which you want to use in the current project. For reference, click on this link- Add the references:See Highlighted
In order to create the Project UID(Unique ID)- {1140F306-2341-4D3D-BEC7-9CCA3C2AC00E},
Go to Tools -- Create GUID -- Select GUID Format i.e. Registry Format and then click on copy and then paste it into your .csproj file. For reference click on this link-
GUID Tool
Then save the .csproj file and then right click on the project in which you have done changes and Reload the project.
After following the above steps, right click on the references and you can see the namespace or project reference which you have given in .csproj file
I hope, the above solution will work for others as well.

error LNK1181: cannot open input file 'kernel32.lib'

I have a project on VS 2012. latest SDK is installed on the WIN 8 x64 computer, the project is targeting WIn32.
I have a clean build in Debug, but when I go to release I get the 1181 LNK error - cannot open input file kernel32.lib.
I have the file on the computer in several location, and in the VC directories there is $(WindowsSdkDir_71A)lib and $(WindowsSdkDir)\lib.
Using process monitor I've tried to rebuild and see where devenv.exe is looking for the file
** UPDATE:
In debug it looks in the right place.
in release it doesn't look for the sdk,
but I see this:
Y:\MyProjectFofler\$(LibraryPath)\kernel32.lib PATH NOT FOUND
and also several successful reads from the win8.0 sdk (which should be ok, but the result is the same, and I need it to read from the V7.1A SDK folder...)
What can it be and what might be the solution for this error ?
Thanks.
I ran into this using Visual Studio 2017. I was trying to get the Visual Studio project configurations to reference the external library .lib files I wanted. I managed to trigger this error when I removed any reference to the system libraries. I later figured out this can be corrected by including one of their macro values (though you can specify an absolute direct path, but that's probably not the best coding convention and prone to brittleness).
On the Visual Studio project, right-Clicking on the project item in the Solution explorer panel (not the Solution itself, which is the topmost item), then select Properties. From there do the following:
VC++ Directories --> Library Directories : $(ProjectDir)lib; $(LibraryPath)
Note the $(LibraryPath) value will include extra values such as inherited from parents, and from what I can tell this is a verbose option. My folder project contained a folder called 'lib' which is why I had the first value there before the semicolon.
There are other common options I have used to specify the Library Directories value:
$(VC_LibraryPath_x86)
$(WindowsSDK_LibraryPath_x86)
$(NETFXKitsDir)Lib\um\x86
If you look at the section VC++ Directories --> Library Directories, you can click on the entry line and select 'Edit', then you can watch live previews of what Macros values will be evaluated and resolved to. If you need additional or more specialized values, click on the Macros button to look for more options.
Link to image of Visual Studio 2017 Library Directories configuration

How to get ready a C++ project with OpenGL, Glut and Visual Studio 2008 in Windows 7

As I had many problems setting Visual Studio 2008 for using OpenGL I will ask this question that can be useful to some people:
Which are the steps to follow in order to use OpenGL with C++ in Visual Studio 2008?
First of all you need to have a video card and check that it works with OpenGL and the drivers are updated. I used the test in this link to check it.
It is also important to check that Visual Studio 2008 is correctly installed and that the following path is created in your computer:
C:\Program Files\Microsoft SDKs\Windows\v6.0A
Now we can follow the installation steps:
1.- Download GLUT from https://www.opengl.org/resources/libraries/glut/glut_downloads.php, unzip and copy the files as instructed below:
glut.h to the folder C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\gl\
glut32.lib to the folder C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib\
glut32.dll to the folder C:\Windows\System32\
2.- Create an empty C++ Win32 application:
From File menu select New → Project (Ctrl+Shift+N).
Select Win32 Project, enter a Name, and click OK.
In the Wizard click Next, then check the box next to Empty Project,
and click Finish.
3.- Add a new C++ source file:
Under the Project menu select Add New Item (Ctrl+Shift+A).
Select C++ File (.cpp), enter a Name, and click OK.
4.- Link to the OpenGL libraries (important step):
Under the Project menu select Project Properties (Alt+F7) at the bottom.
Select Configuration Properties → Linker → Input from the navigation panel on the left.
Select All Configurations from the Configuration drop-down box at the top of the dialog. This ensures you are changing the settings for both the Debug and Release configurations.
Type “opengl32.lib glu32.lib glut32.lib” in Additional Dependencies and click OK (the opengl32.lib and glu32.lib are already in the system, and glut32.lib will be after downloading GLUT).
5.- Download this sample code.
6.- It is also necessary to set the paths in Visual Studio:
In Tools -> Options -> VC++ Directories -> Include Files:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
In Configuration Properties → Linker → Additional Library
Directories:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib
MSDN has a section on OpenGL that should help out, including sample code.