Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Problems using collada in Visual Studio 2005

Help
gerardo
2008-05-19
2013-05-01
  • gerardo
    gerardo
    2008-05-19

    Hi

    I download the version 2.1 of collada and compile in visual studio 2005 professinal edition, then I tried to execute the follow example in Release Mode and Linking with the COLLADA DOM DLL

    #include <dae.h>

    int main() {
        DAE dae;
        dae.add("simple.dae");
        dae.writeAll();
        return 0;
    }

    but I get the following error when I run the program

    I/O error : No such file or directory
    error : xmlNewTextWriterFilename : out of memory !
    Error : daeLIBXMLPlugin::write(file:/c:/....../simple.dae) failed

    I try to link with the static library but it get worse, I don't know what can be the problem.

    I did exactly what it say in the DOM guide: Setting up, download collada, compile, add DOM_DYNAMIC in Preprocessor Definitions, add the additinal library directories and add the libcollada14dom21.lib in the input field of linker, do I need something else, install other library before?

    Thank's in advance

     
    • Steven Thomas
      Steven Thomas
      2008-05-19

      It sounds like you have everything setup right. I just tried this same program and it worked fine for me. It may be an issue in the URI resolution. Try changing "simple.dae" to a full path that you know is valid, e.g. "c:\simple.dae". Does that work?

      Try adding this line to see how the URI resolves: cout << daeURI(dae, "simple.dae").str() << endl;

      Make sure the URI resolves to a valid path on your system. It should resolve to the current working directory.

      Also check to make sure the automated tests run fine. Build domTest and run 'domTest -all'.

      Steve

       
    • gerardo
      gerardo
      2008-05-25

      Hi

      You're right, the problem is with the URI resolution, I tried using "C:\simple.dae" but it didn't work (I get a warning with the compiler, \ is a escape secuence, it should be /), then I try using "C:simple.dae" and it works :), then after reading a while and trying different things I found that using "/simple.dae" create the file in my working folder.

      Something that results strange for me is that in both cases (using "simple.dae" and "/simple.dae" ) the URI resolution is the same but the first don't work. Ah, when I ran 'domTest -all', all test passed without problems.

      Thanks for your help !!

       
    • Steven Thomas
      Steven Thomas
      2008-05-26

      > I tried using "C:\simple.dae" but it didn't work (I get a warning with the compiler, \ is a escape secuence, it should be /)

      For using backslashes in C string literals you double up on the backslash: "c:\\simple.dae". Since forward slash is also accepted as a directory separator on Windows, "c:/simple.dae" works equally well.

      > then after reading a while and trying different things I found that using "/simple.dae" create the file in my working folder.

      /simple.dae should create a file in the root directory of the current drive, e.g. c:\simple.dae. That works as expected for me.

      > Something that results strange for me is that in both cases (using "simple.dae" and "/simple.dae" ) the URI resolution is the same

      They shouldn't resolve to the same URI. "simple.dae" should resolve to <currentWorkingDirectory>/simple.dae, whereas "/simple.dae" should resolve to <currentDrive>:/simple.dae.

      Let me know if you need any more help.