Visual studio compiles 32 bit application but links to 64 bit windows libraries. How to use 32 bit libraries instead?

Albertine, Thomas 1 Reputation point
2021-06-15T22:21:08.637+00:00

I'm using visual studio 2013, and trying to build a 32 bit application that will run on older 32 bit lab machines running windows 7, and eventually newer 64 bit lab machines that will be running 64 bit windows 10. The machine I have to develop with right now is a 64 bit windows 7.

I've cloned our repo and I built the project without issue, but when I try to run it, I get an error about a library or it's dependencies not being 32 bit windows applications. I've determined that all of our C# projects are configured to run as Win32, and all the C++ projects are configured to run as x86, but this does not resolve the error.

I tried opening up the executable using a dependency walker program. I couldn't execute it, so I couldn't see DLLs that get loaded during normal execution, including the ones we produce, but I did notice that our application was 32 bit, but all the Windows DLLs are 64 bit, which seems like it would be a problem.

I opened our DLLs as well and ran into the same situation. The DLL was built as 32 bit, but all the windows libraries were 64 bit.

Am I correct in my understanding that this is a problem, and how can I change the solution to use 32 bit windows libraries?

Windows for business | Windows Client for IT Pros | User experience | Other
Developer technologies | C++
Developer technologies | C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.