按照自己的资料进行配置
下面几行只是可以编译出64位版本的glew和glfw和SOIL2的库
$ cd E:\glfw-3.3.2
$ E:\cmake-3.19.1-win64-x64\bin\cmake.exe -S .\ -B .\build
$ cd E:\glew-2.1.0\build\cmake
$ E:\cmake-3.19.1-win64-x64\bin\cmake.exe -S .\ -B .\build
$ cd E:\SOIL2-master
$ .\premake5.exe vs2019
然后用vs分别编译出来x64的版本即可
然后进程常规的vs配置就行了
配置lib的时候需要配置opengl32.lib
这个应该在安装vs的时候就默认装好了直接配上去就可以了
我查找了一下 当前我的opengl32.lib在下面那个位置
猜测在windows下lib的名字应该是不区分大小写的 根据windows创建一个大小写不一样的文件夹他都提示名字重复猜的
猜测在windows下lib的名字应该是不区分大小写的 根据windows创建一个大小写不一样的文件夹他都提示名字重复猜的
注意了注意了 运行的时候要把glew32d.dll放到运行的目录 尽管我们的依赖项写的是glew32d.lib o(╥﹏╥)oo(╥﹏╥)oo(╥﹏╥)o
注意了注意了 运行的时候要把glew32d.dll放到运行的目录 尽管我们的依赖项写的是glew32d.lib o(╥﹏╥)oo(╥﹏╥)oo(╥﹏╥)o
#include <iostream>
#include <GL/glew.h>
#include <GLFW/glfw3.h>
using namespace std;
void init(GLFWwindow* window) {}
void display(GLFWwindow* window, double currentTime)
{
glClearColor(1.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
}
int main(int args, char** argv)
{
if (!glfwInit())
{
exit(EXIT_FAILURE);
}
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
GLFWwindow* window = glfwCreateWindow(600, 600, "HelloWorld", NULL, NULL);
glfwMakeContextCurrent(window);
if (glewInit() != GLEW_OK)
{
exit(EXIT_FAILURE);
}
glfwSwapInterval(1);
init(window);
while (!glfwWindowShouldClose(window))
{
display(window, glfwGetTime());
glfwSwapBuffers(window);
glfwPollEvents();
}
glfwDestroyWindow(window);
glfwTerminate();
exit(EXIT_SUCCESS);
}