【发布时间】:2016-08-15 02:01:26
【问题描述】:
我正在尝试为 GLFW 编写 C++/CLI 包装器。我创建了一个名为 GLFWWrapper 的 CLR 类库项目,并将 glfw3.lib 添加到 Additional Dependencies,并将头文件文件夹添加到 Additional Include Directories。
到目前为止,我的 GLFWWrapper.h 看起来像这样:
// GLFWWrapper.h
#pragma once
#include <GLFW\glfw3.h>
using namespace System;
namespace GLFWWrapper {
public ref class Window
{
public:
Window(int width, int height, char * title);
private:
GLFWwindow * m_ptr;
};
}
我的 GLFWWrapper.cpp 看起来像这样:
// This is the main DLL file.
#include "stdafx.h"
#include "GLFWWrapper.h"
namespace GLFWWrapper {
Window::Window(int width, int height, char * title) {
if (glfwInit() != GL_TRUE) {
}
else {
m_ptr = glfwCreateWindow(width, height, title, nullptr, nullptr);
}
}
}
现在当我尝试编译它时,我收到以下警告:
GLFWWrapper.obj:警告 LNK4248:'GLFWwindow' 的未解析 typeref 令牌 (01000008);图像可能无法运行
GLFWWrapper.obj:警告 LNK4248:“GLFWmonitor”的未解析类型引用令牌(0100000B);图像可能无法运行
它们在我的上下文中是什么意思,这可能有问题吗?
【问题讨论】: