I am trying to compile a program which uses opencv. I have included the opencv.hpp file in the .h and the .c file which needs the opencv functions. The project also has the properties set to use opencv. I am using 2.4.5 version of opencv. The problems I am facing is that after including these files in the project the project fails to compile. I get an error saying I have failed to #inlcude "stdafx.h". This is because I am using precompiled headers and #include"stdafx.h" has to be the first line of code in that .c or .cpp file. If I add the inclusion of stdafx.h tehn the program compiles but it does not link.
shown below is how i have included the files in the .c file.
**
include "../stdafx.h"
include "C:\opencv\include\opencv2\opencv.hpp"
include "DPD_AlgorithmInit.h"
**
and shown below is the inclusion in the .h file
include "C:\opencv\build\include\opencv2\core\types_c.h"
the error I am receiving is
error C1083: Cannot open source file: '..\MOSS\PedestrianDetection\DPD_Tracker.c': No such file or directory C:\Users\sankalp\Desktop\check\MOSS_Evaluation\c1 error LNK2001: unresolved external symbol _InitializeTracker C:\Users\sankalp\Desktop\check\MOSS\DPD_AlgorithmInit.obj error LNK2001: unresolved external symbol _DPD_Tracker C:\Users\sankalp\Desktop\check\MOSS\DPD_AlgorithmInit.obj error LNK2001: unresolved external symbol "unsigned char * __cdecl DPD_Alloc(unsigned int)" (?DPD_Alloc##YAPAEI#Z) C:\Users\sankalp\Desktop\check\MOSS\DPD_Tracker1.obj error LNK1120: 3 unresolved externals C:\Users\sankalp\Desktop\check\Release\MOSS.exe
Am I doing something wrong while including the .hpp file? Is there a better way to include opencv to allow compilation and linking? I have tried toggling the precompiled header usage settings in the project too but It did not help.
Related
I'm trying to build a driver with Microsoft Dmf Framework https://github.com/microsoft/DMF
I builded Dmf from the provided sln file in this repository. It results in DmfK.lib (I build a kernel mode driver), then I add this lib to my driver project.
But I have 27 times the same linker error "unresolved external symbol WppAutoLogTrace" from different functions of this lib, ie:
Error LNK2019 unresolved external symbol WppAutoLogTrace referenced in function "long __cdecl HashTable_ContextInitialize(struct DMFMODULE__ *)" (?HashTable_ContextInitialize##YAJPEAUDMFMODULE__###Z) Main (Main\Main) C:\Data\Development\MyDriver\Source\Main\DmfK.lib(Dmf_HashTable.obj)
I found no relevant information about this function over the internet, I can't figure out which other lib to include. Is this a problem with a missing lib or an issue with the DmfK.lib build ?
I finally found the solution:
WppAutoLogTrace is implemented in WppRecorder.lib
Gomobile bind error
The array mean what, Anybody ever had this problem?
go build -tags ios -buildmode=c-archive -o/var/folders/vp/3ztk4jzn3hq35qfmp3qwrfm80000gp/T/gomobile-work135205628/faceTest-arm.a gobind failed: exit status 2
# gocv.io/x/gocv
In file included from calib3d.cpp:1:
In file included from ../../../../../gocv.io/x/gocv/calib3d.h:5:
In file included from /usr/local/Cellar/opencv/4.0.0/include/opencv4/opencv2/opencv.hpp:52:
In file included from /usr/local/Cellar/opencv/4.0.0/include/opencv4/opencv2/core.hpp:52:
/usr/local/Cellar/opencv/4.0.0/include/opencv4/opencv2/core/cvdef.h:659:10:
fatal error: 'array' file not found
I have a following problem when I want compile my Datasnap ISAPI DLL project using C++ Builder 10.2:
Create new Datasnap WebBroker Application as ISAPI DLL and using
TDSServerModule option
Open WebModule1 designer and add TFDGUIxWaitCursor component
In project options deselect "Link with Dynamic RTL" and "Link with runtime packages"
Build
Then a bunch of linker errors are generated:
[ilink32 Error] Error: Unresolved external 'GetDpiForMonitor'
referenced from C:\PROGRAM FILES
(X86)\EMBARCADERO\STUDIO\19.0\LIB\WIN32\DEBUG\VCL.LIB|Vcl.Forms
[ilink32 Error] Error: Unresolved external
'SHCreateItemFromParsingName' referenced from C:\PROGRAM FILES
(X86)\EMBARCADERO\STUDIO\19.0\LIB\WIN32\DEBUG\VCL.LIB|Vcl.Dialogs
[ilink32 Error] Error: Unresolved external 'BeginBufferedPaint'
referenced from C:\PROGRAM FILES
(X86)\EMBARCADERO\STUDIO\19.0\LIB\WIN32\DEBUG\VCL.LIB|Vcl.Controls
....
Similar errors are shown when targeting Windows 64 bit platform. What I noticed is that TFDGUIxWaitCursor is the one causing this as compiling the project prior placing that component is successful. It even compiles fine if the component is on the web module but if step 3 is not performed. How to solve this and get successful compile when steps 2 and 3 are applied?
Adding the following lines to the WebModule.cpp file resolves the issue:
#pragma comment(lib, "SHCore")
#pragma comment(lib, "UXTheme")
#pragma comment(lib, "shell32")
#pragma comment(lib, "WINDOWSCODECS")
I downloaded the zbar library and cloned the opencv-zbar repo in my home directory. Then I ran the following command $cmake . which gave my the error
-- Could NOT find ZBAR (missing: ZBAR_LIBRARIES ZBAR_INCLUDE_DIR)
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
ZBAR_LIBRARIES
linked by target "zbar_opencv" in directory /home/surabhi/opencv-zbar
-- Configuring incomplete, errors occurred!
See also "/home/surabhi/opencv-zbar/CMakeFiles/CMakeOutput.log".
I then made two changes in my CMakeCache.txt as follows
//Path to a file.
ZBAR_INCLUDE_DIR:PATH=/usr/include/zbar
//Path to a library.
ZBAR_LIBRARIES:FILEPATH=/usr/lib/libzbar.so
because the were set to NOTFOUND.
It then gave me no errors
-- Found ZBAR: /usr/lib/libzbar.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/surabhi/opencv-zbar
But when I run make
It gives the error:
fatal error: zbar.h: No such file or directory
#include <zbar.h>
^
compilation terminated.
I don't understand why I get this error as It says Found ZBAR when I run cmake.
Thanks in advance
You need to do actually use the include dirs somewhere in your CMakeLists.txt so CMake knows that you actually want to use these include paths.
Examples:
include_directories(${ZBAR_INCLUDE_DIR})
Or the more modern, recommended way:
target_include_directories(zbar_opencv PRIVATE ${ZBAR_INCLUDE_DIR})
Found trunk here:
http://virtual-treeview.googlecode.com/svn/trunk/
Downloaded files... Worked through some errors with search paths
(VirtualTreesD could not locate required package "dclstd" - it was in lib/win32/release, added it to library Delphi paths)
When I try build all I get following errors:
[DCC Fatal Error] VirtualTreesR.dpk(29): E2225 Never-build package 'dclstd' must be recompiled
[DCC Fatal Error] VirtualTreesD.dpk(35): E2202 Required package 'VirtualTreesR' not found
The trunk version of VirtualTreesR does not require dclstd. The error message you report says it does, so it looks like you erroneously added dclstd to the run-time package's list of required packages. Revert that change. The run-time package should not require dclstd, which is a design-time package. It should require only vcl and vclx.
Try to change target platform in project's group from Windows 64 to 32.
Compiler try search dclstd.dcp file, this file location is for ej. win 32 in debug "lib\win32\debug".
Fix: in the tool/option/delphi option/library add $(BDSLIB)\$(Platform)\release and $(BDSLIB)\$(Platform)\debug