Click here to Skip to main content
15,741,981 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have been using Borland compiler since early 1990s. In 2000 I installed Borland command line tools (Borland C++ 5.5 for Win32 and Turbo Incremental Link 5.0) and started learning Win32 API. My applications ran on Windows 98, XP, 7, 8 and certain versions of 10.
Recently I discovered a problem with my latest super-duper Dell laptop, which has the following version of OS:

Edition Windows 10 Pro
Version 21H1
Installed on ‎11/‎3/‎2021
OS build 19043.1826
Experience Windows Feature Experience Pack 120.2212.4180.0


When I try to launch a program on it, it gives me this message:
The code execution cannot proceed because OLDAAPI32.dll was not found. Reinstalling the program may fix this problem.

At the same time, the library OLDAAPI32.lib is not only statically linked to the executable file, but it is also present in the same project folder. For some reason the OS does not see the linked static code and expects a DLL version of it.

Another Windows 10,
Windows 10 Enterprise LTSC, (c) 2018
does not have an issue with the same executable file.

Please advise.
Thank you.

What I have tried:

I ran the same program on two different computers with different subversions of Windows 10. Only one of them gave me the error described above.
Posted
Updated 5-Aug-22 10:21am
Comments
0x01AA 4-Aug-22 14:37pm    
Are the W10 where it works W10/32 and your super-duper Dell is W10/64?
SMDtheone 5-Aug-22 16:38pm    
All the computers I mentioned are Win 10/64.
I do not know if Win 10/32 even exists.
And all 32-bit software (usually found in "C:\Program Files (x86)" folder) runs perfectly fine on 64-bit hardware.
0x01AA 5-Aug-22 16:59pm    
What for is OLDAAPI32.dll? Btw. I'm also working with Borland then and when.
Afzaal Ahmad Zeeshan 4-Aug-22 14:44pm    
It would be one heck of a reason to use Borland C++ 5.5. :-)

If you are building a new application, maybe better to use a different framework that's more Windows?
SMDtheone 5-Aug-22 16:48pm    
I see no problem here.
Bcc55 is a compiler, it deals with ones and zeros, I deal with the rest.

Windows is an operating system, which is comprised of built-in functions (kernel, UI, SDK).
Theoretically, those functions can be compiled into binary code even with a pencil and paper.

I am programming for fun, not for money. I love to learn what exactly is going on during the program execution, the stuff which "visual drag-and-droppers and C-sharpers" have no idea about :-)

You can't combine 32 bit DLL's with 64 bit apps, or vice versa: the word size must be the same for all components within the app.

I'd strongly suggest that you look at migrating to a more modern compiler / IDE / Framework as it's will really take the pain out of future work - have a look at Visual Studio, the Community edition is free for private use / small businesses and fully featured. It'll also build 32 and 64 bit apps for various frameworks including .NET

Alternatively, install a 32 bit VM on your new lappie, and install Borland in that - it'll run as if it "owns" the whole machine, but it's run whatever OS you are familiar with and Borland runs under. Bear in mind that modern OS's are a lot more security conscious than older ones, and some things that you (and quite possibly Borland) could get away with in the 90's require elevated permissions now - for example, the Registry is nowhere near as "open" as it was in Win 95, and it is not permitted to write files any old where for antivirus / malware reasons.
 
Share this answer
 
Comments
SMDtheone 5-Aug-22 0:34am    
Thank you very much for your reply!
Just to clarify:
1) The application is 32 bit and the static libraries used (not DLLs) are all 32 bit. The 64-bit operating systems have no problem running 32-bit applications. The only thing in this combination is the presence of certain versions of Windows 10.
2) I recently installed a suite of the latest Borland IDE and the whole overhead that came with it. Guess what? The make file specifies the calls to the same command-line compiler and linker, each one only of a slightly higher version, with the same command-line parameters.
3) My business is in hardware control at the level of machine code, in real time. I write some subroutines in Assembly, and with that in mind, the farther I am from the abstractions brought in by the pure C++, C# or .NET framework, the better I feel :-)
4) I understand that modern OS can almost "disassemble" and scrutinize any file before permitting it to pass, for security reasons, but my program is not just getting blocked, it triggers a clear message about expecting dynamic libraries instead of static ones. And this is something new with Windows 10.
5) It is an interesting idea to "play" with a VM. I'll give it a try.
Another possibility is the .DLL you're trying to load has dependencies on other .DLL's that are not present on the machine. You can see the dependencies using "Dependency Walker (depends.exe[^]".

It may also be possible that newer runtimes may not work with the old libraries.
 
Share this answer
 
Comments
SMDtheone 5-Aug-22 0:46am    
Thank you, Dave!
Clarification:
My program is not using any DLLs. And I know for fact from the hardware manufacturer that their static libraries do not contain any calls for DLLs on a given system. The entire OEM-supplied SDK includes just two static libraries, one of which was mentioned in my original post. Of course, I can make a DLL version of each one of them, and see what happens (on my to-do list out of curiosity).
Win 10 does not give me an error, only a request for a missing DLL, and I am trying to understand why it needs a DLL for the code which has already been statically linked to the executable file.
The Dependency Walker is a new thing to me. I will see what it is, thank you very much!
SMDtheone 5-Aug-22 0:53am    
Correction:
"...their static libraries do not contain any calls for DLLs on a given system" - which are not part of a standard Windows installation or their own software installation.
Your program is either not using a static library: the .lib file that you are linking to contains only the definitions of the external references that you program is using. At run time the program requires OLDAAPI32.dll to be loaded in order to run. You need to check the documentation for your compiler(s) to see how to use an actual static library.

Or, the static library/libraries that you are using require the existence of that dll.

[edit]
According to Google this dll is available for download from a couple of websites, but it does not explain what it is for. I can only assume your program is trying to access some third-party device or library.
[/edit]
 
Share this answer
 
v3
You better install some modern toolchain, or: "Wellcome in DLL hell" (ho-ho-ho)

You may spend tons of hours and wont find a solution. Choose some other tools to avoid waiste of time and a bunch of headaches.

My best advice is: to install some VM which simulates your release OS and find the tools for it. If it is Windows 10 than use Visual Studio.
 
Share this answer
 
Solution 3 - this is it.
Thank you, Richard!

I checked with OEM's documents, it turns out that .dll libraries are part of the software package installed in support of the device I am working with (a multi-function data acquisition interface).

And I agree with Karsten (Solution 4) - "Wellcome in DLL hell" (ho-ho-ho)

Loading on start vs. loading on demand, the trouble with C and C++ conventions
extern "C" int __declspec(dllexport) WINAPI ...
I remember going nuts learning all that, but it was a long time ago.

So the "problem" has nothing to do with Windows 10. It turned out, that out of all the computers I tested only one had the proper libraries installed for the device support, and that is why it worked.
 
Share this answer
 
Comments
Richard MacCutchan 6-Aug-22 4:28am    
It's always worth checking the fine print. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900