OpenGl - 未解析的外部符号__imp____iob_func引用

时间:2016-04-17 05:16:43

标签: c++ opengl linker-errors

编辑: 在我发现sb6标头使用windows子系统后,我将子系统从Console(/ SUBSYSTEM:CONSOLE)更改为Windows(/ SUBSYSTEM:WINDOWS)。

编译此代码时。

// Include the "sb6.h" header file
#include "sb6.h"
// Derive my_application from sb6::application
class my_application : public sb6::application
{
public:
    // Our rendering function
    void render(double currentTime)
    {
        // Simply clear the window with red
        static const GLfloat red[] = { 1.0f, 0.0f, 0.0f, 1.0f };
        glClearBufferfv(GL_COLOR, 0, red);
    }
};
// Our one and only instance of DECLARE_MAIN
DECLARE_MAIN(my_application);

我收到这些错误

LNK2019 unresolved external symbol __imp____iob_func referenced in function __glfwPlatformOpenWindow

LNK4217 locally defined symbol _fprintf imported in function __glfwPlatformOpenWindow

我确实链接了所有库并将文件夹包含到VC ++目录中,并且我在包含所有预处理器的正确子系统中。

1 个答案:

答案 0 :(得分:0)

看起来您正在尝试在Visual Studio 2015中构建项目,并且它的一些依赖项是由以前版本的Visual Studio创建的静态库。在这个版本中,C Runtime被重构了,它的ABI向后兼容性被打破了。

至于你的情况,我怀疑你正在使用OpenGL SuperBible第6版,而第6版则使用由Visual Studio 2010构建的GLFW库。你需要从{{3}下载最新版本的GLFW }。您可以为Visual Studio 2015使用预构建的二进制文件,也可以从其源代码构建它们。