超级圣经第六版sb6_d32.Lib未找到

SuperBible 6th edition sb6_d32.lib not found?

本文关键字:d32 sb6 Lib 六版      更新时间:2023-10-16

我正在使用superbible第6版学习OpenGL,同时编译此代码:

#include <iostream>
#include "sb6.h"
class my_application : public sb6::application
{
public:
    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); 

我得到一个链接错误说不能打开sb6_d32.lib
我搜索了整个sb6目录,没有sb6_d32。Lib文件可用来打开,以便我可以链接它?我错过什么了吗?

编辑:2个未解决的外部

Severity    Code    Description Project File    Line    Suppression State
Error   LNK2019 unresolved external symbol _main referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ)   OpenGL_learning E:C++LearningOpenGLOpenGL_learningOpenGL_learningMSVCRTD.lib(exe_main.obj)    1   
Severity    Code    Description Project File    Line    Suppression State
Error   LNK2019 unresolved external symbol __imp____iob_func referenced in function __glfwPlatformOpenWindow    OpenGL_learning E:C++LearningOpenGLOpenGL_learningOpenGL_learningGLFW_d32.lib(win32_window.obj)   1   

您必须首先构建它。参见示例文件夹root中的HOWTOBUILD.txt文件:

Windows/Microsoft Visual Studio 2010:

项目文件包含在Visual Studio的源存档中2010. 这些将适用于专业(所有级别)和快速版本。新版本的Visual Studio 应该直接导入它们很好,但这还没有经过广泛的测试。只需打开sb6。sln文件在Visual Studio中点击build (F7)。一切都会建立起来,你会以在'bin'目录下的二进制文件结束。

更新:未解析的外部。

LNK2019中未解析的外部符号_main函数int __cdecl invoke_main(void)(? invoke_main@@YAHXZ)

让我们看看DECLARE_MAIN宏在sb6.h中的实现:

#if defined _WIN32
#define DECLARE_MAIN(a)                             
sb6::application *app = 0;                          
int CALLBACK WinMain(HINSTANCE hInstance,           
                     HINSTANCE hPrevInstance,       
                     LPSTR lpCmdLine,               
                     int nCmdShow)                  
{                                                   
    a *app = new a;                                 
    app->run(app);                                  
    delete app;                                     
    return 0;                                       
}

如果您想使用这个宏,您的程序应该被编译为windows应用程序(/SYBSYSTEM:WINDOWS),您正在创建不支持的控制台应用程序。更改项目设置中的子系统(链接器/系统)。

LNK2019无法解析的外部符号__imp____iob_func函数__glfwPlatformOpenWindow

查看解决这个问题的方法。总之,你必须在你的Visual Studio版本中重新编译所有使用过的静态库。

相关文章:
  • 没有找到相关文章