Datasnap - How to fix linker errors when using TFDGUIxWaitCursor? - delphi

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")

Related

Unresolved external symbol WppAutoLogTrace when building a driver with Dmf Framework

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

Unable to compile/link program after inclusion of opencv.hpp

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.

Error Cross Compiling: hidden symbol ... final link failed

I am getting the following error when compiling opencv with ffmpeg.
..../arm-none-linux-gnueabi/bin/ld: ../../bin/opencv_test_core: hidden symbol `__sync_val_compare_and_swap_4' in ..../arm-none-linux-gnueabi/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
I have no idea what this means. How do I fix this?
Edit:
I am cross compiling for ARM using codesourcery's arm-2009q3 compiler.
I using cmake and make to compile.
Please check all the libraries that you use and go through this stackoverflow thread as well.
To me, I got the below error when I migrated my product to new GCC version (3.3.3 to 4.5.4)
hidden symbol `__clz_tab' in /../lib/gcc/mipsel-unknown-linux-uclibc/4.5.4/libgcc.a(_clz.o) is referenced by DSO
Later I found that one of the library that I tried to link was built using GCC 3.3.3. After building the other library under GCC 4.5.4, the 'hidden symbol' error disappeared.

fail to build Opencv in windows using code:block

Following this link. I am stuck in the last two steps during setting up my workstation.
As a compiler I use Code:Block MinGW; I have already generated the compiled opencv files, now I need to build the sln file in Windows. I use Code Block to build this OpenCV Project File in the path D:\OpenCV\Build\Opencv, where I put the generated bin file after using Cmake.
During the building, it stopped at 40%, saying;
Linking CXX executable ....\bin\opencv_perf_core.exe
c:/codeblock/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe:
warning: auto-importing has been activated without
--enable-auto-import specified on the command line. This should work unless it involves constant data structures referencing symbols from
auto-imported DLLs. Cannot export _ZN12_GLOBAL__N_13ROp3allEv: symbol
not found Cannot export _ZN12_GLOBAL__N_17CmpType3allEv: symbol not
found collect2: ld returned 1 exit status mingw32-make.exe[2]: *
[bin/opencv_perf_core.exe] Error 1 mingw32-make.exe1: *
[modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2
mingw32-make.exe: * [all] Error 2 Info: resolving vtable for
cv::_OutputArray by linking to imp_ZTVN2cv12_OutputArrayE
(auto-import) Info: resolving vtable for cv::_InputArray by linking to
imp_ZTVN2cv11_InputArrayE (auto-import) Info: resolving vtable for cv::Exception by linking to imp_ZTVN2cv9ExceptionE (auto-import)
Creating library file: ....\bin\libopencv_perf_core.dll.a Process
terminated with status 2 (14 minutes, 29 seconds) 0 errors, 3 warnings
How can I solve this problem?
Unfortunately, there's not much you can do, according to http://code.opencv.org/issues/2523.
You will have to use a recent version of MinGW. It builds fine using the latest MinGW shipping with GCC 4.7.2.
This issue seems to have been introduced in OpenCV 2.4.3 as it is said version 2.4.2 builds fine.

Trying to install Virtual Treeview for Delphi XE2

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

Resources