Error when running QDB2 driver on deployment machine - c++

I am using Win7 and db2 express. I have successfully compiled and used the db2 drivers on one of my machines, but when trying to use it on another computer that does not have db2 installed the driver won't run and return an empty string as an error.
Just to make sure I copied everything from ibm/sqllib/bin to a directory that can be found on the computer I use for deployment and dependency walker confirms that indeed the qsqldb2 driver can find the libraries inside that directory.
Yet the problem remains and my app won't run properly, any ideas on how to solve this error?

I am yet not sure if this classifies as an answer or not but, even though in my development machine it worked fine with the libraries inside ibm/sqllib/bin. The way I made it work on my deployment machine is by instead providing it with the libraries coming with the clidriver.

Related

How to - Get Oracle.ManagedAccess driver to work with Installed VB.Net Application

I have a 32bit Application to Install on Win10 (x64 OS). All my Oracle functionality works from within the debugger. Oracle.ManagedAccess driver is correctly registered in the VS Projects and the application works as expected from within the debugger. However, when I build my WiX-Based install pack and run the installed application I get the following error:
What am I missing here? In the previous VS2013 incarnation of the code as recently as last month using the ODP.NET driver 'Oracle.DataAcess', the application worked fine when installed. I'm at a loss as to where else to take this. Any assistance most welcome.
Based on input from Stein Asmul, I jave resolved the problem. Solution simply involved including the Oracle.ManagedDataAccess.ddl in the product.wxs depositing the file in the application folder solved the problem.

C++ MySQL error in libmysql.dll

I've made an app in C++ that uses mysql to connect to a server, but when I send it to my friends to test it, this is what they get:
libmysql.dll is either not designed to run on Windows or it contains an error.
It works completely fine on my pc, I even tried sending another libmysql.dll, same error persists. How can I fix this?
Most likely, libmysql.dll is either 64-bit and he is using a 32-bit operating system, or it is depending on other DLLs that aren't installed on his system.
There is a tool called dependency walker that will help you track down that kind of problem, but it is designed for advanced users and in short you should probably install the mysql client using a mysql installer instead.

Error STATUS_BAD_NETWORK_PATH when running qt executables through developer studio

I have searched and found no answer to this
I have a weird problem when running executables through developer studio (2008): a basic 'hello world' exe works OK when created through the usual dev studio project creation mechanism, but when trying to run a library based program the software crashes with STATUS_BAD_NETWORK_PATH. The program uses Qt and zlib behind the scenes and is written in C++, but (as far as I'm aware) is not dependent on any particular network locations on initialisation; we do have Sophos installed on the PC too.
The weird thing is that one cant even step into the main: the program fails well before this with the error. If we plug the network in, it starts up just fine ... The odd thing is this only occurs on a specific 64 bit Windows 7 machine.
Does anyone have any tips as to how to trace where the issue is? We've tried tracking using procmon but it is not very revealing; no obvious failures up to the point where the program crashes.
We have now figured out the answer. It transpired that there were 2 issues:
Firstly a wrapper .bat script that was launching developer studio was setting the PATH environment variable: a location in this path was being specified using a UNX style path (e.g. \\a\location\somewhere) rather than a mapped drive. The executables were not actually using this location but when the network was unplugged this it seems that this was disrupting things from dev studio
This, in tandem with a network configuration error on the PC, meant that deep down in the runes, something was failing.
So - advice if you see such an error
Check your PATH and make sure it is sensible
Look in your PC's configuration logs, and see if you can see any networking issues
...

wxWidgets running on other machine

I created application which uses wxWidgets library using visual studio 2008. Now I would like to create version which may be run on other machine.
Because right now when I want to run It on another machine there is an error:
the application failed to start because its side-by-side configuration is incorrect.
What can I do to make It work ?
The Event Viewer should have a record showing what DLL was being searched for, what version of that DLL if found in the SxS cache, and what version it was looking for but couldn't find. You'll then want to (for example) include the correct version of that DLL to be installed with your program. Alternatively, just link to virtually everything statically -- it'll make your executable a lot bigger, but eliminate a lot of problems like this relatively painlessly.

0xc000007b "The application was unable to start correctly" error?

I've written a C++ console application in Visual Studio 2019 and am trying to deploy it to another windows laptop. Both laptops are up-to-date with 64 bit Windows 10, and my target laptop has installed/up-to-date .NET Framework, vc_redist.x64.exe, and DirectX.
In terms of deployment method, I followed this Microsoft walkthrough word for word, with the added step of ensuring that my newly created "setup" project was also targeting x64 platform, since some of the external libraries in my code required x64. The resulting "setup" .exe/.msi pair work as planned on the source laptop - installs and runs with no frills required.
Installation goes fine on the target laptop, but launching the program gives the error mentioned in the title of this post. After a few hours of trying to figure it out, I think I have an idea where the problem is coming from, but first, I'll share what I've tried, which is basically every recommendation found by googling this error code:
clean boot
SFC scan
chkdsk c: /f /r
repairing/fresh installing all of the frameworks mentioned in the first paragraph
running both the application installer and the installed application as administrator
restarting laptop and reinstalling application after all of those changes
What I think is the root of the problem:
In the setup/deployment project in VS, three of the "detected dependencies" (MSVCP140D.dll, ucrtbased.dll, VCRUNTIME140D.dll) have filepaths through …\System32\ rather than the identical dependencies that could be found in …\SysWOW64. The other two detected dependencies are external 64-bit DLLs (which is why I specified my entire project to x64). When I run my application through Dependency Walker, it agrees that the three formerly mentioned dependencies are "wrong CPU type", while the two latter ones are fine. This scenario does not, however, explain to me why install/run (outside of VS) works fine on the source laptop (shouldn't it not work if VS is packaging a mix of 32 and 64 bit dependencies?). In fact, running the application through Dependency Walker on the source laptop reveals the exact same thing as on the target laptop - the same 3 dependencies are "wrong CPU type", yet the application runs here.
I do not see an option in VS to change the "setup" project to read the 64 bit filepath. I have tried manually swapping in the 64-bit DLLs at various stages (including restarting the computer between DLL swap and application run), which did not seem to have any effect. In fact, I tried replacing the 3 relevant DLLs in the System32 folder with the DLLs from the SysWOW64 folder (my idea of a cheap workaround for not being able to change the filepath - just change the file) and this just caused me to get the same error on my source laptop as I had been getting on my target laptop.
All of this stuff is relatively new to me, so please let me know if I'm foolishly overlooking some fundamental detail with my process/project - at this point it would be nice if that were the case and this is easy to fix.
Wrote this before I noticed the above comment had already answered.
Just leaving it in.
Debug Binary: Looks like you have deployed a debug version of your binary (The D in the file name: MSVCP140D.dll). Try to compile in Release mode and deploy the new binary.
Cause: Debug binaries generally need the debug-versions of the VCRedist binaries to exist on the box you try to run the binary - they are only available on developer PCs with the SDK (and / or Visual Studio) installed. That error message: 0xc000007b means "STATUS_INVALID_IMAGE_FORMAT".
Tips: There are some resource links here and some tips on how to debug deployment problems.