0

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>
BDL
  • 21,052
  • 22
  • 49
  • 55
  • I worked over your question, please make sure not to confuse glm (which I think you are using) with gml (which is something completely different). – BDL Oct 25 '15 at 01:24
  • Possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – BDL Oct 25 '15 at 01:30

1 Answers1

1

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).

BDL
  • 21,052
  • 22
  • 49
  • 55
  • thanks for answering, yes the error occurs in compilation time, and yes i tried that, including glm.lib in the additional dependencies but then other error appears, there is no glm.lib in the glm package i downloaded – user2782121 Oct 25 '15 at 16:16