NotepadNext
                                
                                
                                
                                    NotepadNext copied to clipboard
                            
                            
                            
                        Can't start: MSVCP140.dll missing
When I install Notepad Next v0.6.3 on a clean Windows 10 machine, I get the error:
I guess it requires Microsoft Visual C++ Redistributable Packages for Visual Studio 2015? Ideally, the installer would either fetch the redistributable or throw an error to notify the user that this is a requirement (also, that seems like a pretty outdated dependency). Ideally, such shenanigans wouldn't even be needed (e.g. if you eliminate such dependencies and ship whatever is required with the installer).
It's already being looked into. I already raised an issue on this.
Ideally, such shenanigans wouldn't even be needed
I look forward to your pull request fixing such "shenanigans" without the need to bloat the installer.
I look forward to your pull request fixing such "shenanigans" without the need to bloat the installer.
I ship a similar piece of software in ~20MB. It uses GTK3 and the GNU toolchain and contains everything in the installer. I admit that I don't know Qt well but perhaps a similar thing is possible with NotepadNext? The dependency on the redistributable just seems like a blemish, for example it defeats the purpose of the per-user install that doesn't require admin rights because you need admin rights to install the redistributable. Anyway, I did not mean to diminish your work. A truly cross-platform Notepad++ is a thing the world needs.
Hmm... How does Notepad++ avoid the dependency on the Visual C++ Redistributable with its tiny 4.2MB installer? Perhaps like this? They do seem to link statically.
I admit that I don't know Qt well but perhaps a similar thing is possible with NotepadNext
I'm definitely not a Qt expert either. There may be other stuff the NSIS installer can do. I took a crack at this a bit ago to get it to download the installer and run it in the fly. I had mixed results and got too busy to put any more time into it.
I did not mean to diminish your work. A truly cross-platform Notepad++ is a thing the world needs.
Understood. This entire project is a huge learning experience for me...so I'm grateful for any help people are willing to contribute.
How does Notepad++ avoid the dependency on the Visual C++ Redistributable
I've wondered the same thing myself since I don't recall these kinds of issues being reported with Notepad++.
They do seem to link statically.
CMake isn't their official build system so that may not be the same when it is built with visual studio.
CMake isn't their official build system so that may not be the same when it is built with visual studio.
Seems to be the same in the Visual Studio solution. Perhaps the elimination of the redistributable dependency is just a few options/clicks away.
Perhaps the elimination of the redistributable dependency is just a few options/clicks away.
Interesting...this may address the root issue then. The changes should be simple enough but haven't had time to even boot up my dev machine for a few weeks...so hopefully I can get around to this eventually or someone can submit a PR. I think it should be something like this in the qmake file:
msvc:QMAKE_CXXFLAGS_RELEASE += /MT
msvc:QMAKE_CXXFLAGS_DEBUG += /MTd
                                    
                                    
                                    
                                
You can try a zip build of the application statically linked here:
https://github.com/dail8859/NotepadNext/suites/15858669490/artifacts/904907341
If someone could test this and verify it works, that would be great since I don't have access to a clean install of Windows anywhere.
Can anyone verify this fix?
I have no way to test this myself.
I can take a look within the next few days :+1:
I can take a look within the next few days :+1:
Greatly appreciated!
I tried to access the link
https://github.com/dail8859/NotepadNext/suites/15858669490/artifacts/904907341
but I get a 404 error. Hence, I was unable to test it.
By the way: Anyone can test this with a clean Windows virtual machine.
@BenjaminRi Weird...
Try this link: https://github.com/dail8859/NotepadNext/suites/15858669490/artifacts/916495554
Try this link: https://github.com/dail8859/NotepadNext/suites/15858669490/artifacts/916495554
Still the same thing, it doesn't find the libraries.
Still the same thing, it doesn't find the libraries.
Thanks for trying it. Looking at the GitHub action and also my machine I can confirm that the PR doesn't change the /MD flag.
I tweaked it on my development machine and I'm getting the compiler to use the /MT flag as expected now. However, my concern now is this linker warning:
LIBCMT.lib(initializers.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
My assumption is this is because the Qt DLLs are linked to the dynamic runtime, even if the exe itself is using the static runtime. Short of custom compiling the Qt DLLs to use the static runtime, I'm not sure if there is a way to solve this to not rely on the Visual C++ Redistributable.
Maybe I'm misunderstanding the exact nature of the error as this is all an educated guess. Even if this does run I'd be quite concerned to publish the app built this way.
If interested, another build to test:
https://github.com/dail8859/NotepadNext/suites/16556741509/artifacts/945757281
https://github.com/dail8859/NotepadNext/suites/16556741509/artifacts/945757281
Same issue again. I believe that the person who works on this needs to be able to test it themselves. This is easily done with a Windows VM (Microsoft distributes them free of charge) or a second PC.
Same issue again.
Getting back to my prior point...this fix may not be possible due to the Qt DLLs
Same issue again.
Getting back to my prior point...this fix may not be possible due to the Qt DLLs
Then the installer needs to install MSVC++ redistributable. If NotepadNext just doesn't run after installation, people are not going to use it. Unfortunately, I'm involved in too many other projects to have time to fix this.