0

I'm trying to get the sample "SimpleOpenGl" from Assimp to work, but I get some linker errors i can't solve. (And yes I am very new)

I get 12 LNK2001 errors (below is two of them) 1>Sample_SimpleOpenGL.obj : error LNK2001: unresolved external symbol _aiTransformVecByMatrix4 1>Sample_SimpleOpenGL.obj : error LNK2001: unresolved external symbol _aiImportFile

When googling "aiTransformVecByMatrix4" it says that it requires cimport, but it is already included, so I am not sure why I am getting this error.

The sample project can be found here: http://assimp.svn.sourceforge.net/viewvc/assimp/trunk/samples/SimpleOpenGL/

Any help is appreciated, thanks.

As you can see the cimport seems to be correct included

Nicolai Lissau
  • 7,298
  • 5
  • 43
  • 57

1 Answers1

1

If you have downloaded assimp, you must have its libraries in any place on your disk. Open your sample properties dialog, select Linker and check the path to external references.

This must give you a clue about where the sample is looking for libraries.

If you are not sure, please post your values so I can help you

  • Hi Manuel. Thank you. I had included the lib from the VC++ directories tab, but that did not work. I included it under additional libraries under the linker settings instead. So it seems like it is working. Now I have to just read a file, and I get into trouble again :/ If I want to pass a filename to a function, how do i define it? I tried like this: const std::string pFile = "cube.obj"; – Nicolai Lissau May 07 '13 at 11:34
  • The question is what does the function expects: – Manuel del Castillo May 07 '13 at 12:18
  • If the called function is something like this 'myfunction( const char * xx )' you must do a) from your pFile: 'myfunction( pFile.c_str() );' or b) just a constant 'myfunction( "cube.obj" );' – Manuel del Castillo May 07 '13 at 12:21
  • Then function expects it like this: bool DoTheImportThing( const std::string& pFile) – Nicolai Lissau May 07 '13 at 14:12
  • Hello, I couldn`t have a look before. I suppose you have moved but in any case: – Manuel del Castillo May 09 '13 at 14:40
  • bool DoTheImportThing expects a string reference (string&) so you just have to pass a string object (pFile): 'DoTheImportThing(pFile);' – Manuel del Castillo May 09 '13 at 14:42