0

I've set the linker to additional dependencies opengl32.lib;glu32.lib;sfml-main-d.lib;

When I run it, I get loads of errors about APIEntry or something in one of the OpenGL files. SFML is also set up fine.

Here is my code:

#include <iostream>
//#include <Windows.h>
#include <gl/gl.h>
#include <gl/glu.h>

using namespace std;

void main()
{

}

It works fine if I include Windows.h, but I really don't want to make it windows-specific (Since the only reason I switched to C++ from C# is for cross platform and I'm not too fussed on Java)

Image of my errors

4

2 回答 2

4

如果你打算使用 OpenGL,那么你应该使用适当的OpenGL 加载库来获取你的函数指针。这些库的标头将包含使标头工作所需的任何特定于平台的内容,使用适当的#defines 等等。

于 2012-04-21T21:22:36.983 回答
2

如果您刚开始,您可能对设置自己的 OpenGL 上下文等较低级别的东西不感兴趣。我建议您在http://www.glfw.org/上查看 GLFW - 这是我更喜欢 OpenGL 的内容。它是适用于 Windows、linux 和 MAC 的开源和跨平台的。

祝你好运!

于 2012-04-21T21:24:50.757 回答