We have a Windows 32-bit console application written in C and compiled using Open Watcom. We would like to use the libxml2 library with our application. We found the Win32 DLL binaries, can we link them with our application's code using the Watcom compiler?
Related
I got a problem here:
I wrote a win32 dll project,which included WinRT libs; (i used this dll to process windows 10 packages, and it has to be in WinRT environment). and it exports some com-like interfaces (dllregister,dllreg,dllunreg..).
Then ,I wrote a win32 desktop exe,try to load this dll ,but what i got is:
ErrorCode:126. So i load this dll by Dependency Walker, and it says that api-ms-win-core-...dll can NOT be found.
but why? I can debug this dll in VS2015 with that app,but when i run that app by clicking it,which loads this dll,it returns errorcode :126?? (DLL load error??)
I have a dll file that has been created and compiled with C++ under Windows and I unfortunately don't have the source code for it.
This dll file is working well with a .NET program compiled with visual studio.
I want to know if this is possible to import this dll file with mono, and execute it under a UNIX environment.
This dll file is sending some Smartcard APDU instructions.
Most probably no. Binaries are platform specific.
You can always try to disassemble it on Windows and try to compile the disassembled code on unix, however I think it's not worth it.
System.Data.SQLite (SDS) is apparently the most popular way to use SQLite from a .Net application.
I was wondering if
SDS requires shipping the SQLite DLL in addition, or if SDS includes
the SQLite source code, and
SDS can be statically compiled into a
VB.Net application of it can only be shipped as a DLL?
Thank you.
To expand on my comment, SDS is a .net wrapper for unmanaged code, so you will need to ship your release code with a copy of the DLL.
As Steve mentions, there are 32 and 64bit versions of the DLL, and as i discovered after much frustration, you must have the corresponding visual c++ runtime installed on the target machine, so if you deploy the 32bit version onto a 64bit machine, it will need the 32bit c++ runtime environment installed.
An alternative that i am currently looking into but havent had time to test is csharpe-sqlite, a pure .net implementation:
http://code.google.com/p/csharp-sqlite/
Coded in c# as the name suggests, but of course usable in any .net language including vb.net
Actually it's quite easy to compile System.Data.SQLite.dll to the does not require C++ runtime. For example if you download source code and follow the build procedures you'll find statically linked (no C/C++ runtime required) copy of System.Data.SQLite.dll in the following path:
<your-src-root>\bin\<2008 or 2010>\<Win32 or x64>\ReleaseStatic
For example if your source is in C:\Work\sqlite-netFx-source-1.0.80.0 then statically linked binary for Win32 and .NET 3.5 (VS 2008) will be located in:
C:\Work\sqlite-netFx-source-1.0.80.0\bin\2008\Win32\ReleaseStatic
Furthermore since System.Data.SQLite.dll is a mixed-mode assembly consisting of a managed .netmodule and native .obj file linked together using link.exe, it is possible to build your app as a .netmodule as well and link it together with SQLite into a single mixed mode assembly.
The resulting assembly will still be either Win32 or x64, however since almost all x64 machines will have no problem running Win32 code you can just settle on Win32 as long as:
Your app is an .exe or a .dll the is always loaded into a Win32 process, and
You don't use any of x64 specific advantages such as larger address space or using unmanaged code available only in x64
I have downloaded and installed the Mono framework onto my Win7 development machine. I then followed the instructions here to have Visual Studio 2010 allow targeting of the Mono framework instead of .NET. I then create this test console app using VB with the target framwework set "Mono 2.10.8 profile" in the project's Advanced Compile Options:
Dim runningOnMono As Boolean = Not IsNothing(Type.GetType("Mono.Runtime"))
Console.WriteLine("Running on Mono = " & runningOnMono.ToString)
When I run this on the Win7 dev machine it returns False i.e. not running on Mono. When I run the program on a Linux machine that only has Mono installalled it returns True.
I can reference parts of the Mono framework in VS and intellisense works, but when I make this call:
Dim monoinf As New Mono.Unix.UnixDriveInfo("g:")
I get this exception:
===================================
FileNotFoundException was unhandled: Could not load file or assembly 'Mono.Posix, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. The system cannot find the file specified.
===================================
Mono.Posix.dll version 4.0.0.0 does exist in many directories including the one created specifically for the VS Mono profile. I even tried copying it to the test app's directory.
Is it just that my mono install on the Win7 box is a mess? How can it be that intellisense works but the call to Type.GetType("Mono.Runtime") returns Nothing ?
The resaon I am trying to target Mono is because the class System.IO.DriveInfo does not work on Mono so I think I have to use Mono.Unix.UnixDriveInfo if I want to run on Windows and Linux. I need to get the free space of a USB flash drive.
Thanks for any help.
You already target Mono by following the blog post, but you should use mono.exe to launch your executable (test.exe as example) at Mono command prompt,
mono.exe test.exe
That's the only way Mono runtime is loaded instead of .NET Framework on Windows.
When I compile my project with the option to exclude runtime packages (to do a static library linking) everything goes fine.
But when I run my application on a C++ Builder "virgin" (no packages installed) it won't start and shows the following error:
The program can't start because CC32110MT.DLL is missing from your computer...
The CC32110MT.DLL is signed as a Embarcadero RAD Studio C++ Multi-thread RTL (WIN/VCL MT)
Any ideas of how to fix this other than copy the DLL to the target system?
In C++Builder, you have to disable both the Dynamic RTL and Runtime Packages in order to produce a fully statically-linked executable (in Delphi, there is no Dynamic RTL). You have only disabled the latter, but not the former yet.