civetweb without C++ redistributable?

127 views
Skip to first unread message

photomedia

unread,
Oct 13, 2015, 8:09:43 PM10/13/15
to civetweb
Is it possible to install/use/deploy civetweb without the need to install the C++ redistributable exe?
I've been reading about deploying without the need for vcredist_x86.exe and I can't seem to figure out the best way to proceed about this.
Civetweb is a win32 console app, right?  Does that mean we could just recompile it with the required libraries linked statically/included in the civetweb.exe?


bel

unread,
Oct 14, 2015, 3:17:27 PM10/14/15
to civetweb
Hello,

On Windows, CivetWeb is not a console app, but using the "Windows" subsystem. It does not open a console by default, but adds an icon to the systray (in the windows task bar next to the clock). There is a Win32 and a Win64 build.

The pre-built versions you can download on sourceforge dynamically link the C library - either in 32 or 64 bit. They actually only use C, not C++, so you should only need the mscvrt###.dll - which one exactly depends on the version.

You could build CivetWeb with the C library statically liked, then you will not need any redistributables. The current source is available at github. Previous releases are available on sourceforge and the last few releases on github as well.

If you just want to avoid the need to install the redistributables (e.g., missing administrator rights), there are other ways that should work without the need to rebuild anything. You would just need to copy the required dll files in the same directory as the executable.
Windows automatically searches for dll files in directory the exe file is located. I did not try this on my own and I did not read the license details of the redistributables - probably you should give it a try.

Tomasz Neugebauer

unread,
Oct 16, 2015, 11:14:57 AM10/16/15
to civetweb
Thank you for the helpful info/explanation, it is all starting to make sense to me now.  I'm still confused about this part: "you should only need the mscvrt###.dll - which one exactly depends on the version", when you say depends on the version, you mean the version of the operating system ( Windows 7, 8, Vista, 10)?  Or do you mean the 32 or 64 bit version of Civetweb?

Tomasz

bel

unread,
Oct 16, 2015, 1:27:50 PM10/16/15
to civetweb


On Friday, October 16, 2015 at 5:14:57 PM UTC+2, Tomasz Neugebauer wrote:
I'm still confused about this part: "you should only need the mscvrt###.dll - which one exactly depends on the version", when you say depends on the version, you mean the version of the operating system ( Windows 7, 8, Vista, 10)?  Or do you mean the 32 or 64 bit version of Civetweb?

I actually meant the CivetWeb version:
It does not depend on the operating system - although some operating systems have some older versions of the redistributables preinstalled. It depends on the Visual Studio version (actually the SDK version) used to build civetweb. There are different redistributables for every Visual Studio version. For the pre-built executables you can download from SourceForge, the Visual Studio version depends on the CivetWeb release version. Sometimes within one release the 32 bit version and the 64 bit versions used different Visual Studio versions (reason: long story).

There are three ways to find out which version you need:
- It is written in the "installing.md" documentation of the version you download
- You can just start the executable, look for an error message like "can not start because msvcrt100.dll is missing" and add the dll
- The most sophisticated way to find missing DLLs is to use a free tool called "Dependency Walker". It shows all DLLs used by an executable or DLL. This actually works for every program, not just for civetweb.


As an info: This is the relation between Visual Studio Version and MSVCRT


Reply all
Reply to author
Forward
0 new messages