我正在做Etay Meiri的OGL教程,我尝试将GLFX库包含在我的项目中。我从GLFX站点下载了bin包,添加了glfx.h的路径以包含dirs,并添加了二进制文件夹(包括glfx.dll,glfx.obj文件)。然后我使用这个类:
#pragma once
#include <gl/glew.h>
class Technique
{
public:
Technique(const char* pEffectFile);
~Technique();
void Enable();
void Disable();
protected:
bool CompileProgram(const char* pProgram);
GLint GetUniformLocation(const char* pszUniformName);
private:
GLint mEffect;
GLint mShaderProg;
const char* mEffectFile;
};
这是skill.cpp的第一个20-30行(我不会放弃全班):
#include <stdio.h>
#include <string>
#include <Windows.h>
#include <glfx/glfx.h>
#include "Technique.h"
Technique::Technique(const char* pEffectFile)
{
mShaderProg = 0;
mEffectFile = pEffectFile;
mEffect = glfxGenEffect();
}
Technique::~Technique()
{
if (mShaderProg != 0)
{
glDeleteProgram(mShaderProg);
mShaderProg = 0;
}
glfxDeleteEffect(mEffect);
}
这给了我错误:
1>Technique.obj : error LNK2019: unresolved external symbol _glfxGenEffect referenced in function "public: __thiscall Technique::Technique(char const *)" (??0Technique@@QAE@PBD@Z)
1>Technique.obj : error LNK2019: unresolved external symbol _glfxParseEffectFromFile referenced in function "protected: bool __thiscall Technique::CompileProgram(char const *)" (?CompileProgram@Technique@@IAE_NPBD@Z)
1>Technique.obj : error LNK2019: unresolved external symbol _glfxCompileProgram referenced in function "protected: bool __thiscall Technique::CompileProgram(char const *)" (?CompileProgram@Technique@@IAE_NPBD@Z)
1>Technique.obj : error LNK2019: unresolved external symbol _glfxDeleteEffect referenced in function "public: __thiscall Technique::~Technique(void)" (??1Technique@@QAE@XZ)
1>Technique.obj : error LNK2019: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl glfxGetEffectLog(int)" (?glfxGetEffectLog@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z) referenced in function "protected: bool __thiscall Technique::CompileProgram(char const *)" (?CompileProgram@Technique@@IAE_NPBD@Z)