Results 1 to 7 of 7

Thread: Compiler error

  1. #1
    Junior Member
    Join Date
    Apr 2008
    Posts
    17

    Compiler error

    Hello, i'm using collada_dom 1.4.1, including this files in my application

    Code :
    #include <dae.h>
    #include <dom/domCOLLADA.h>
    #include <dom/domConstants.h>

    When i try to use this code

    Code :
    		domProfile_COMMON *eff;
    		collada_dom->getDatabase()->getElement((daeElement**)&eff,0,0,COLLADA_TYPE_PROFILE_COMMON,0);
    		{		
    			domAmbientRef Amb = eff->getTechnique()->getBlinn()->getAmbient();
    			Amb->getColor()->getValue().get3at(0,this->ColladaBuffer.Mats.Ambient.r,this->ColladaBuffer.Mats.Ambient.g,this->ColladaBuffer.Mats.Ambient.b);
    			this->ColladaBuffer.Mats.Ambient.a = Amb->getColor()->getValue()->get(3);
    		}

    I receive a lot of errors:
    Error 22 error C2027: use of undefined type 'domProfile_COMMON' c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 448
    Error 21 error C2065: 'Amb' : undeclared identifier c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 448
    Error 26 error C2065: 'Amb' : undeclared identifier c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 449
    Error 30 error C2065: 'Amb' : undeclared identifier c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 450
    Error 19 error C2065: 'domAmbientRef' : undeclared identifier c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 448
    Error 20 error C2146: syntax error : missing ';' before identifier 'Amb' c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 448
    Error 33 error C2227: left of '->get' must point to class/struct/union/generic type c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 450
    Error 25 error C2227: left of '->getAmbient' must point to class/struct/union/generic type c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 448
    Error 24 error C2227: left of '->getBlinn' must point to class/struct/union/generic type c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 448
    Error 27 error C2227: left of '->getColor' must point to class/struct/union/generic type c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 449
    Error 31 error C2227: left of '->getColor' must point to class/struct/union/generic type c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 450
    Error 23 error C2227: left of '->getTechnique' must point to class/struct/union/generic type c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 448
    Error 28 error C2227: left of '->getValue' must point to class/struct/union/generic type c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 449
    Error 32 error C2227: left of '->getValue' must point to class/struct/union/generic type c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 450
    Error 29 error C2228: left of '.get3at' must have class/struct/union c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 449
    All seems to start from domprofile_COMMON, but i do not know how to proceed...
    Can you help mep please?

  2. #2
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    In C if it says you have an undefined type it usually means you're missing a #include. In your case you want #include <dom/domProfile_COMMON.h>.

  3. #3
    Junior Member
    Join Date
    Apr 2008
    Posts
    17
    Oh...then the file is not included automatically in domCOLLADA.h?

  4. #4
    Junior Member
    Join Date
    Apr 2008
    Posts
    17
    I've got another problem
    I've included the file, now the part works, but now i've got other problems:


    Code :
    			domAmbientRef Amb = eff->getTechnique()->getBlinn()->getAmbient();
    			Amb->getColor()->getValue().get3at(0,this->ColladaBuffer.Mats.Ambient.r,this->ColladaBuffer.Mats.Ambient.g,this->ColladaBuffer.Mats.Ambient.b);
    			this->ColladaBuffer.Mats.Ambient.a = Amb->getColor()->getValue()->get(3);

    I receive this error
    Error 26 error C2228: left of '.get3at' must have class/struct/union c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 459
    Error 25 error C2227: left of '->getValue' must point to class/struct/union/generic type c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 459
    Error 29 error C2227: left of '->getValue' must point to class/struct/union/generic type c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 460
    Error 24 error C2227: left of '->getColor' must point to class/struct/union/generic type c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 459
    Error 28 error C2227: left of '->getColor' must point to class/struct/union/generic type c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 460
    Error 30 error C2227: left of '->get' must point to class/struct/union/generic type c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 460
    Error 21 error C2146: syntax error : missing ';' before identifier 'Amb' c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 457
    Error 20 error C2065: 'domAmbientRef' : undeclared identifier c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 457
    Error 22 error C2065: 'Amb' : undeclared identifier c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 457
    Error 23 error C2065: 'Amb' : undeclared identifier c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 459
    Error 27 error C2065: 'Amb' : undeclared identifier c:\users\vincenzo\documents\visual studio 2008\projects\colladameshloading\colladameshloadin g\loadmesh.h 460
    I've also included domlight.h

  5. #5
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    domAmbientRef is a nested class in domTechnique_common, which is a nested class in domLight. So it would be

    domLight::domTechnique_common::domAmbientRef Amb = ...

    You could shorten it with a typedef:

    typedef domLight::domTechnique_common::domAmbientRef domAmb;
    domAmb amb = ...

    Steve

  6. #6
    Junior Member
    Join Date
    Apr 2008
    Posts
    17
    Thank you it works, but now i've got another problem.

    Code :
    domLight::domTechnique_common::domAmbientRef Amb = eff->getTechnique()->getBlinn()->getAmbient();

    This gives me a compiler error:
    Error 24 error C2440: 'initializing' : cannot convert from 'domCommon_color_or_texture_type *' to 'domLight::domTechnique_common::domAmbient *' c:\users\vincenzo\documents\visual studio 2008\projects\colladadom\include\dae\daesmartref.h 44
    I tried also daesafecast but it does not works. Is this the right way to get the material floats value?

  7. #7
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    You need to be willing to open up header files and look at the function declarations if you're going to make any progress. domBlinn::getAmbient returns a domFx_common_color_or_texture_type object, which has a getColor method. getBlinn()->getAmbient()->getColor().

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •