error with samples

sajjad
2012-11-07
2013-06-03
  • sajjad
    sajjad
    2012-11-07

    Hi

    I have downloaded a sample application from your website and it is giving me tons of errors. The Makefile for the program is as follows:

    CC = g++
    CFLAGS = -O2 -g
    INCLUDE = -I/usr/local/include
    LDFLAGS = -lglut -lGL -lGLU -L/usr/local/lib -lassimp

    COBJS=$(patsubst %.cpp,%.o,$(wildcard *.cpp))

    EXE= simpleOpenGL

    all: $(COBJS)
    $(CC) $(CFLAGS) -o$(EXE) $(COBJS) $(LDFLAGS)

    %.o : %.cpp
    $(CC) $(CFLAGS) -o $@ -c $< $(INCLUDE)

    clean:
    rm -f $(EXE) *.o *~

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////7

    The error output is way too long

    /////////////////////////////////////////////////////////////////////////////7

    g++ -O2 -g -o Sample_SimpleOpenGL.o -c Sample_SimpleOpenGL.cpp -I/usr/local/include
    Sample_SimpleOpenGL.cpp:25:8: error: using typedef-name ‘aiVector3D’ after ‘struct’
    /usr/local/include/assimp/vector3.h:124:27: error: ‘aiVector3D’ has a previous declaration here
    Sample_SimpleOpenGL.cpp:25:28: error: invalid type in declaration before ‘,’ token
    Sample_SimpleOpenGL.cpp:47:9: error: using typedef-name ‘aiVector3D’ after ‘struct’
    /usr/local/include/assimp/vector3.h:124:27: error: ‘aiVector3D’ has a previous declaration here
    Sample_SimpleOpenGL.cpp:48:9: error: using typedef-name ‘aiVector3D’ after ‘struct’
    /usr/local/include/assimp/vector3.h:124:27: error: ‘aiVector3D’ has a previous declaration here
    Sample_SimpleOpenGL.cpp:49:9: error: using typedef-name ‘aiMatrix4x4’ after ‘struct’
    /usr/local/include/assimp/matrix4x4.h:222:29: error: ‘aiMatrix4x4’ has a previous declaration here
    Sample_SimpleOpenGL.cpp: In function ‘void get_bounding_box_for_node(const aiNode*, int*, int*, int*)’:
    Sample_SimpleOpenGL.cpp:51:9: error: using typedef-name ‘aiMatrix4x4’ after ‘struct’
    /usr/local/include/assimp/matrix4x4.h:222:29: error: ‘aiMatrix4x4’ has a previous declaration here
    Sample_SimpleOpenGL.cpp:51:25: error: invalid type in declaration before ‘;’ token
    Sample_SimpleOpenGL.cpp:55:46: error: cannot convert ‘int*’ to ‘aiMatrix4x4* {aka aiMatrix4x4t<float>*}’ for argument ‘1’ to ‘void aiMultiplyMatrix4(aiMatrix4x4*, const aiMatrix4x4*)’
    Sample_SimpleOpenGL.cpp:61:11: error: using typedef-name ‘aiVector3D’ after ‘struct’
    /usr/local/include/assimp/vector3.h:124:27: error: ‘aiVector3D’ has a previous declaration here
    Sample_SimpleOpenGL.cpp:61:26: error: invalid type in declaration before ‘=’ token
    Sample_SimpleOpenGL.cpp:61:45: error: cannot convert ‘aiVector3D {aka aiVector3t<float>}’ to ‘int’ in initialization
    Sample_SimpleOpenGL.cpp:62:38: error: cannot convert ‘int*’ to ‘aiVector3D* {aka aiVector3t<float>*}’ for argument ‘1’ to ‘void aiTransformVecByMatrix4(aiVector3D*, const aiMatrix4x4*)’
    Sample_SimpleOpenGL.cpp:64:9: error: request for member ‘x’ in ‘* min’, which is of non-class type ‘int’
    Sample_SimpleOpenGL.cpp:64:13: error: request for member ‘x’ in ‘* min’, which is of non-class type ‘int’
    Sample_SimpleOpenGL.cpp:64:13: error: request for member ‘x’ in ‘tmp’, which is of non-class type ‘int’
    Sample_SimpleOpenGL.cpp:64:13: error: request for member ‘x’ in ‘* min’, which is of non-class type ‘int’
    Sample_SimpleOpenGL.cpp:64:13: error: request for member ‘x’ in ‘tmp’, which is of non-class type ‘int’
    Sample_SimpleOpenGL.cpp:65:9: error: request for member ‘y’ in ‘* min’, which is of non-class type ‘int’
    Sample_SimpleOpenGL.cpp:65:13: error: request for member ‘y’ in ‘* min’, which is of non-class type ‘int’
    Sample_SimpleOpenGL.cpp:65:13: error: request for member ‘y’ in ‘tmp’, which is of non-class type ‘int’
    Sample_SimpleOpenGL.cpp:65:13: error: request for member ‘y’ in ‘* min’, which is of non-class type ‘int’
    Sample_SimpleOpenGL.cpp:65:13: error: request for member ‘y’ in ‘tmp’, which is of non-class type ‘int’
    Sample_SimpleOpenGL.cpp:66:9: error: request for member ‘z’ in ‘* min’, which is of non-class type ‘int’
    Sample_SimpleOpenGL.cpp:66:13: error: request for member ‘z’ in ‘* min’, which is of non-class type ‘int’
    Sample_SimpleOpenGL.cpp:66:13: error: request for member ‘z’ in ‘tmp’, which is of non-class type ‘int’
    Sample_SimpleOpenGL.cpp:66:13: error: request for member ‘z’ in ‘* min’, which is of non-class type ‘int’
    …………………………………………..

    //////////////////////////////////////////////////////////////////////////////

    Only a part of it pasted here.

    Looking forward to your help

    Regards
    Sajjad

     
  • What code do you compile?

     
  • Kim Kulling
    Kim Kulling
    2012-11-07

    Hi

    I looked into the makefile and it seems so that this is out-of-date. But you can use our CMake-build instead to generate you unix-like makefile. Just install cmake, goto the root directory of the assimp-repo and call:

    cmake CMakeLists.txt
    

    If you are working under Linux the cmake-environment will generate the makefile for you.

    I will also add a bug report for the broken makefile.

    Kimmi

     
  • Kim Kulling
    Kim Kulling
    2012-11-07

    See artefact  3585109.

    Kimmi

     
  • sajjad
    sajjad
    2013-02-02

    Hi

    I am back after quite a while after long pause. i am still a failure with the library. I downloaded the sample from the website "Sample_SimpleOpenGL.cpp" and tried to use cmake to generate the makefile. I got the following error while trying to generate it

    CMake Error at CMakeLists.txt:37 (INSTALL):
       install TARGETS given no RUNTIME DESTINATION for executable target
       "assimp_simpleogl".
     CMake Warning (dev) in CMakeLists.txt:
       No cmake_minimum_required command is present.  A line of code such as
         cmake_minimum_required(VERSION 2.8)
       should be added at the top of the file.  The version specified may be lower
       if you wish to support older CMake versions for this project.  For more
       information run "cmake --help-policy CMP0000".
     This warning is for project developers.  Use -Wno-dev to suppress it.
    

    Any idea folks to get rid of it?

    Regards
    Sajjad