于是我从opengl红皮书下载了这个rar:http ://www.opengl-redbook.com/Code/oglpg-8th-edition.zip
我所做的是:
- 打开一个新的空项目
- 浏览到项目属性 -> 配置属性 -> VC++ 目录
- 从下载的 Winrar 添加 lib 和 include 文件夹。
这就是我所做的一切,当我运行项目时,我得到了很多错误:\
我做错了什么,我应该怎么做才能让它对我有用?
编辑:这些是我得到的错误:
Warning 7 warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library C:\Users\Naor\documents\visual studio 2012\Projects\RedBook\RedBook\LINK RedBook
Warning 1 warning C4305: 'initializing' : truncation from 'double' to 'GLfloat' c:\users\naor\documents\visual studio 2012\projects\redbook\redbook\source.cpp 25 1 RedBook
Warning 2 warning C4305: 'initializing' : truncation from 'double' to 'GLfloat' c:\users\naor\documents\visual studio 2012\projects\redbook\redbook\source.cpp 26 1 RedBook
Warning 3 warning C4305: 'initializing' : truncation from 'double' to 'GLfloat' c:\users\naor\documents\visual studio 2012\projects\redbook\redbook\source.cpp 27 1 RedBook
Warning 4 warning C4305: 'initializing' : truncation from 'double' to 'GLfloat' c:\users\naor\documents\visual studio 2012\projects\redbook\redbook\source.cpp 28 1 RedBook
Warning 5 warning C4305: 'initializing' : truncation from 'double' to 'GLfloat' c:\users\naor\documents\visual studio 2012\projects\redbook\redbook\source.cpp 29 1 RedBook
Warning 6 warning C4305: 'initializing' : truncation from 'double' to 'GLfloat' c:\users\naor\documents\visual studio 2012\projects\redbook\redbook\source.cpp 30 1 RedBook
Error 8 error LNK2019: unresolved external symbol _LoadShaders referenced in function "void __cdecl init(void)" (?init@@YAXXZ) C:\Users\Naor\documents\visual studio 2012\Projects\RedBook\RedBook\Source.obj RedBook
Error 9 error LNK1120: 1 unresolved externals C:\Users\Naor\documents\visual studio 2012\Projects\RedBook\Debug\RedBook.exe 1 1 RedBook
这就是代码: http: //pastebin.com/X55tVP3d