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

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.

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

Related

error: '_Out_' has not been declared when including <Kinect.h>

I'm using CLion and I need to get some data from the Kinect, but when it comes to #include <Kinect.h> I get the following error:
In file included from C:/PROGRA~1/MICROS~2/Kinect/V2D305~1.0_1/inc/Kinect.h:547,
from C:\Users\fredd\CLionProjects\3D_avatar\main.cpp:19:
C:/PROGRA~1/MICROS~2/Kinect/V2D305~1.0_1/inc/Kinect.INPC.h:109:13: error: '_Out_' has not been declared
_Out_ WAITABLE_HANDLE *waitableHandle) = 0;
^~~~~
And an endless list of similar errors. I think I miss some kind of library that defines this data format, but I really don't know (if that's the problem) which one. I've searched all over the internet and googled for about 3 hours without any result.
How can I solve the error?
Also, is there a better way to make Kinect works with CLion?
I've managed to understand what was going on: MinGW couldn't compile SAL annotations, so I had to switch compiler to MSVC, bundled with Visual Studio. Also, I had to link MatLab with my project since there's no library (except for libfreenect2, which has driven me mad) that can handle a Kinect v2.

OpenCV 3.1.0: /usr/local/include/opencv2/legacy/legacy.hpp can't compile

I'm getting loads of errors like
/usr/local/include/opencv2/legacy/legacy.hpp:2994:12: error: 'CvSubdiv2DEdge' does not name a type
/usr/local/include/opencv2/legacy/legacy.hpp:3002:12: error: 'CvSubdiv2DPoint' does not name a type
/usr/local/include/opencv2/legacy/legacy.hpp:1757:36: error: 'cv::EM' has not been declared
With OpenCV 2.4.13 it compiles just fine. It looks like they actually forgot to add some necessary includes into legacy.hpp. What's going on?
Sorry for being misleading, but there's actually NO such header in the standard setup. My setup was mixed up with another, older version of opencv, and it wasn't packed into a deb file, just a bunch of files within /usr/local/. Funny thing is, it was a clean install.
After reinstalling the OpenCV from scratch and removing those old files, errors changed to legacy.hpp being missing - which is exactly what is required here.
Here is the proof: http://answers.opencv.org/question/42622/opencv-30-deprecated-opencv_legacy-module/. Also, from OpenCV Transition Guide: "legacy, nonfree modules have been removed. Some algorithms have been moved to different locations and some have been completely rewritten or removed."

Have trouble using NCBI c++ toolkit

I'm trying implement a small program to do blast and obtain result without browsers.
The ncbi c++ toolkit seems like what I'm looking for, however, I met some problem of using it.
My environment is windows with MSVC 2010 c++ compiler and QT framework,
I've download, configure, and build the toolkit according to the following instruction.
http://www.ncbi.nlm.nih.gov/books/NBK7167/
and I have all libs (.*lib files) at the directory below:
ncbi_cxx--12_0_0\compilers\msvc1000_prj\dll\lib\ReleaseDLL
Following is an example provided by ncbi, I'm trying to do similar stuff.
http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/lxr/source/src/sample/app/blast/remote_blast_demo.cpp
After everything seems ready, I create a project (with Qt Creator) and try to use the toolkit.
However, the problem occurs when I include any of the header files, for example
#include <corelib/ncbiapp.hpp>
I have no clue how to solve the compiler error when including ncbi libraries.The error message is as follows:
'ncbi::CUtf8::AsUTF8' redefinition of
default parameter : parameter 2 (ncbistr.hpp line 2861)
'ncbi::CStringUTF8 ncbi::CUtf8::AsUTF8(const ncbi::TCharUCS2*,ncbi::SIZE_TYPE)' : member function already defined or declared (ncbistr.hpp line 2861)
'ncbi::CUtf8::AsUTF8' : missing default parameter for parameter 2 (ncbistr.hpp line 2861)
I spent days on figuring how to use this toolkit, if anyone can give me some idea, I'll really appreciate.
By the way, in the project file I do include path and libs.
INCLUDEPATH += "../../lib/ncbi_cxx--12_0_0/include"
LIBS += "../../lib/ncbi_cxx--12_0_0/compilers/msvc1000_prj/dll/lib/ReleaseDLL/*.lib"

ZXing Library: Errors in iOS: private field 'cached_y_' is not used

I am currently trying to use the ZXing Library for an iOS Project. However I can't even get the sample Projects to work.
The ScanTest Project, as well as the ones that I created myself throw the following error in the BinaryBitmap.cpp file.
In file included from /Volumes/Macintosh HD/Users/Tim/Downloads/zxing-2.1/iphone/ZXingWidget/../../cpp/core/src/zxing/BinaryBitmap.cpp:20:
../../cpp/core/src/zxing/BinaryBitmap.h:33:7: error: private field 'cached_y_' is not used [-Werror,-Wunused-private-field]
int cached_y_;
^
1 error generated.
I searched on Google and Stackoverflow, but have not found a solution for the problem.
I have tried it with both the current stable release of XCode and the beta.
I don't know if anybody else has got this problem too, but any help would be greatly appreciated.
This is clang, right? You can read about the relevant compiler options here.
The error message is telling you which compiler flags are relevant.
-Wunused-private-field means you get warnings about private member fields of classes (or structs, ...) that are not used anywhere. The warning is because you probably did mean to use them. This would not normally stop the compilation, but...
-Werror turns warnings into errors. A lot of people use this option to force themselves to write very clean code. Taking this one out should be enough.

OpenCV 2.4 : undefined reference to cvRand

I can't find the file I have to include to my code to get cvRand (and all other related functions, such as cvRandInit ... ) to be recognized by the compiler. It's weird, because in the past this code used to work as is. Must be an issue with OpenCV2.4.
Also, when I right-clic on cvRand (I work with Qt Creator) and ask to follow the symbol under the cursor, the IDE open a file called compat.hpp. I have several files named compat.hpp, so I don't know which one I have to include. My OS is Ubuntu 11.04.
So far, I included core.hpp, highgui.hpp, and cv.h.
I googled on this, but couldn't find any related issue... so I guess this is not an issue, and I just miss something stupid.
The includes were obviously right, I figured that it has to be a lib problem, by guessing I found that I had to add libopencv_legacy.so. Everything works fine now, thx stackoverflow.