I created a project using freeglut and glew and am trying to statically link them. Currently, when I create a project, I get exe and two dlls (freeglut32.dll and glew32.dll). I would like to make it so that I get only exe.
To install the libraries, I used NuGet. (Install-Package freeglut) and (Install-Package glew). NuGet loads glew.lib into. \ Packages \ glew.1.9.0.1 \ build \ native \ lib \ v110 \ x64 \ Release \ static \ glew.lib and freeglut to. \ Packages \ freeglut.2.8.1.15 \ build \ native \ Lib \ v110 \ x64 \ Release \ static \ freeglut.lib. I assume that they are .lib files that I need because they have more than 1 MB.
In Visual Studio, I went to Linker -> Input -> Additional Dependencies and added the paths freeglut.lib and glew.lib. I also added #define GLEW_STATIC, and #define FREEGLUT_STATICin your code. Link library dependencies included.
Even still, building the project gives me my 654 KB exe along with 224 kb freeglut.dll and 356 kb glew32.dll. How can I make sure that glew32.dll and freeglut.dll do not exist and that I am only assigned a single executable?
Edit: Thanks to the suggestions: I went to Properties โ Related Packages and installed freeglut and glew in Static.
source
share