Lnk2019

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • audai ibrahim
    New Member
    • Nov 2011
    • 1

    Lnk2019

    I have a code like this


    // Car.cpp : Defines the entry point for the console application.
    //
    #include "stdafx.h"
    #include <stdio.h>
    #include <iostream>
    #include <fstream>
    #include <math.h>
    #include <GL/glut.h>

    #include "glm.h"


    using namespace std;


    GLMmodel* pmodel1 = NULL;

    void draw(){
    if (!pmodel1) {
    //pmodel1 = glmReadOBJ("gla ss.obj");
    if (!pmodel1) exit(0);
    // glmFacetNormals (pmodel1);
    //glmVertexNormal s(pmodel1, 90.0);
    }
    glmDraw(pmodel1 , GLM_SMOOTH| GLM_TEXTURE);

    }

    void init(void)
    {
    glClearColor (0.0, 0.0, 0.0, 0.0);
    glEnable(GL_DEP TH_TEST);
    glShadeModel (GL_SMOOTH);
    }

    void changeSize(int w, int h) {
    if(h == 0) h = 1;
    float ratio = 1.0* w / h;

    glMatrixMode(GL _PROJECTION);
    glLoadIdentity( );
    glViewport(0, 0, w, h);
    gluPerspective( 25, ratio, 1, 1000);
    glMatrixMode(GL _MODELVIEW);
    }

    void renderScene(){


    }

    void keyboard(unsign ed char key, int x, int y){

    }


    int main(int argc, char *argv[])
    {
    glutInit(&argc, argv);
    glutInitDisplay Mode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
    glutInitWindowP osition(100,100 );
    glutInitWindowS ize(800,600);
    glutCreateWindo w("Oday&Khade r project");
    init ();

    glutDisplayFunc (renderScene);
    glutKeyboardFun c(keyboard);
    glutIdleFunc(re nderScene);
    glutReshapeFunc (changeSize);

    glutMainLoop();
    return 0;
    }



    i used to train my self about using glm libary
    but the code give me an error and i try many ways to correct without any benefit.

    Error 1 error LNK2019: unresolved external symbol "void __cdecl glmDraw(struct _GLMmodel *,unsigned int)" (?glmDraw@@YAXP AU_GLMmodel@@I@ Z) referenced in function "void __cdecl draw(void)" (?draw@@YAXXZ) Car.obj Car


    I use visual studio 2008 and i insert glm.h and glm.cpp in the file's project.

    please, help me if any one can
    and thanks in advance
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    add the concerned library file too.

    Comment

    Working...