I'm trying to allow the Clang C++ compiler to use OpenGL libraries on Windows 8.1 but can't get it to work. I created a test file that simply includes the library but does nothing else:
#include <windows.h>
#include <GL/glew.h>
The result from Clang is:
LINK : fatal error LNK1561: entry point must be defined
clang.exe: error: linker command failed with exit code 1561 (use -v to see invoc
ation)
I was first trying to use FreeGlut but then I found this thread
http://www.cplusplus.com/forum/beginner/152942/ that said to use Glew. I downloaded Glew and copied the following files:
bin/glew32.dll to C:/windows/system32
lib/glew32.lib to D:/Programs/LLVM/lib/clang/4.0.0/lib/windows
include/GL/glew.h to D:/Programs/LLVM/lib/clang/4.0.0/include/GL
include/GL/wglew.h to D:/Programs/LLVM/lib/clang/4.0.0/include/GL
The instructions for Glew say to copy these files
http://glew.sourceforge.net/install.html . Trying Glew still didn't fix the problem. Wikipedia says Glew is meant to help query and load OpenGL extensions so I'm not sure if it what I want anyway.
A problem I had with FreeGlut is the instructions are based on Microsoft Visual Studio. After using CMake the file freeglut.sln is created but it opens with Visual Studio and my 30 day trial period has long expired. A lot of instructions I find for using FreeGlut on Windows with Google searches are based on Microsoft Visual Studio. Is it even possible to get OpenGL to work for any compiler on Windows other than Microsoft Visual Studio?
I read about libraries needing to be linked before being used but when I searched specifically how to do that, I got a forum post where someone asked that question
https://stackoverflow.com/questions/9516134/how-to-link-opengl-libraries-to-project-in-netbeans-7-1 and the response was to copy .h files into the include/GL directory, which is what I did with the FreeGlut header files.
Before I tried to get OpenGL to work with C++ I tried both Java and Python but couldn't get it to work for those langauges either. The problem with Python seemed to be that the OpenGLContext library has not been updated for Python3. Someone mentioned trying to use 2to3 converters but still couldn't get it to work.