0

Edit: I changed the subsystem from Console (/SUBSYSTEM:CONSOLE) to Windows (/SUBSYSTEM:WINDOWS) after I found out that sb6 header uses windows subsystem.

When I compile this code.

// 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);

I get these errors

LNK2019 unresolved external symbol __imp____iob_func referenced in function __glfwPlatformOpenWindow

LNK4217 locally defined symbol _fprintf imported in function __glfwPlatformOpenWindow

I did link all the libraries and include folders to VC++ Directories and also I am in the correct subsystem with all the preprocessors included.

psrag anvesh
  • 1,257
  • 2
  • 12
  • 18
  • Check this out, maybe it helps: http://stackoverflow.com/questions/30450042/unresolved-external-symbol-imp-iob-func-referenced-in-function-openssldie – Adrian Roman Apr 17 '16 at 06:26

1 Answers1

2

Looks like you are trying to build your project in Visual Studio 2015 and some of its dependencies are static libraries created by a previous version of Visual Studio. C Runtime was refactored significantly in this version, and its ABI backward compatibility was broken.

As for your case, I suspect you are using OpenGL SuperBible 6th edition, which, in turn, uses GLFW libraries built by Visual Studio 2010. You will need to download a recent version of GLFW from here. You can use either prebuilt binaries for Visual Studio 2015 or build them from its sources.

tserg42
  • 322
  • 3
  • 8