Visual Studio error when ITK and VTK is used - visual-studio

I am doing a project in visual studio 2015When i included ITK and compiled everything ,some errors are occurring
Error C3861 '_beginthreadex': identifier not found
Error C2039 '_time64': is not a member of '`global namespace''
Error C3861 '_time64': identifier not found
Error C3861 '_mktime64': identifier not found
Error C3861 '_mktime64': identifier not found
Error C3861 '_gmtime64_s': identifier not found
Error C3861 '_localtime64_s': identifier not found
Error C3861 '_mktime64': identifier not found
Error C3861 '_localtime64_s': identifier not found
Error C3861 '_gmtime64_s': identifier not found
Error C2039 '_time64': is not a member of '`global namespace''
Error C3861 '_time64': identifier not found
Error C3646 'm_nLastAnimTime': unknown override specifier
Error C4430 missing type specifier - int assumed. Note: C++ does not
support default-int
Error C3646 'm_ActiveTime': unknown override specifier
Error C4430 missing type specifier - int assumed. Note: C++ does not
support default-int
Error C3646 'm_clkLastTime': unknown override specifier
But i tried including Visual studio/VC/Include and Visual Studio/VC/bin to the Additional Include Directories,still it is showing the same errors.
I also tried changing the Use of MFC and c++ ->code generation ->Runtime Library in configuration properties as well.
I referred this link also,but my problem is not solved.
So i thought may be because of vs2015 instalation problems and tried to build a new project using VTK and ITK in Visualstudio 2017,In there also the same errors are occurring.I have been stuck for weeks ,Can anyone give a solution for my problem?

Are you using this procedure to build ITK and VTK? Are you following this guide to build your own application? Using CMake is the only supported way of using ITK and/or VTK.
If you cannot use CMake, a workaround is to build a hello world example using CMake and then copy include paths and list of libraries to your main Visual Studio application.

Related

vs2017 compile error: double inclusion of header boost/config/abi_prefix.hpp

I upgraded some vc2008 projects into vc2017 projects, and replaced boost_1_47 with boost_1_64.
Vc2008 projects were correctly compiled, but vc2017 projects reported an error:
fatal error C1189: double inclusion of header boost/config/abi_prefix.hpp is an error
what does it means? And how to solve it?
I used VS2017 with vc141 toolset and windows 10 SDK

Using std::function<void> on visual studio 2013

I am converting my project from mac os x (xcode) to windows (visual studio 2013).
But i am having problems when i try to use the std::function.
As an example i declared.
std::function<void()> processFunc;
But i get several errors:
Error 1 error C2039: 'function' : is not a member of 'std' ...github\oglengine\engine\game.h 39 1 Engine
Error 2 error C2143: syntax error : missing ';' before '<' ...github\oglengine\engine\game.h 39 1 Engine
Error 3 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int ...github\oglengine\engine\game.h 39 1 Engine
On XCode i needed to enable the c++11, but from what i saw on my research the VS 2013 have the C++11 enables.
My only C++ include is the iostream
Should i add another include?
I believe you need to #include <functional> in VS.

opencv running tutorial test undeclared indentifier

I have been trying to install opencv from source for a while now on i have been using the tutorials from
http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html
I got as far a attempting to build the opencv test project in visual studio (i have built it in x86 but i have windows 7 (x64) dont really think it is related to the problem but just in case someone asks).
Now i build the project and I get the following errors:
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(64): error C2065: 'CV_CAP_PROP_FRAME_WIDTH' : undeclared identifier
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(65): error C2065: 'CV_CAP_PROP_FRAME_HEIGHT' : undeclared identifier
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(66): error C2065: 'CV_CAP_PROP_FRAME_WIDTH' : undeclared identifier
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(67): error C2065: 'CV_CAP_PROP_FRAME_HEIGHT' : undeclared identifier
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(79): error C2065: 'CV_WINDOW_AUTOSIZE' : undeclared identifier
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(80): error C2065: 'CV_WINDOW_AUTOSIZE' : undeclared identifier
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(81): error C3861: 'cvMoveWindow': identifier not found
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(82): error C3861: 'cvMoveWindow': identifier not found
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(85): error C2065: 'CV_CAP_PROP_FRAME_COUNT' : undeclared identifier
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(129): error C3861: 'cvWaitKey': identifier not found
However when i can follow the declaration of highgui.hpp in visual to the file that contains CV_CAP_PROP_FRAME_WIDTH (which for some reason is opencv2/highgui.hpp not opencv2/highgui/highgui.hpp but the latter references the first).
Can anyone explain to why visual studio is not finding the these identifiers?
I have read the link several times and i think i have done everything in there, i would appreciate any help as this is cracking me up.
EDIT AND SOLVED:
Right feel a bit dumb right now, but i will leave this here to others that might find this issue when compiling from github opencv and following the tutorials, the previous issue occurs because changes have occurred in from the version in the website and the one in github, please use the source code version in github (at the time of writing 2.4.9)
https://github.com/Itseez/opencv/blob/master/samples/cpp/tutorial_code/introduction/windows_visual_studio_Opencv/Test.cpp
In this version the CV and cv prefix from enums and methods has disappeared.
I hope this helps and sorry for putting the question and replying to it after, but i did spent a while looking at it.

Connecting DB2 from Node.js on Windows-platform

I am currently mirroring the DB2 to local MySQL-db with some jdbc-code. I would like to connect DB2 directly from Node.js app without having to query the mirror. I am running on Windows and I cannot change to Linux. It seems that work on DB2 with Node.js is yet very marginal or node-odbc is used (unixODBC bindings for node).
I found this project https://github.com/herzi/db2.js which provides DB2-bindings for Node but I cannot install it as the install fails. The package requires Node-gyp (installed this successfully) and .NET framework SDK. I set the vcbuild.exe into my PATH. After these the msbuild.exe complained about missing header files (sqlcli1.h, sqlsystm.h, sqlca.h), which I found out are part of PRO*C.
I took the header files above from here: http://files.edin.dk/php/win32/dev/php_build/include/db2/ and put them into my Node's src/ directory. Now the compiler shows multiple errors.
Are there any other options when working with Windows to connect DB2 from Node.js app than try to get the above module to work?
Anyone able to help me out here? What are the steps to get the above module installed?
Thanks!
Errors shown:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\sqlext.h(30): error C2146 : syntax error : missing ';' before identifier 'SQLSTATE' [C:\IS\node\node_modules\db2\build\db2.vcxproj]
C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\sqlext.h(30): error C2146: syntax error : missing ';' before identifier 'SQLSTATE' [C:\IS\node\node_modules\db2\build\db2.vcxproj]
C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\sqlext.h(30): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [C:\IS\node\node_modules\db2\build\db2.vcxproj]
C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\sqlext.h(30): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [C:\IS\node\node_modules\db2\build\db2.vcxproj]
C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\sqlext.h(30): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [C:\IS\node\node_modules\db2\build\db2.vcxproj]
C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\sqlext.h(30): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [C:\IS\node\node_modules\db2\build\db2.vcxproj]
C:\Documents and Settings\tpaleniu\.node-gyp\0.8.12\src\sqlcli1.h(1501): error C2371: 'SQLTCHAR' : redefinition; different basic types [C:\IS\node\node_modules\db2\build\db2.vcxproj]
C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\sqlext.h(30) : see declaration of 'SQLTCHAR'
..\src\connection.cc(77): error C3861: 'snprintf': identifier not found
[C:\IS\node\node_modules\db2\build\db2.vcxproj]..\src\connection.cc(80): error C3861: 'snprintf': identifier not found [C:\IS\node\node_modules\db2\build\db2.vcxproj]
..\src\connection.cc(111): error C3861: 'bzero': identifier not found [C:\IS\node\node_modules\db2\build\db2.vcxproj]
..\src\connection.cc(208): error C3861: 'bzero': identifier not found [C:\IS\node\node_modules\db2\build\db2.vcxproj]
..\src\connection.cc(547): error C2057: expected constant expression [C:\IS\node\node_modules\db2\build\db2.vcxproj]
..\src\connection.cc(547): error C2466: cannot allocate an array of constant size 0 [C:\IS\node\node_modules\db2\build\db2.vcxproj]
..\src\connection.cc(547): error C2133: 'argv' : unknown size [C:\IS\node\node_modules\db2\build\db2.vcxproj]
It is true that node-odbc currently is currently meant only for use with unixODBC. But Daniel VerWeire is currently working on supporting node-odbc on Windows. I guess you need to wait a little while.
Praveen will have a post on it here as soon as it is available

How to solve build errors using VS 2010 Ultimate on 32bit XP Sp3

Installed VS2010 Ultimate on my desktop workstation - Dell Precision T3500 (Windows 7 64bit OS), and on my IBM ThinkPad R51 (Windows XP Sp3 32bit).
I am having problems building solutions on the StinkPad, and cannot figure out why. As listed below, the build output for a compiler built ADO library lists the following errors:
c:\wpds\debug\msjro.tlh(196): error C2146: syntax error : missing ';' before identifier 'ConflictTables'
c:\wpds\debug\msjro.tlh(196): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\wpds\debug\msjro.tlh(196): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\wpds\debug\msjro.tlh(224): error C2146: syntax error : missing ';' before identifier 'GetConflictTables'
c:\wpds\debug\msjro.tlh(224): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
I have checked to make sure that all include, exe, and library paths are correct for all projects and solutions. Any insight will be greatly appreciated.
Thanks
Bill
I encountered this same problem when compiling for the first time with a new version of msado15.dll. There are dependencies between msado15.dll and msjro.dll, as evidenced by these lines at the top of msjro.tlb:
// Cross-referenced type libraries:
//
// #import "C:\Program Files (x86)\Common Files\System\ado\msado15.dll"
//
In my case, the problem arose because I'm building my app on Windows 7, and the SP1 update includes a breaking change in msado15.dll that will cause the application to fail on Windows XP. When I fixed this problem using this KB, my msado dll problems were fixed but my msjro.tlb stopped compiling.
There is probably a way to update msjro to reference the desired/correct msado (in my case, msado60_Backcompat.tlb as installed in the KB), but if you're using CADODatabase classes defined in ado2.cpp and ado2.h, and if you're not using jet-specific features, a simpler fix is to just comment-out the portions of ado2.h and ado2.cpp that reference jet.
I just commented out this line in ado2.h:
//#import <MSJRO.DLL> no_namespace rename("ReplicaTypeEnum", "_ReplicaTypeEnum")
and also #ifdef'd out all of the implementations of CJetEngine methods in ado2.cpp, and that worked for me.
Good luck!
I had this problem too. Then I compared the MSJRO.TLH created on WinXP to the one created on Win7. On WinXP the declaration was
ADODB::_RecordsetPtr ...
on Win7 it was
_RecordsetPtr ...
I guessed that the problem might be related to namespaces. MSADO15.TLH defines a namespace -"ADODB". So I placed:
using namespace ADODB;
before my import of the Jet.
#import "MSJRO.DLL"
This got rid of the errors for me.

Resources