Change DLL dependency - dll

I am trying to compile a testprogram for libpqxx on Visual Studio 2019, unfortunately, after a check with Dependency Walker, some of the DLLs I need are dependent on the 64-bit version, the dependency path leads to the System32 folder instead of to the same named files in SysWOW64. Now I have no idea how to change the paths for the DLLs so I can get the program running. Is there a way to change the dependency paths for the DLLs I need?
Thanks in advance!
edit:
When I try to run the program I get the error messages "libssl-1_1.dll" and "libcrypto-1_1.dll" are missing. When I add them to the project folder, the project gets built and the program gets stopped right away, with the message "the application was unable to start correctly 0xc00007b". Assuming that the problem comes from dependent x64 DLLs I checked the DLLs used by Visual Studio with Dependency Walker and there are a lot of dependent ones that are x64 and located in the System32 folder.
ntdl.dll - fine
kernel32.dll -
c:\windows\system32\KERNELBASE.DLL
c:\windows\system32\NTDLL.DLL
c:\windows\system32\BCRYPTPRIMITIVES.DLL
c:\windows\system32\NSI.DLL
c:\windows\system32\RPCRT4.DLL
c:\windows\system32\WS2_32.DLL
KernelBase.dll-
c:\windows\system32\NTDLL.DLL
ws2_32.dll-
c:\windows\system32\KERNELBASE.DLL
c:\windows\system32\NTDLL.DLL
c:\windows\system32\RPCRT4.DLL
c:\windows\system32\BCRYPTPRIMITIVES.DLL
c:\windows\system32\NSI.DLL
c:\windows\system32\WS2_32.DLL
rpcrt4.dll-
c:\windows\system32\KERNELBASE.DLL
c:\windows\system32\NTDLL.DLL
c:\windows\system32\RPCRT4.DLL
c:\windows\system32\BCRYPTPRIMITIVES.DLL
c:\windows\system32\NSI.DLL
c:\windows\system32\WS2_32.DLL
msvcp140d.dll-
c:\windows\system32\KERNELBASE.DLL
c:\windows\system32\NTDLL.DLL
c:\windows\system32\RPCRT4.DLL
c:\windows\system32\BCRYPTPRIMITIVES.DLL
c:\windows\system32\NSI.DLL
c:\windows\system32\WS2_32.DLL
vcruntime140d.dll-
c:\windows\system32\KERNELBASE.DLL
c:\windows\system32\NTDLL.DLL
c:\windows\system32\RPCRT4.DLL
c:\windows\system32\BCRYPTPRIMITIVES.DLL
c:\windows\system32\NSI.DLL
c:\windows\system32\WS2_32.DLL
ucrtbased.dll- fine
So these are the DLLs and the dependencies that are 64-bit. Am I correct in that is what causes the problem? Do I need to change any dependencies to 32-bit?
Dump of file C:\...\libpq.dll
PE signature found
File Type: DLL
FILE HEADER VALUES
14C machine (x86)
Dump of file C:\...\lib\libpq.lib
File Type: LIBRARY
FILE HEADER VALUES
14C machine (x86)
Dump of file C:\...\lib\pqxx.lib
File Type: LIBRARY
FILE HEADER VALUES
14C machine (x86)
dependencies from dumpbin /dependents
kernel32.dll-
ntdll.dll
KERNELBASE.dll
bunch of api-ms-win-core
ext-ms-win-oobe-query-l1-1-0.dll
RPCRT4.dll
KernelBase.dll-
bunch of ext-ms-win
ntdll.dll
api-ms-win-eventing-provider-l1-1-0.dll
ws2_32.dll-
bunch of api-ms-win-core
ntdll.dll
RPCRT4.dll
rpcrt4.dll-
ntdll.dll
KERNELBASE.dll
bunch of api.ms.win
msvcp140d.dll-
CONCRT140D.dll
VCRUNTIME140D.dll
ucrtbased.dll
KERNEL32.dll
vcruntime140d.dll-
ucrtbased.dll
KERNEL32.dll
ucrtbased.dll-
bunch of api-ms-win-core

Related

Dependencies on vcruntime140.dll and api-ms-win-core-path-l1-1-0.dll

Windows 10 64-bit, VS2019 16.11.9
I have a C++ (native only) project which builds and executes on my development system, but on other Windows 10 systems, requires DLLs libiomp5md.dll and vcruntime140.dll to run. On other Windows 7 systems, it fails to run because api-ms-win-core-path-l1-1-0.dll is missing.
How can I determine specifically which function calls in my project are causing the requirements for vcruntime140.dll and api-ms-win-core-path-l1-1-0.dll?
I understand that api-ms-win-core-path-l1-1-0.dll is not a file, but a kind of link that Windows uses to locate the actual DLLs required, so I need to find a way to supply or point to these DLLs to allow execution on Windows 7.
Here is the output from dumpbin /dependents:
File Type: EXECUTABLE IMAGE
Image has the following dependencies:
UxTheme.dll
libiomp5md.dll
api-ms-win-core-path-l1-1-0.dll
KERNEL32.dll
USER32.dll
GDI32.dll
WINSPOOL.DRV
ADVAPI32.dll
SHELL32.dll
COMCTL32.dll
SHLWAPI.dll
ole32.dll
OLEAUT32.dll
oledlg.dll
gdiplus.dll
OLEACC.dll
IMM32.dll
WINMM.dll
VERSION.dll
imagehlp.dll
MSIMG32.dll

I'm having trouble building a solution on Windows 10 using Mono

I have been having trouble building my solution on Windows 10 using Mono.
I started out trying to build the whole solution for the game I'm working on. This solution builds just fine on Mac (using Mono) but we can't get it working in Windows 10.
As I have gone down the rabbit hole on this problem I have narrowed everything down to the point of building a nearly-empty Solution file that references a single .CSProj file, which itself is empty, and I'm still getting errors.
Here are the steps that have lead me to where I am now.
Fresh install of Windows 10
Install Mono 5.16
Install .Net Framework developer pack for .Net 4.7.1
Copy my solution to the machine
Open Command Prompt
Navigate to the solution directory
Run C:\Program Files\Mono\bin\msbuild.bat
I get the following error:
C:\ProgramFiles\Mono\lib\mono\msbuild\15.0\bin\Roslyn\Microsoft.CSharp.Core.target(52,5):
error MSB6006: "csc.exe"exited with code 1.
[C:\Users\bconley\workspace\test\TestProj\TestProj.csproj]
In the output of msbuild.bat it tells me what command it was executing when things failed, so I try running that on its own:
"C:\Program Files\Mono\lib\mono\msbuild\15.0\bin\Roslyn\csc.exe" /noconfig /nowarn:1701,1702 /nostdlib+ /platform:AnyCPU /errorreport:prompt /warn:4 /define:DEBUG;TRACE /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\System.Core.dll" /debug+ /debug:full /filealign:512 /optimize- /out:\Debug\TestProj.dll /subsystemversion:6.00 /target:library /utf8output Properties\AssemblyInfo.cs "C:\Users\bconley\AppData\Local\Temp\.NETFramework,Version=v4.7.1.AssemblyAttributes.cs"
That command gives the following error:
Could not load file or assembly 'System.Text.Encoding.CodePages, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
I'm completely stumped. It seems like I'm missing some fundamental dependency. I assume Mono still works on Windows?
Finally found a solution. They just don't ship System.Text.Encoding.CodePages.dll with csc.exe.
Drop it from NuGet or Visual Studio
Microsoft Visual Studio\2019\Community\MSBuild\Current\bin\Roslyn\
into
Mono\lib\mono\msbuild\15.0\bin\Roslyn\

E2209 Unable to open include file 'System.Internal.StrHlpr.hpp'

I am running Embarcadero RAD Studio 10.1 Berlin Update 2 on Windows 10.
My IDE environment worked fine yesterday. I compiled and build successfully using the IDE. My normal operation before running and debugging my project is to compile a couple libraries and then build my executable. Once that is done, then I'll run the executable to check out the functionality and debug etc.
This morning I compiled my libraries, as I always do, and I received the following error:
[bcc32 Error] dstring.h(17): E2209 Unable to open include file 'System.Internal.StrHlpr.hpp'
Full parser context
File.cpp(2): #include c:\program files (x86)\embarcadero\studio\18.0\include\windows\vcl\vcl.h
vcl.h(10): #include c:\program files (x86)\embarcadero\studio\18.0\include\windows\vcl\basepch0.h
basepch0.h(62): #include c:\program files (x86)\embarcadero\studio\18.0\include\windows\rtl\System.hpp
System.hpp(1599): #include c:\program files (x86)\embarcadero\studio\18.0\include\windows\rtl\sysclass.h
sysclass.h(46): #include c:\program files (x86)\embarcadero\studio\18.0\include\windows\rtl\dstring.h
I have ensured no pending changes exist in my local source and versioning.
I have tried cleaning, recompiling, and rebuilding.
My computer did run a Windows Update this morning. The following two were installed:
Cumulative Update for Windows 10 Version 1607 for x64-based Systems (KB4015438)
Update for Microsoft Outlook 2013 (KB3141495) 32-Bit Edition
I also checked out the files at the following referenced path: C:\Program Files (x86)\Embarcadero\Studio\18.0\include\windows\rtl
The file dates don't appear to suggest any changes were made recently to these files located withinn the rltl folder.
I have also tried restarting my computer.
What would cause something like this to happen and how would I go about resolving this?
System.Internal.StrHlpr.hpp is included in runtime library files when initially installing RAD Studio Berlin 10.1 Update 2.
By running the RAD Studio installer again and clicking repair installation during the process, this missing file is recovered and can again be found in the rtl folder: C:\Program Files (x86)\Embarcadero\Studio\18.0\include\windows\rtl\ allowing for successful compiling and building.

Program Not Using DLL In directory in System Path

I have a Click Once Deployment program that our office uses. 1.5MB of it is actual program. The rest is static DLL's like EPPlus and PDFSharp. I have a few others totaling about 7MB and I'm getting ready to use SyncFusion's Libraries which are 154MB in size.
I decided that I should leave these DLL files out of the Deployment and instead install them to the systems in question. I'm using Inno with modpath.iss to install these.
[Setup]
AppId={{6485E93B-75FC-4613-AFB7-A1800B986F7D}}
AppName="Required DLL Files"
AppVersion="1.0"
DefaultDirName="{pf}\FE Libraries"
OutputBaseFilename="Required DLL Files.exe"
Compression=lzma2/ultra64
SolidCompression=yes
ChangesEnvironment=true
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
Source: "Files\*"; DestDir: "{app}"; Flags: "deleteafterinstall"
[Tasks]
Name: modifypath; Description: &Add application directory to your environmental path; Flags: unchecked
[Code]
const
ModPathName = 'modifypath';
ModPathType = 'system';
function ModPathDir(): TArrayOfString;
begin
setArrayLength(Result, 2)
Result[0] := ExpandConstant('{app}');
end;
#include "modpath.iss"
The files are installed to the correct location, and the Path is added to System Environmental.
Location
c:\Program Files (x86)\WOTC-FE Libraries
Path String
c:\Program Files (x86)\WOTC-FE Libraries
And this is an x86 compiled application.
However, the program won't run any functions requiring these DLL files. I get errors that state that the registered DLL file isn't installed.
System.IO.FileNotFoundException: Could not load file or assembly 'EPPlus, Version=4.0.5.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1' or one of its dependencies. The system cannot find the file specified.
File name: 'EPPlus, Version=4.0.5.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1'
So am I missing something?

Could not load file or assembly ImageMagickNET.dll

I'm getting an exception "Could not load file or assembly 'ImageMagickNET.dll' or one of its dependencies. The specified module could not be found." while implementing using ImageMagick.dll.
How can I over come this exception?
I am using Visual Studio 2010 for development on a windows 7 machine.
ImageMagick version: 1.0.3484.35397
Run time version : v2.0.50727
Add a Reference to the 'ImageMagickNet.dll' found in the 'bin\ReleaseQ8' or 'bin\RealeaseQ16' folders, choose one of them.
After that you have to download the ImageMagick 6.5.3-10 version DLLs for Q8/Q16 because the ImageMagickNet was built to this version. (I found all versions at this link: http://imagemagick.codeplex.com/releases/view/30302 For example, for Q16 download: ImageMagick-6.5.3-10-Q16-windows-dll.exe)
Then install it and copy all DLL files from 'C:\Program Files\ImageMagick-6.5.3-Q16' to your bin folder. Now you should be able to run it properly.