You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Building & Installing from source in Windows platform
2
2
```
3
-
last updated: 2020-10-10
4
-
tested at: 2020-10-09
3
+
last updated: 2020-10-11
4
+
tested at: 2020-10-11
5
5
```
6
6
7
7
## Prerequisite
8
8
9
-
The steps are tested under this envionment. Please prepare these installed.
9
+
The steps are tested under this environment. Please prepare these installed.
10
10
11
11
```
12
12
Windows 10 (64 bit)
@@ -24,15 +24,15 @@ libwebp 1.1.0 windows-x64
24
24
25
25
## Notes on install Cmake
26
26
27
-
In order to run Cmake in `CMD`, please make sure `PATH envionment variable` contains the folder of Cmake. eg: `C:\Program Files\CMake\bin`
27
+
In order to run Cmake in `CMD`, please make sure `PATH environment variable` contains the folder of Cmake. eg: `C:\Program Files\CMake\bin`
28
28
29
29
One may check this by by running `echo %PATH%` in CMD.
30
30
31
31
32
32
## Notes on install OpenCV
33
33
34
34
The folder location of OpenCV is important. This program depends on this library.
35
-
The downloaded OpenCV file is usually an archive (self-extracting archive). Please extract to a certain folder. eg: `D:\opencv` (i.e. the `opencv extrated folder`)
35
+
The downloaded OpenCV file is usually an archive (self-extracting archive). Please extract to a certain folder. eg: `D:\opencv` (i.e. the `opencv extracted folder`)
36
36
37
37
Copy files listed below from folder `D:\opencv\build\x64\vc15\bin` to `System32 folder`. One may need Administrator right of the Windows system to do so.
38
38
```
@@ -43,62 +43,72 @@ opencv_world3411d.dll
43
43
opencv_world3411d.pdb
44
44
```
45
45
46
-
**Alternatively**, one may add the path of OpenCV binary (eg: `D:\opencv\build\x64\vc15\bin`) to `PATH envionment variable`. You may refer to this [web page](https://www.deciphertechnic.com/install-opencv-with-visual-studio/).
46
+
**Alternatively**, one may add the path of OpenCV binary (eg: `D:\opencv\build\x64\vc15\bin`) to `PATH environment variable`. You may refer to this [web page](https://www.deciphertechnic.com/install-opencv-with-visual-studio/).
47
47
48
48
49
+
## Notes on install libwebp, using `vcpkg`
49
50
50
-
## Notes on install libwebp
51
+
It is known that `libwebp` uses pthread in Linux/MacOS platforms, the equivalence in Windows would be `pthreadVC3`.
51
52
52
-
It locates within `Repo folder`, eg: `D:\splitwebp\3rdparty\libwebp\lib\windows-x64`
53
-
54
-
Please note that, in Windows, you need to rename the files if you download libwebp from [here](https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html):
53
+
In Windows, you need to rename the files if you download libwebp from [here](https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html):
55
54
```
56
55
libwebp.lib -> webp.lib
57
56
libwebpdemux.lib -> webpdemux.lib
58
57
libwebpmux.lib -> webpmux.lib
59
58
```
60
59
60
+
There is a tool named `vcpkg`, a product developed by Microsoft for managing packages for Visual Studio C++ project, it handles it automatically. Please refer the steps from this [web page](https://github.com/microsoft/vcpkg#quick-start-windows). It is advised to clone the vcpkg repository to `splitwebp` root directory, i.e. the folder of `vcpkg` would be `D:\splitwebp\vcpkg`
61
+
62
+
Alternatively, you may need to modify this line: `link_directories("vcpkg/installed/x64-windows/lib")` in CMakeLists.txt accordingly.
63
+
61
64
62
65
## Steps to compile
63
66
64
67
1. Prepare the prerequisite
65
68
66
-
2. Clone this repository to `Repo folder`, eg: `D:\splitwebp`
69
+
2. Clone this repository to `splitwebp` root directory, eg: `D:\splitwebp`
67
70
68
-
3. Create a new folder named `build` under `Repo folder`, eg: `D:\splitwebp\build` (i.e. the `build folder`)
71
+
3. Create a new folder named `build` under `splitwebp` root directory, eg: `D:\splitwebp\build` (i.e. the `build folder`)
69
72
70
73
4. Open `CMD`, change the current directory to `build folder`
71
74
72
-
5. Run `cmake .. && cmake -DCMAKE_GENERATOR_PLATFORM=x64 --build .`
75
+
5. Run `.\vcpkg install pthreads:x64-windows libwebp[core,nearlossless,simd,unicode]:x64-windows`
73
76
74
-
6.Visit Windows Explorer in `build folder`. Open the Visual Studio Project by double clicking `splitwebp.vcxproj`
7.Change Project properties (Solution Explorer > right click `splitwebp` > Properties)
79
+
7.Visit Windows Explorer in `build folder`. Open the Visual Studio Project by double clicking `splitwebp.vcxproj`
77
80
78
-
7.1. pointing Include folder of OpenCV
81
+
8. Change Project properties (Solution Explorer > right click `splitwebp` > Properties)
82
+
83
+
8.1. pointing Include folder of OpenCV
79
84
80
85
In Properties, go to C/C++ > Additional Include Directories > click on the value and see a pull down menu > click Edit.. > click New Line. And add these paths:
81
86
82
-
(if your `opencv extrated folder` is `D:\opencv`)
87
+
(if your `opencv extracted folder` is `D:\opencv`)
83
88
84
89
D:\opencv\build\include
85
-
D:\opencv\build\include\opencv
86
-
D:\opencv\build\include\opencv2
90
+
D:\splitwebp\vcpkg\installed\x64-windows\include
87
91
88
-
7.2. remove `/machine:x86` to build for x64 platform (64 bit). Delete `/machine:x86` in Additional Option, and click Apply.
92
+
8.2. remove `/machine:x86` to build for x64 platform (64 bit). Delete `/machine:x86` in Additional Option, and click Apply.
89
93

90
94
95
+
8.3. Add project Environment variable
96
+
97
+
go to Debugging > go to Environment > click on the value and see a pull down menu > click Edit.. > click New Line. And add these paths:
Solution: Turn on `Microsoft Symbol Servers` for debugging symbol. Please refer to this [web page](https://docs.microsoft.com/en-us/visualstudio/debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger?view=vs-2019) for further details.
110
120
121
+
3)> webp.dll not found
111
122
112
-
## Glossory
113
-
-`CMD` Command Prompt in Windows, accept user's command. Run it by: Start Menu => search "cmd" => click "Command Prompt" OR Start Menu > "Run" > type "cmd" > press Enter
123
+
Solution: Press Alt F7 > go to Debugging > go to Environment > click on the value and see a pull down menu > click Edit.. > click New Line. And add these paths:
114
124
115
-
-`Repo folder` The folder of this repository cloned into your local machine. eg: `D:\splitwebp`
-`CMD` Command Prompt in Windows, accept user's command. Run it by: Start Menu => search "cmd" => click "Command Prompt" OR Start Menu > "Run" > type "cmd" > press Enter
116
129
117
130
-`build folder` The folder where the Visual Studio project generated by Cmake locates at. eg: `D:\splitwebp\build`
118
131
119
-
-`PATH envionment variable` This contains the paths that Windows system would try to find out the executive files to run when a user enter a command in CMD. One can view the content by running `echo %PATH%` in CMD.
132
+
-`PATH environment variable` contains the paths that Windows system would try to find out the executive files to run when a user enter a command in CMD. One can view the content by running `echo %PATH%` in CMD.
120
133
121
134
-`System32 folder` An important folder for Windows to run. It contains system files and libraries binary. It usually locates at `C:\Windows\System32`
122
135
123
-
-`opencv extrated folder` eg: `D:/opencv`
136
+
-`opencv extracted folder` eg: `D:/opencv`
124
137
125
-
-`OPENCV_DIR` This is the path where the library files locates at. It should be inside sub-folders in `opencv extrated folder`, eg: `D:/opencv/build/x64/vc15/lib`
138
+
-`OPENCV_DIR` This is the path where the library files locates at. It should be inside sub-folders in `opencv extracted folder`, eg: `D:/opencv/build/x64/vc15/lib`
0 commit comments