Search code examples
c++cmakemingwcodeblocksassimp

Assimp won't build correctly in Code::Blocks - "TVITEMEXW not declared in current scope"


I'm currently working through the LearnOpenGL tutorials, which has been going fine thus far, until I've hit the model loading portion of the tutorial.

LearnOpenGL uses the Assimp library to handle model loading, but I don't seem to be able to get it to build properly (precompiled libraries don't work either for me) - it produces errors within "Display.cpp":

In function 'unzOpenCurrentFile3':
Line 1177: warning: assignment from incompatible pointer type
In member function 'int AssimpView::CDisplay::AddNodeToDisplayList(....'
Line 179 error: 'TVITEMEXW' was not declared in this scope

With the line 179 error appearing to be the main cause of failure. Having looked in the 'Display.cpp' file, the issue is with the following declaration:

TVITEMEXW tvi;

And TVITEMEXW doesn't seem to be declared/included within the file explicitly, but the included headers are stdio.h, stdlib.h, string.h, and "./unzip.h". After some searching, I've found that TVITEMEX is a windows structure with TVITEMEXW as a unicode name (according to this) but I'm fairly new to C++/compilers etc., and don't really know what to do with this information.

I created the Code::Blocks project file with CMake and MinGW from the Assimp 3.2.

Any help would be hugely appreciated, I've been stuck with this for a few days now and can't figure out how to resolve it myself. Apologies if I haven't provided enough/the correct information, I'm not entirely sure exactly what is relevant to the problem.


Solution

  • try replacing TVITEMEXW with TVITEMW and maybe sNew.itemex with sNew.item.