我正在尝试让一个在CLion上工作的OpenGl项目。我使用了3个不同的库: GLEW,GLFW和SOIL。
includes似乎工作得很好,所有的get都被找到了,但每次我尝试构建时都会遇到错误:
undefined reference to `glfwInit'
undefined reference to `glfwWindowHint'
undefined reference to `glfwWindowHint'
undefined reference to `glfwWindowHint'
undefined reference to `glfwWi
我正在我的Ubuntu (13.10)机器上构建Box2d v2.3.1。这就是我要做的:
$ premake4 gmake
$ cd Build/gmake/
$ make
但实验台的建造并不正确。对于glfw和glew符号,我得到了许多未定义的引用错误,如下所示:
obj/Debug/Testbed/Main.o: In function `main':
/home/mostafa/.adobe/box2d-2.3.1/Box2D/Build/gmake/../../Testbed/Framework/Main.cpp:458: undefined reference to `gl
当我尝试构建并运行我的OpenGL+GLEW+GLFW程序时,它构建得很好,但是不能运行,并给出了这个错误:"The program can't start because glew32.dll is missing from your computer. Try reinstalling the program to fix this problem."
我将glew32.lib链接为静态库。我也在使用#define GLEW_STATIC。
那么,为什么程序提示输入DLL文件呢?
#include <iostream>
//#define GLEW_S
这可能是重复的,但我看到的所有问题的答案都没有充分回答我的问题,所以我无论如何都在发帖。
我的代码就是这样。非常基本。从另一个网站复制和粘贴。
#include <GL/glew.h> // include GLEW and new version of GL on Windows
#include <GLFW/glfw3.h> // GLFW helper library
#include <stdio.h>
int main() {
// start GL context and O/S window using the GLFW helper l
我正在为一个OpenGL应用程序编写一个管理GLEW和GLFW的类。框架需要按照特定的顺序进行初始化。正确的顺序是:
#include <GL/glew.h>
#include <GLFW/glfw3.h>
glfwInit();
GLFWwindow* w = glfwCreateWindow(1280, 720, "main", 0, 0);
glfwMakeContextCurrent(w);
glewInit();
// GL API is now available
我的类在其构造函数中初始化框架:
class Engine
{
st
我试图将glew_mx项目从windows移植到ubuntu,但由于GLEWContext未定义,所以总是会出现错误。
error: ‘GLEWContext’ does not name a type
我知道我并不需要linux上的GLEWContext,但是我必须定义
GLEWContext* glewGetContext();
为了编译我的项目。因此,我创建了一个全局GLEWContext,并在glewGetContext中返回它。
我的window.h代码如下所示:
#pragma once
#define GLEW_MX
#define GLEW_STATIC
#include
最近,我从Windows转到Linux,并试图学习一门最初在Windows上使用Visual讲授的Udemy课程。
在本课程中,我需要使用两个头文件glfw3.h和glfw.h。
我可以导入glfw3.h并很好地使用它,但是glw.h函数显示了一些错误。
我使用了代码sudo apt-dev来获取库文件。但还是会出现错误。
代码:
#include <GLFW/glfw3.h>
#include <GL/glew.h>
int main(void)
{}
错误消息:
In file included from Lesson01.cpp: