How to create a redistributable DLL that will work on other computers - c++

I'm trying to create a GUI that will try to interface with CAN peripherals connected to the computer and allow communication between the computer and a microcontroller. Most of the work is done in Java, but the CAN code is written in C++, and called from Java using JNI. I'm working with Visual Studio 2013 for the C++, and Eclipse for the Java.
The program works fine on the development computer, but I'm inexperienced with creating DLL's, and I can't get the program to run on another computer. I've used Dependency Walker to get an idea of what DLL's I should bundle with the application, and at this point I've included all the DLL's that it said were missing (there are a few it says are still missing, but it says these are missing on the development computer as well, and I believe this is just a problem with Dependency Walker).
The application folder contains a runnable jar file of the GUI, the DLL I created, and the dependent DLL's. I try to run the application from the command-line with "java -jar {application.jar}". I get the following error:
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: C:\Users\David\Dropbox\ATPBoardInterface\CANMessager7.dll: A dynamic link library (DLL) initialization routine failed
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1939)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1864)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1854)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1084)
at model.CANController.<clinit>(CANController.java:34)
at main.Main$1.run(Main.java:70)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:721)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:682)
at java.awt.EventQueue$3.run(EventQueue.java:680)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:691)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)
I'm looking for suggestions on how to resolve this issue. Something that I can share with any other Windows computer that will be easy for the end user to install and run.
Edit: If it makes any difference, the program relies on the use of National Instruments' CAN software. I've included a number of DLL's in the application folder related to this which Dependency Walker listed, but I'm not sure if that's enough. Maybe the target computer will need certain National Instruments software already installed for it to work, and if it's missing, that may be causing the DLL initialisation failure? I'm not familiar enough in this kind of area to be sure either way though.
Edit 2: This is what I've bundled inside my application folder:
20/08/2013 10:56 <DIR> .
20/08/2013 10:56 <DIR> ..
20/08/2013 08:26 427,170 ATPBoardInterface.jar
20/08/2013 09:28 182,928 CANMessager.lib
20/08/2013 08:52 201,728 CANMessager7.dll
15/08/2013 16:28 30,720 CANMessagerXP.dll
16/06/2013 21:11 966,224 msvcr120.dll
11/07/2006 18:35 348,160 msvcr71.dll
13/10/2012 11:00 655,872 msvcr90.dll
01/06/2011 17:59 45,192 Nican.dll
06/04/2010 17:44 72,224 NicanCfq.dll
06/04/2010 17:44 125,472 nicanDBA.dll
01/06/2011 17:59 197,784 NIcanFrm.dll
01/06/2011 17:59 18,080 NIcanpu.dll
01/06/2011 17:59 61,568 NicanTsk.dll
26/01/2012 15:54 19,632 nipal32.dll
26/01/2012 16:11 309,920 nipalu.dll
26/01/2012 15:53 12,968 nipalut.dll
19/08/2013 16:18 772 README.txt
20/08/2013 08:34 <DIR> res
20/08/2013 10:56 0 temp.txt
20/08/2013 09:43 6,494,784 vcredist_x86.exe
19 File(s) 10,171,198 bytes
3 Dir(s) 416,406,867,968 bytes free
I'm not sure which of these are necessary.

One problem could be a 32-/64-bit problem.
If your CAN interface DLL is a 32 bit DLL and you are running 64 bit Java this will not work. Running 64 bit DLLs with 32 bit Java will not work either.
The only solution would be to compile the DLL as 32 and 64 bit version and deliver both DLL versions.
If the 32/64 bits is not the problem you could use the SysInternals ProcessExplorer tool to see all file access attempts. In this case you would see if Java tries to access any DLL file that is not present.
A solution for the 32-/64-bit problem would be the use of a command line EXE file instead of a DLL file. The data is transferred using the standard output and input (on the C++ side) and using the InputStream and OutputStream of the java.lang.Process class on the Java side. This will always work with a 32 bit EXE file.

Related

MSTest C++ unit test dll not working

C# Unit Test - Runs ok
I have read the MSTest unit test (utterly useless )documentation on the microsoft website here: utterly-useless-ms-doc-link. Then I read a whole load of other more useful links (e.g. on SO) and finally I am able to run C# unit tests no problems, like this:
mstest /testcontainer:UnitTest.dll /detail:errormessage
C++ Unit Test - Fails
As far as I can tell this should be the same for the C++ unit tests, so I ran a similar command (specific command details at the end) for C++, but then I get the error:
UnitTest_TrackManager.dll Unable to load the test container
'UnitTest_TrackManager.dll' or one of its dependencies. If you build
your test project assembly as a 64 bit assembly, it cannot be loaded.
When you build your test project assembly, select "Any CPU" for the
platform. To run your tests in 64 bit mode on a 64 bit processor, you
must change your test settings in the Hosts tab to run your tests in a
32 bit process. Error details: Could not load file or assembly
'file:///D:\MiddlewareTest01\x64\Debug\UnitTest_TrackManager.dll'
or one of its dependencies. The module was expected to contain an
assembly manifest.
32-bit or 64-bit DLL?
So, fair enough, I have built the code for 64 bit and MStest is 32bit only. I used dumpbin /HEADERS fname.dll to check that this is a 64-bit file and it is:
File Type: DLL
FILE HEADER VALUES
8664 machine (x64)
D number of sections
5829E628 time date stamp Mon Nov 14 16:28:24 2016
0 file pointer to symbol table
0 number of symbols
F0 size of optional header
2022 characteristics
Executable
Application can handle large (>2GB) addresses
DLL
So, then I recompie for 32-bit and run the test again, but I get the same error. So I check that the file output (the DLL) is 32-bit and it does appear to be, here is the dumpbin for that:
File Type: DLL
FILE HEADER VALUES
14C machine (x86)
C number of sections
5829E792 time date stamp Mon Nov 14 16:34:26 2016
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
2102 characteristics
Executable
32 bit word machine
DLL
C++ Unit Test Works in the IDE
Using MSVS2015 IDE, I can compile and run my code/unit tests and they all work (when I use the x86 build) - and they all pass. If I select x64 build then it complains.
Specific Command That Fails
Here is the exact command line I am useing:
mstest /testcontainer:UnitTest_TrackManager.dll /detail:errormessage
It is run from the same location as the dll lives which is here:
D:\<somepath>\MiddlewareTest01\Debug\UnitTest_TrackManager.dll
Where <somepath> is just there to hide my PC/user details and MiddlewareTest01 is the solution folder.
As I say, I can get this to work for C# projects, but for C++ it does not seem to work in the same way.
Update
Using dependency-walker it tells me:
MICROSOFT.VISUALSTUDIO.TESTTOOLS.CPPUNITTESTFRAMEWORK.DLL was not found. Could this be an issue?

Dealing with decorated external binaries when building a package with Rcpp

I am using a Window 32-bit machine to compile an R package developed using Rcpp and compiled with Rtools 3.4 in RStudio 1.0.28. I keep getting an error about the # signs within the 32-bit external dll (NYCgeo.dll):
thefile.o:thefile.cpp:(.text+0x913): undefined reference to `_imp__NYCgeo#8'
collect2.exe: error: ld returned 1 exit status
Sure enough, when I opened the 32-bit NYCgeo.dll in a text editor, I found #8 suffix. This is weird because when I developed the 64-bit version, the 64-bit NYCgeo.dll did not contain #8 suffix and I did not have any errors. Anyway, I read about the --kill-at command and was wondering where I would include it. I tried RStudio's Configure Build Tools settings as well as my makevars.win.in file but had no luck.
Response to #Dirk
Updated title as requested.
I am compiling the package from within RStudio using Rtools so I assumed it might have something to do with RStudio's Project Options.
I have spent the past week checking existing documentation. This post, this post, and this post describe the issue I am having. My issue is that I do not know where to specify either "--kill-at" or "--add-stdcall-alias"
The whole point of my package is to leverage NYC Dept of City Planning's geocoding software. I did not "just throw" the binary NYCgeo.dll "into the mix." In fact, my 64-bit version of the package works fine. My issue is with developing the 32-bit version... specifically, the presence of an #8 suffix in the NYCgeo.dll binary which is causing an error.
NYCgeo.dll is a C binary. I am not using Visual Studio.
The previous question you mentioned dealt with creating Makevars files for the 64-bit version of my package (thanks again, #Coatless for providing useful information). The 64-bit NYCgeo.dll binary did not contain an #8 suffix.
UPDATE:
I tried to create a better title for this question. The question pertains to creating an R package which utilizes functionality from another piece of software... in my case, geocoding software. Specifically, the issue I experienced is that the 32-bit version of the geocoding software has a decorated dll files while the 64-bit version does not. A decorated binary contains # symbols which trigger an error during compiling. My task was to devise a way to demangle (not sure if that is a real word) the 32-bit dll but leave the 64-bit dll alone.
Many thanks.
Gretchen
The rJava package was incredibly helpful in understanding how to deal with decorated binaries.
I created a def file named NYCgeo.def and saved it in my src directory:
LIBRARY NYCGEO.DLL
EXPORTS
NYCgeo#8
I then updated my Makevars.win.in file which is also in my src directory:
GBAT_PATH = #GBAT_PATH#
GBAT_DLL = #GBAT_DLL#
PKG_LIBS = -L"$(GBAT_PATH)/Bin" -l$(GBAT_DLL)
PKG_CPPFLAGS = -I"$(GBAT_PATH)/Include"
ifeq "${R_ARCH}" "/i386"
$(SHLIB): $(OBJECTS) NYCGEO.a
NYCGEO.a: NYCGEO.def
$(DLLTOOL) -k -d NYCGEO.def -l NYCGEO.a -D "$(GBAT_PATH)/Bin/$(GBAT_DLL)" $(DT_ARCH)
endif
I am now able to compile the package on both 32-bit and 64-bit machines running Windows.

0xc000007b Error : how to analyze using Process Monitor

Another error at startup of my basic app which only tests my DLL (the core deliverable of my project) by calling its init method. I have analysed what happens using Process Monitor, and filtered according to process name, looking only for events related with my the main executable of my basic app.
What should I be looking for there ? I guess anything that says SUCCESS in the result column does not point to the problem - but what about the rest ? It seems to be looking for my DLL all over the world although it first tried in the current directory and found it there already ...
An excerpt here, saved from ProcMon in CSV format : http://pastebin.com/YHSeQUk0
As I said it tries to open my DLL in many places (following my PATH environment variable ?). When looking for it in the correct folder (which is the same as where the exe is located and running) it goes through a series of actions which mostly end up in SUCCESS (if not otherwise specified):
IRP_MJ_CREATE
IRP_MJ_CLEANUP
IRP_MJ_CLOSE
IRP_MJ_CREATE
FASTIO_ACQUIRE_FOR_SECTION_SYNCHRONIZATION (result is : FILE LOCKED
WITH ONLY READERS)
FASTIO_ACQUIRE_FOR_CC_FLUSH
FASTIO_ACQUIRE_FOR_SECTION_SYNCHRONIZATION (result is SUCCESS)
FASTIO_ACQUIRE_FOR_CC_FLUSH
It does all of this a second time later. To me this looks ok. No other DLL-related event show up.
There is this other event at the top :
RegOpenKey in HKLM\System\CurrentControlSet\Control\Srp\GP\DLL which first results in REPARSE and then in NAME NOT FOUND. But many things happen afterwards, this doesn't look like a blocking point - and anyhow no clue what this is about.
dumpbin /dependents ConsoleApplication1.exe yields the following :
File Type: EXECUTABLE IMAGE
Image has the following dependencies:
uss_map_interface.dll
VCRUNTIME140.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-math-l1-1-0.dll
api-ms-win-crt-stdio-l1-1-0.dll
api-ms-win-crt-locale-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
KERNEL32.dll
The first one is my dll. If I remove it the message at startup turns into "uss_map_interface.dll is missing from your computer" - so I cannot believe this woukld be related to my DLL ... all the other I found in Windows/System32 or SysWOW64.
I am compiling both my DLL and the test basic app with MVS Express 2015 (v140) with x64 configs. The problem also appears if I change to x86 configs. The funny thing also is that if I compile my DLL with MinGW in a Qt project - it works fine. If that can provide a hint, here follow the dependencies of the Qz/MinGW-compiled version :
File Type: DLL
Image has the following dependencies:
libgcc_s_dw2-1.dll
KERNEL32.dll
msvcrt.dll
libstdc++-6.dll
Anyhow, thanks in advance !

Running QT Creator's project .exe gives 0xc000007b error

I just started to learn QT Creator for a school project. my program runs fine in QT Creator
QT: 5.6.0 (MSVC 2015)
QT Creator 3.
but running the exe file outside of the IDE I get
"The application was unable to start correctly (0xc000007b). click ok to close application."
After googling around, this is not an issue of the app needing to be deployed (at least I think?) but an issue of mixing 32/64 bit libraries (which I don't know how I am only using QT stuff in my project)
So I was able to find out that I can use Dependency Walker to see what can be going wrong
After I run it, I get more issues that say errors detected check log file but I do get back results which I can't tell if there is any info on mixed 32/64 bit libs but i do get a lot of
"Error opening file. The system cannot find the file specified (2)
so here are the files that gave that error message
API-MS-WIN-CORE-APIQUERY-L1-1-0.DLL
API-MS-WIN-CORE-APPCOMPAT-L1-1-1.DLL
API-MS-WIN-CORE-APPINIT-L1-1-0.DLL
API-MS-WIN-CORE-ATOMS-L1-1-0.DLL
API-MS-WIN-CORE-COM-L1-1-0
API-MS-WIN-CORE-COM-L1-1-1.DLL
API-MS-WIN-CORE-COM-MIDLPROXYSTUB-L1-1-0.DLL
API-MS-WIN-CORE-COM-PRIVATE-L1-1-0.DLL
API-MS-WIN-CORE-COM-PRIVATE-L1-1-1.DLL
API-MS-WIN-CORE-COMM-L1-1-0.DLL
API-MS-WIN-CORE-CONSOLE-L1-1-0.DLL
API-MS-WIN-CORE-CONSOLE-L2-1-0.DLL
API-MS-WIN-CORE-CRT-L1-1-0.DLL
API-MS-WIN-CORE-CRT-L2-1-0.DLL
API-MS-WIN-CORE-DATETIME-L1-1-1.DLL
API-MS-WIN-CORE-DATETIME-L1-1-2.DLL
API-MS-WIN-CORE-DEBUG-L1-1-1.DLL
API-MS-WIN-CORE-DELAYLOAD-L1-1-1.DLL
API-MS-WIN-CORE-ENCLAVE-L1-1-0.DLL
API-MS-WIN-CORE-ERRORHANDLING-L1-1-1.DLL
API-MS-WIN-CORE-ERRORHANDLING-L1-1-3.DLL
API-MS-WIN-CORE-FIBERS-L1-1-1.DLL
API-MS-WIN-CORE-FIBERS-L2-1-1.DLL
API-MS-WIN-CORE-FILE-L1-2-1.DLL
API-MS-WIN-CORE-FILE-L1-2-2.DLL
API-MS-WIN-CORE-FILE-L2-1-1.DLL
API-MS-WIN-CORE-FILE-L2-1-2.DLL
API-MS-WIN-CORE-HANDLE-L1-1-0.DLL
API-MS-WIN-CORE-HEAP-L1-2-0.DLL
API-MS-WIN-CORE-HEAP-L2-1-0.DLL
API-MS-WIN-CORE-HEAP-OBSOLETE-L1-1-0.DLL
API-MS-WIN-CORE-INTERLOCKED-L1-2-0.DLL
API-MS-WIN-CORE-IO-L1-1-1.DLL
API-MS-WIN-CORE-JOB-L1-1-0.DLL
API-MS-WIN-CORE-JOB-L2-1-0.DLL
API-MS-WIN-CORE-KERNEL32-LEGACY-L1-1-1.DLL
API-MS-WIN-CORE-KERNEL32-LEGACY-L1-1-4.DLL
API-MS-WIN-CORE-KERNEL32-PRIVATE-L1-1-1.DLL
API-MS-WIN-CORE-KERNEL32-PRIVATE-L1-1-2.DLL
API-MS-WIN-CORE-LARGEINTEGER-L1-1-0.DLL
API-MS-WIN-CORE-LIBRARYLOADER-L1-2-0.DLL
API-MS-WIN-CORE-LIBRARYLOADER-L1-2-1.DLL
API-MS-WIN-CORE-LIBRARYLOADER-L2-1-0.DLL
API-MS-WIN-CORE-LOCALIZATION-L1-2-1.DLL
API-MS-WIN-CORE-LOCALIZATION-L1-2-2.DLL
API-MS-WIN-CORE-LOCALIZATION-L2-1-0.DLL
API-MS-WIN-CORE-LOCALIZATION-OBSOLETE-L1-3-0.DLL
API-MS-WIN-CORE-LOCALIZATION-PRIVATE-L1-1-0.DLL
API-MS-WIN-CORE-MEMORY-L1-1-2.DLL
API-MS-WIN-CORE-MISC-L1-1-0.DLL
API-MS-WIN-CORE-NAMEDPIPE-L1-2-0.DLL
API-MS-WIN-CORE-NAMEDPIPE-L1-2-2.DLL
API-MS-WIN-CORE-NAMESPACE-L1-1-0.DLL
API-MS-WIN-CORE-NORMALIZATION-L1-1-0.DLL
API-MS-WIN-CORE-PATH-L1-1-0.DLL
API-MS-WIN-CORE-PERFCOUNTERS-L1-1-0.DLL
API-MS-WIN-CORE-PRIVATEPROFILE-L1-1-1.DLL
API-MS-WIN-CORE-PROCESSENVIRONMENT-L1-2-0.DLL
API-MS-WIN-CORE-PROCESSSNAPSHOT-L1-1-0.DLL
API-MS-WIN-CORE-PROCESSTHREADS-L1-1-2.DLL
API-MS-WIN-CORE-PROCESSTHREADS-L1-1-3.DLL
API-MS-WIN-CORE-PROCESSTOPOLOGY-L1-2-0.DLL
API-MS-WIN-CORE-PROFILE-L1-1-0.DLL
API-MS-WIN-CORE-PSAPI-ANSI-L1-1-0.DLL
API-MS-WIN-CORE-PSAPI-L1-1-0.DLL
API-MS-WIN-CORE-PSM-KEY-L1-1-0.DLL
API-MS-WIN-CORE-QUIRKS-L1-1-0.DLL
API-MS-WIN-CORE-REALTIME-L1-1-0.DLL
API-MS-WIN-CORE-REGISTRY-L1-1-0.DLL
API-MS-WIN-CORE-REGISTRY-L1-1-1.DLL
API-MS-WIN-CORE-REGISTRYUSERSPECIFIC-L1-1-0.DLL
API-MS-WIN-CORE-RTLSUPPORT-L1-2-0.DLL
API-MS-WIN-CORE-SHLWAPI-LEGACY-L1-1-0.DLL
API-MS-WIN-CORE-SHLWAPI-OBSOLETE-L1-2-0.DLL
API-MS-WIN-CORE-SIDEBYSIDE-L1-1-0.DLL
API-MS-WIN-CORE-STRING-L1-1-0.DLL
API-MS-WIN-CORE-STRING-L2-1-0.DLL
API-MS-WIN-CORE-STRING-L2-1-1.DLL
API-MS-WIN-CORE-STRING-OBSOLETE-L1-1-0.DLL
API-MS-WIN-CORE-STRINGANSI-L1-1-0.DLL
API-MS-WIN-CORE-SYNCH-L1-1-0.DLL
API-MS-WIN-CORE-SYNCH-L1-2-0.DLL
API-MS-WIN-CORE-SYNCH-L1-2-1.DLL
API-MS-WIN-CORE-SYSINFO-L1-2-1.DLL
API-MS-WIN-CORE-SYSINFO-L1-2-3.DLL
API-MS-WIN-CORE-SYSTEMTOPOLOGY-L1-1-0.DLL
API-MS-WIN-CORE-THREADPOOL-L1-2-0.DLL
API-MS-WIN-CORE-THREADPOOL-LEGACY-L1-1-0.DLL
API-MS-WIN-CORE-THREADPOOL-PRIVATE-L1-1-0.DLL
API-MS-WIN-CORE-TIMEZONE-L1-1-0.DLL
API-MS-WIN-CORE-URL-L1-1-0.DLL
API-MS-WIN-CORE-UTIL-L1-1-0.DLL
API-MS-WIN-CORE-VERSION-L1-1-0.DLL
API-MS-WIN-CORE-VERSIONANSI-L1-1-0.DLL
API-MS-WIN-CORE-WINDOWSERRORREPORTING-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-ERROR-L1-1-1.DLL
API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL
API-MS-WIN-CORE-WOW64-L1-1-0.DLL
API-MS-WIN-CORE-WOW64-L1-1-1.DLL
API-MS-WIN-CORE-XSTATE-L2-1-0.DLL
API-MS-WIN-CRT-CONVERT-L1-1-0.DLL
API-MS-WIN-CRT-ENVIRONMENT-L1-1-0.DLL
API-MS-WIN-CRT-FILESYSTEM-L1-1-0.DLL
API-MS-WIN-CRT-HEAP-L1-1-0.DLL
API-MS-WIN-CRT-LOCALE-L1-1-0.DLL
API-MS-WIN-CRT-MATH-L1-1-0.DLL
API-MS-WIN-CRT-MULTIBYTE-L1-1-0.DLL
API-MS-WIN-CRT-RUNTIME-L1-1-0.DLL
API-MS-WIN-CRT-STDIO-L1-1-0.DLL
API-MS-WIN-CRT-STRING-L1-1-0.DLL
API-MS-WIN-CRT-TIME-L1-1-0.DLL
API-MS-WIN-CRT-UTILITY-L1-1-0.DLL
API-MS-WIN-DEVICES-CONFIG-L1-1-1.DLL
API-MS-WIN-EVENTING-CLASSICPROVIDER-L1-1-0.DLL
API-MS-WIN-EVENTING-CONSUMER-L1-1-0.DLL
API-MS-WIN-EVENTING-CONTROLLER-L1-1-0.DLL
API-MS-WIN-EVENTING-OBSOLETE-L1-1-0.DLL
API-MS-WIN-EVENTING-PROVIDER-L1-1-0.DLL
API-MS-WIN-SECURITY-APPCONTAINER-L1-1-0.DLL
API-MS-WIN-SECURITY-AUDIT-L1-1-1.DLL
API-MS-WIN-SECURITY-BASE-L1-2-0.DLL
API-MS-WIN-SECURITY-BASE-PRIVATE-L1-1-1.DLL
API-MS-WIN-SECURITY-SDDL-L1-1-0.DLL
API-MS-WIN-SERVICE-CORE-L1-1-1.DLL
API-MS-WIN-SERVICE-CORE-L1-1-2.DLL
API-MS-WIN-SERVICE-MANAGEMENT-L1-1-0.DLL
API-MS-WIN-SERVICE-MANAGEMENT-L2-1-0.DLL
API-MS-WIN-SERVICE-PRIVATE-L1-1-0
API-MS-WIN-SERVICE-PRIVATE-L1-1-1.DLL
API-MS-WIN-SERVICE-PRIVATE-L1-1-2.DLL
API-MS-WIN-SERVICE-WINSVC-L1-2-0.DLL
API-MS-WIN-SHELL-SHELLCOM-L1-1-0.DLL
API-MS-WIN-SHELL-SHELLFOLDERS-L1-1-0.DLL
API-MS-WIN-STORAGE-EXPORTS-EXTERNAL-L1-1-0.DLL
API-MS-WIN-STORAGE-EXPORTS-INTERNAL-L1-1-0.DLL
API-MS-WIN-APPMODEL-IDENTITY-L1-2-0.DLL
API-MS-WIN-APPMODEL-RUNTIME-INTERNAL-L1-1-0.DLL
API-MS-WIN-APPMODEL-RUNTIME-L1-1-0.DLL
API-MS-WIN-APPMODEL-RUNTIME-L1-1-1.DLL
API-MS-WIN-APPMODEL-UNLOCK-L1-1-0.DLL
API-MS-WIN-BASE-UTIL-L1-1-0.DLL
API-MS-WIN-CORE-CALENDAR-L1-1-0.DLL
API-MS-WIN-CORE-COM-L2-1-1.DLL
API-MS-WIN-CORE-DEBUG-L1-1-0.DLL
API-MS-WIN-CORE-DELAYLOAD-L1-1-0.DLL
API-MS-WIN-CORE-ERRORHANDLING-L1-1-0.DLL
API-MS-WIN-CORE-FIBERS-L1-1-0.DLL
API-MS-WIN-CORE-FILE-L1-1-0.DLL
API-MS-WIN-CORE-FILE-L1-2-0.DLL
API-MS-WIN-CORE-FILE-L2-1-0.DLL
API-MS-WIN-CORE-HEAP-L1-1-0.DLL
API-MS-WIN-CORE-INTERLOCKED-L1-1-0.DLL
API-MS-WIN-CORE-IO-L1-1-0.DLL
API-MS-WIN-CORE-KERNEL32-LEGACY-L1-1-0.DLL
API-MS-WIN-CORE-LIBRARYLOADER-L1-1-0.DLL
API-MS-WIN-CORE-LOCALIZATION-L1-1-0.DLL
API-MS-WIN-CORE-LOCALIZATION-L1-2-0.DLL
API-MS-WIN-CORE-LOCALIZATION-OBSOLETE-L1-2-0.DLL
API-MS-WIN-CORE-LOCALREGISTRY-L1-1-0.DLL
API-MS-WIN-CORE-MARSHAL-L1-1-0.DLL
API-MS-WIN-CORE-MEMORY-L1-1-0.DLL
API-MS-WIN-CORE-PROCESSENVIRONMENT-L1-1-0.DLL
API-MS-WIN-CORE-PROCESSTHREADS-L1-1-0.DLL
API-MS-WIN-CORE-PROCESSTHREADS-L1-1-1.DLL
API-MS-WIN-CORE-PROCESSTOPOLOGY-OBSOLETE-L1-1-0.DLL
API-MS-WIN-CORE-PSM-APPNOTIFY-L1-1-0.DLL
API-MS-WIN-CORE-REALTIME-L1-1-1.DLL
API-MS-WIN-CORE-REGISTRY-PRIVATE-L1-1-0.DLL
API-MS-WIN-CORE-RTLSUPPORT-L1-1-0.DLL
API-MS-WIN-CORE-SHUTDOWN-L1-1-1.DLL
API-MS-WIN-CORE-SYSINFO-L1-1-0.DLL
API-MS-WIN-CORE-SYSINFO-L1-2-0.DLL
API-MS-WIN-CORE-TOOLHELP-L1-1-0.DLL
API-MS-WIN-CORE-VERSION-L1-1-1.DLL
API-MS-WIN-CORE-VERSION-PRIVATE-L1-1-0.DLL
API-MS-WIN-CORE-VERSIONANSI-L1-1-1.DLL
API-MS-WIN-CORE-WINRT-ERRORPRIVATE-L1-1-1.DLL
API-MS-WIN-CORE-WINRT-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-PROPERTYSETPRIVATE-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-PROPERTYSETPRIVATE-L1-1-1.DLL
API-MS-WIN-CORE-WINRT-REGISTRATION-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-ROBUFFER-L1-1-0.DLL
API-MS-WIN-COREUI-SECRUNTIME-L1-1-0.DLL
API-MS-WIN-CRT-PRIVATE-L1-1-0.DLL
API-MS-WIN-DEVICES-QUERY-L1-1-1.DLL
API-MS-WIN-DOWNLEVEL-ADVAPI32-L1-1-0.DLL
API-MS-WIN-DOWNLEVEL-ADVAPI32-L2-1-0.DLL
API-MS-WIN-DOWNLEVEL-KERNEL32-L2-1-0.DLL
API-MS-WIN-DOWNLEVEL-NORMALIZ-L1-1-0.DLL
API-MS-WIN-DOWNLEVEL-OLE32-L1-1-0.DLL
API-MS-WIN-DOWNLEVEL-SHELL32-L1-1-0.DLL
API-MS-WIN-DOWNLEVEL-SHLWAPI-L1-1-0.DLL
API-MS-WIN-DOWNLEVEL-SHLWAPI-L2-1-0.DLL
API-MS-WIN-DOWNLEVEL-SHLWAPI-L2-1-1.DLL
API-MS-WIN-DOWNLEVEL-USER32-L1-1-0.DLL
API-MS-WIN-DOWNLEVEL-VERSION-L1-1-0.DLL
API-MS-WIN-DX-D3DKMT-L1-1-0.DLL
API-MS-WIN-DX-D3DKMT-L1-1-1.DLL
API-MS-WIN-EVENTING-LEGACY-L1-1-0.DLL
API-MS-WIN-EVENTING-TDH-L1-1-0.DLL
API-MS-WIN-EVENTLOG-LEGACY-L1-1-0.DLL
API-MS-WIN-GDI-DPIINFO-L1-1-0.DLL
API-MS-WIN-MM-JOYSTICK-L1-1-0.DLL
API-MS-WIN-MM-MISC-L1-1-1.DLL
API-MS-WIN-MM-MISC-L2-1-0.DLL
API-MS-WIN-MM-MME-L1-1-0.DLL
API-MS-WIN-MM-TIME-L1-1-0.DLL
API-MS-WIN-NTUSER-IE-MESSAGE-L1-1-0.DLL
API-MS-WIN-NTUSER-SYSPARAMS-L1-1-0.DLL
API-MS-WIN-OLE32-IE-L1-1-0.DLL
API-MS-WIN-POWER-SETTING-L1-1-0.DLL
API-MS-WIN-RTCORE-NTUSER-CLIPBOARD-L1-1-0.DLL
API-MS-WIN-RTCORE-NTUSER-PRIVATE-L1-1-0.DLL
API-MS-WIN-RTCORE-NTUSER-PRIVATE-L1-1-1.DLL
API-MS-WIN-RTCORE-NTUSER-SYNCH-L1-1-0.DLL
API-MS-WIN-RTCORE-NTUSER-WINDOW-L1-1-0.DLL
API-MS-WIN-RTCORE-NTUSER-WINEVENT-L1-1-0.DLL
API-MS-WIN-RTCORE-OLE32-CLIPBOARD-L1-1-0.DLL
API-MS-WIN-SECURITY-ACCESSHLPR-L1-1-0.DLL
API-MS-WIN-SECURITY-ACTIVEDIRECTORYCLIENT-L1-1-0.DLL
API-MS-WIN-SECURITY-ACTIVEDIRECTORYCLIENT-L1-1-1.DLL
API-MS-WIN-SECURITY-BASE-L1-1-0.DLL
API-MS-WIN-SECURITY-CREDENTIALS-L1-1-0.DLL
API-MS-WIN-SECURITY-CREDENTIALS-L2-1-0.DLL
API-MS-WIN-SECURITY-CRYPTOAPI-L1-1-0.DLL
API-MS-WIN-SECURITY-GROUPPOLICY-L1-1-0.DLL
API-MS-WIN-SECURITY-LSALOOKUP-L1-1-1.DLL
API-MS-WIN-SECURITY-LSALOOKUP-L1-1-2.DLL
API-MS-WIN-SECURITY-LSALOOKUP-L2-1-1.DLL
API-MS-WIN-SECURITY-LSAPOLICY-L1-1-0.DLL
API-MS-WIN-SECURITY-PROVIDER-L1-1-0.DLL
API-MS-WIN-SECURITY-SDDLPARSECOND-L1-1-0.DLL
API-MS-WIN-SERVICE-WINSVC-L1-1-0.DLL
API-MS-WIN-SHCORE-COMHELPERS-L1-1-0.DLL
API-MS-WIN-SHCORE-OBSOLETE-L1-1-0.DLL
API-MS-WIN-SHCORE-STREAM-L1-1-0.DLL
API-MS-WIN-SHCORE-STREAM-WINRT-L1-1-0.DLL
API-MS-WIN-SHCORE-SYSINFO-L1-1-0.DLL
API-MS-WIN-SHCORE-THREAD-L1-1-0.DLL
API-MS-WIN-SHCORE-UNICODEANSI-L1-1-0.DLL
API-MS-WIN-SHELL-SHDIRECTORY-L1-1-0.DLL
DEVICELOCKHELPERS.DLL
EMCLIENT.DLL
EXT-MS-MF-PAL-L2-1-0.DLL
EXT-MS-ONECORE-APPCHROMEAPI-L1-1-0.DLL
EXT-MS-ONECORE-APPMODEL-PLM-L1-1-0.DLL
EXT-MS-ONECORE-APPMODEL-VEVENTDISPATCHER-L1-1-0.DLL
EXT-MS-ONECORE-DCOMP-L1-1-0.DLL
EXT-MS-ONECORE-ORIENTATION-L1-1-0.DLL
EXT-MS-ONECORE-P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S-WIN-WLAN-ONEXUI-L1-1-0.DLL
IESHIMS.DLL
API-MS-WIN-APPMODEL-STATE-L1-2-0.DLL
API-MS-WIN-CORE-PSM-KEY-L1-1-1.DLL
API-MS-WIN-CORE-REGISTRY-L2-2-0.DLL
API-MS-WIN-POWER-BASE-L1-1-0.DLL
API-MS-WIN-SECURITY-CAPABILITY-L1-1-0.DLL
API-MS-WIN-SHCORE-REGISTRY-L1-1-1.DLL
API-MS-WIN-SHCORE-SCALING-L1-1-1.DLL
API-MS-WIN-SHLWAPI-IE-L1-1-0.DLL
API-MS-WIN-SHLWAPI-WINRT-STORAGE-L1-1-0.DLL
API-MS-WIN-SHLWAPI-WINRT-STORAGE-L1-1-1.DLL
here is this just in case it is needed
so now I am at the point where I tried looking up the files missing and read I should install, "Visual C++ Redistributable for Visual Studio 2015"
but I have it already installed along with 2010 and every version up
I have Visual studios 2015 enterprise installed with everything with it
SO now I am just lost on what to do now
You can solve this on your development PC by adding the path to your qt bin directory. For example for mingw it might be somthing like:
C:\Qt\Qt5.5.1\5.5\mingw492_32\bin
For MSVC it will be a little different (don't have an MSVC install handy so can't remember the path.
Note You should only really use this for your development PC, but if you want to create a "deployable" version (i.e. copy it to different PCs) then you will need to copy all the dll's that your project uses and put them into the same folder as your executable.
For example: You need to copy the required dll's from here (using mingw as an example):
C:\Qt\Qt5.5.1\5.5\mingw492_32\bin
Into the folder where your executable lives (again just an example):
D:\software\build-qtGuiTestApp-Desktop_Qt_5_5_0_MinGW_32bit-Release\release
You can copy the dll's that are shown in your dependancy walker for a start. For MSVC you might want your deployment to actually install msvc redest to save you copying the dll's - but then you need to ensure the path is all setup etc...
This link has some more good information with lots of various compiler specific notes: here
Note 2 Infact see this question of mine for usage (look at mikes answer as well) of windeployqt here

DOS-reported error: Bad file number

I have a batch file that tries to compile a static library using Borland C++ Builder 6.0
It is called from Borland make (makefile created with bpr2mak) which is called from a .bat file (used to compile the whole project with Visual Studio and some Borland C++ Builder legacy projects), which is called from a bash shell script running inside Cygwin.
When I run the .bat file directly from a Cygwin shell, it runs OK, but when its being run from a Program calling cygwin with Boost::Process::launcher I'm getting this error:
C:\ARQUIV~1\Borland\CBUILD~1\Bin\..\BIN\TLib /u bclibs.lib #MAKE0000.###
DOS-reported error: Bad file number
TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation
opening 'MAKE0000.###'
** error 1 ** deleting bclibs.lib
It's a complicated scenario, but this Program which calls cygwin is run whenever we need to build our software package which needs to be build for various Linux distos and Windows 32 and 64-bit.
Note: It's the only Borland Project failing, the other compile just fine (it's the only static library using borland also, so it can be some problem with the TLib tool.
The problem was that TLib does not like to have his output redirected (seen here) without having an input pipe as well. Solved by creating an input pipe to in the Boost::Process::launcher using set_stdin_behavior
I'm just guessing here, but this may have to do with long filenames and/or spaces in paths.
1) Modify your makefile so it would save current environment to a file, immediately before executing the failing command (set > d:\env.txt & echo CD=%CD% >> d:\env.txt). Then run it both ways (directly and via program) and compare the environments of good run and bad run.
2) Using filemon from Sysinternals, capture logs of disk access in both cases (these logs are going to be huge, though you can uncheck everything except Open in the filter to reduce the size). Again, compare and check for clues...
3) Try instaling everything involved to paths conforming to 8.3 scheme.
This error is not related to C++ itself. It happens when your build script opens too much files (more than defined in DOS command processor environment). To resolve this issue try to set value of files variable to 253. For Windows XP this variable defined in the file %WINDIR%\system32\config.nt.
files=253
Seems it is known bug in Borland C++ tools. Here is description and possible workaround for this issue:
Problem: Some static Lib projects will
not link correctly when compiled. You might see something
like this :
J:\Borland\CBUILD~1\bin\..\BIN\TLib /u debug\jpegD.lib #MAKE0000.###
DOS-reported error: Bad file number
TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation
opening 'MAKE0000.###'
** error 1 ** deleting debug\jpegD.lib
MAKE failed, returned : 1
Workaround : In some cases (where the "Bad file number" error is seen) it may be possible to work around this by specifying -tDEFLIB.BMK in the BPR2MAKE Options field, and Turning off the "Capture Make Output" option.
I have not tested it, but I hope that helps.