我正在按照
我正在使用Visual Studio 2013。我已经追踪了链接器抱怨的其中一个函数(即
HOWTOBUILD.txt
的步骤进行操作。我已经构建好了glfw所需的文件。第一次,连接器报错了glfw。经过搜索,我发现需要链接到gl3w
,可以参考这个链接。我已经生成了gl3w
的静态库。现在,我打开了一个新项目并将路径包含在include
中,如下图。
对于连接器,我已经链接到了glfw3dll.lib gl3w.lib opengl32.lib
并包含了它们的路径。如果我运行第一章的示例,
main.cpp
#include "sb7.h"
class my_application : public sb7::application
{
void render(double currentTime)
{
static const GLfloat red[] = { 1.0f, 0.0f, 0.0f, 1.0f };
glClearBufferfv(GL_COLOR, 0, red);
}
};
DECLARE_MAIN(my_application);
我遇到了链接器错误。
1>main.obj : error LNK2019: unresolved external symbol "int __cdecl sb6IsExtensionSupported(char const *)" (?sb6IsExtensionSupported@@YAHPBD@Z) referenced in function "public: virtual void __thiscall sb7::application::run(class sb7::application *)" (?run@application@sb7@@UAEXPAV12@@Z)
1>main.obj : error LNK2019: unresolved external symbol "private: static void __stdcall sb7::application::debug_callback(unsigned int,unsigned int,unsigned int,unsigned int,int,char const *,void *)" (?debug_callback@application@sb7@@CGXIIIIHPBDPAX@Z) referenced in function "public: virtual void __thiscall sb7::application::run(class sb7::application *)" (?run@application@sb7@@UAEXPAV12@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: static class sb7::application * sb7::application::app" (?app@application@sb7@@1PAV12@A)
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
我正在使用Visual Studio 2013。我已经追踪了链接器抱怨的其中一个函数(即
sb6IsExtensionSupported()
)。下面的图片展示了这个函数在sb7.h
中的调用方式,而它的实际实现是在sb7.cpp
中完成的。
这样做正确吗?