简体   繁体   中英

C++: MFC Application on both Windows 10 x64 & Windows 7 x64

I'm building MFC Application with CLR which can run on windows 10 x64 & windows 7 x64 and execute without installing Visual Studio. First, I've tried to find a solution for app without installing visual studio. After some works on google, I found some clues to this issue. Release build doesn't require installing Visual Studio. I was building the project on windows 10 x64. So the release version can work on other windows 10 pcs without Visual Studio. But it can't work on Windows 7. So I've got stuck in search on this issue until now and I found something. "Build applications for both Windows 7 and Windows 10 with Visual Studio 2015" is a thing I found here. The answer is right thing I've tried. On their comment, I saw one word - CMake. I'm not sure that I can accomplish my solution with this - CMake. Is there someone to told about this thing? Or anyway to fix this issue?

Thank you.

CMake won't help you.

I think you'll need to install Visual C++ Redistributable for Visual Studio 2015 on any machine where Visual Studio was not installed, if the redistbutable package was not installed yet.

You also need to use .NET framwork which installed on both machines, I guess .NET 4 is good enough.

EDIT:

Try to run your exe from a console, and check if there is some print for missing dll or something.

Anyway, you can use dependency walker to check if you're missing some dlls, (download the x64 version) drag&drop your exe into it and check what prevent it from run.

Now, I found right solution about this m own question. As a matter of fact, @SHR is helpful for this answer, but there's something to modify for right solution. Installing .NET 4.0 is right and it's mandatory for working on Windows 10 & 7 x64. But "Visual C++ Redistributable for Visual Studio 2015" should not be necessary. Without these packages, the app can executes on windows 7 & 10 x64. Of course, the app requires some dlls in C++ Redistributable packages. But not all. So I put dlls the app requires at the same directory of .exe file. That's all. There's no other requirements.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM