user2782121
user2782121

Reputation: 1

How to open a .obj with OpenGL in Visual Studio 2012

I've been trying to open a .obj made in blender in an OpenGL project coded in c using visual studio 2012. I have read a lot of forums and questions asked here on stackoverflow but I still have errors when I try to compile the code.

I've already download GLM, copied the glm folder in my project folder, included the header in the code, added the aditional directories in my project properties, but i still have this error:

probando3d.obj : error LNK2019: símbolo externo _glmDraw sin resolver al que se hace referencia en la función "void __cdecl nave(void)"

probando3d.obj : error LNK2019: símbolo externo _glmReadOBJ sin resolver al que se hace referencia en la función "void __cdecl nave(void)"

It looks like it doesn't recognize the functions of the glm. I don't know if I should add something else in the linker properties.

This is how I load my obj

void nave(){

GLMmodel* model = glmReadOBJ("C:/Users/bagz_/Documents/Visual Studio 2012/Projects/probando3d/probando3d");

 glPushMatrix();


 glmDraw(model, GLM_MATERIAL|GLM_SMOOTH);


 glPopMatrix();

 }

This are the headers included

#include <windows.h>
#include <stdio.h>
#include <stdarg.h>
#include <ctype.h>
#include <math.h>
#include <GL/glut.h>
#include <glm.h>

Upvotes: 0

Views: 669

Answers (1)

BDL
BDL

Reputation: 22168

From you're error messages I guess that this happens during compilation/linking and not when you run the application:

In addition to including the header files into a project, you also have to link against the appropriate library. In Visual Studio this is done in Project Settings -> Linker -> Input -> Additional Dependencies. You have to add there the libraries against which you want to link. In this case it might be something like glm.lib (depending on how you compiled glm).

Upvotes: 1

Related Questions