Ask Your Question
0

ALL_BUILD error when building OpenCV from source

asked 2017-07-08 05:34:22 -0600

koor gravatar image

updated 2017-07-08 05:51:53 -0600

Hello all

I am trying to build the latest OpenCV which i downloaded from Github with Visual Studio 2013 on a Windows 7 64-bit machine using cmake GUI.The build options i am using are;

  • WITH_CUDA: ON
  • WITH_OPENCL: OFF
  • WITH_TBB: ON
  • CUDA_ARCH_BIN: 6.1 (MY CARD IS A GTX 1070)
  • CUDA_ARCH_PTX: 6.1

the rest is on default.When i right click ALL_BUILD and wait for it to finish i get the following output;

image description

  • C:\Users\can\Desktop\training\opencv-master\modules\dnn\src\torch\THDiskFile.cpp(330): error C2065: 'int32_t' : undeclared identifier
  • C:\Users\can\Desktop\training\opencv-master\modules\dnn\src\torch\THDiskFile.cpp(330): error C2065: 'buffer' : undeclared identifier
  • C:\Users\can\Desktop\training\opencv-master\modules\dnn\src\torch\THDiskFile.cpp(330): error C2059: syntax error : ')'
  • C:\Users\can\Desktop\training\opencv-master\modules\dnn\src\torch\THDiskFile.cpp(331): error C2065: 'buffer' : undeclared identifier
  • C:\Users\can\Desktop\training\opencv-master\modules\dnn\src\torch\THDiskFile.cpp(333): error C2065: 'buffer' : undeclared identifier
  • C:\Users\can\Desktop\training\opencv-master\modules\dnn\src\torch\THDiskFile.cpp(336): error C2065: 'buffer' : undeclared identifier
  • C:\Users\can\Desktop\training\opencv-master\modules\dnn\src\torch\THDiskFile.cpp(337): error C2065: 'buffer' : undeclared identifier
  • LINK : fatal error LNK1104: cannot open file '....\lib\Debug\opencv_dnn330d.lib'
  • LINK : fatal error LNK1104: cannot open file '....\lib\Debug\opencv_dnn330d.lib'

How can i resolve this issue? Any help is much appreciated :)

edit retag flag offensive close merge delete

Comments

please be so kind and replace the (useless) screenshot with a text version of your error.

berak gravatar imageberak ( 2017-07-08 05:42:44 -0600 )edit
1

here you go :)

koor gravatar imagekoor ( 2017-07-08 05:52:16 -0600 )edit

there's heavy work going on with the dnn module, and it seems, noone tested with vs2013 in a while.

would adding #include <stdint.h> to THDiskFile fix it ?

berak gravatar imageberak ( 2017-07-10 01:23:25 -0600 )edit

I "fixed" this issue by removing "opencv_dnn","opencv_perf_dnn" and "opencv_test_dnn" from the solution, but one shouldn't get linker errors like this when building OpenCV from source?

koor gravatar imagekoor ( 2017-07-10 10:34:45 -0600 )edit

yea, you're right. the dnn module should compile, in the 1st place.

berak gravatar imageberak ( 2017-07-10 10:37:30 -0600 )edit

again, the main problem is: your compiler does not know about int32_t, when trying to build THDiskFile.cpp.

maybe you should raise an issue here ?

berak gravatar imageberak ( 2017-07-10 10:39:48 -0600 )edit

if the problem re-occurs with other modules i will definitely do,thanks @berak

koor gravatar imagekoor ( 2017-07-11 11:12:38 -0600 )edit

damn thing is: the dnn module was moved into opencv main trunk, some days ago, like half a dozen other modules depend on it, a crucial part of the infrastructure.

berak gravatar imageberak ( 2017-07-11 11:16:24 -0600 )edit

the interesting part is;when i try to build on my home pc i only get linker errors from the dnn module,when i try to build on my work pc i get linker errors from modules like highgui,core,features2d. so i can't just "simply" remove them from the solution

koor gravatar imagekoor ( 2017-07-12 08:58:03 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-07-19 02:52:05 -0600

Uma gravatar image

Disable "opencv_dnn_BUILD_TORCH_IMPORTER" option in cmake to get rid out of this linker issue. It's working for me.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-07-08 05:34:22 -0600

Seen: 1,816 times

Last updated: Jul 19 '17