私は、オープンソースであり、GLUT (OpenGL's Utility Toolkit) の拡張された代替手段である freeGLUT を使用して開発された VS2010 のソリューション (自分のものではない) を使用しています。プログラムは、リリース モードで問題なく exe をコンパイルして実行しますが、デバッグしようとすると、次のエラーが発生します。
エラー 1 エラー LNK2019:関数で参照されている未解決の外部シンボル wmain _ _tmainCRTStartup LIBCMTD.lib(wcrt0.obj) freeglut
エラー 2 エラー LNK1120: 1 つの未解決の外部ファイル freeglut.dll freeglut
READMEファイルのようなlibおよびincludeファイルをすべてダウンロードして参照しました。
Installation
Create a folder on your PC which is readable by all users, for example
“C:\Program Files\Common Files\MSVC\freeglut\” on a typical Windows system. Copy
the “lib\” and “include\” folders from this zip archive to that location.
The appropriate freeglut DLL can either be placed in the same folder as your
application, or can be installed in a system-wide folder which appears in your
%PATH% environment variable. Be careful not to mix the 32 bit DLL up with the 64
bit DLL, as they are not interchangeable.
Compiling 32 bit Applications
To create a 32 bit freeglut application, create a new Win32 C++ project in MSVC.
From the “Win32 Application Wizard”, choose a “Windows application”, check the
“Empty project” box, and submit.
You’ll now need to configure the compiler and linker settings. Open up the
project properties, and select “All Configurations” (this is necessary to ensure
our changes are applied for both debug and release builds). Open up the
“general” section under “C/C++”, and configure the “include\” folder you created
above as an “Additional Include Directory”. If you have more than one GLUT
package which contains a “glut.h” file, it’s important to ensure that the
freeglut include folder appears above all other GLUT include folders.
Now open up the “general” section under “Linker”, and configure the “lib\”
folder you created above as an “Additional Library Directory”.
A freeglut
application depends on the import libraries “freeglut.lib” and “opengl32.lib”,
which can be configured under the “Input” section.
However, it shouldn’t be
necessary to explicitly state these dependencies, since the freeglut headers
handle this for you. Now open the “Advanced” section, and enter “mainCRTStartup”
as the “Entry Point” for your application. This is necessary because GLUT
applications use “main” as the application entry point, not “WinMain”—without it
you’ll get an undefined reference when you try to link your application.
That’s all of your project properties configured, so you can now add source
files to your project and build the application. If you want your application to
be compatible with GLUT, you should “#include <GL/glut.h>”. If you want to use
freeglut specific extensions, you should “#include <GL/freeglut.h>” instead.
Don’t forget to either include the freeglut DLL when distributing applications,
or provide your users with some method of obtaining it if they don’t already
have it!
私が現在持っているリンカ設定のスクリーンショットへのリンクは次のとおりです: http://imgur.com/a/SDwBv