File tree Expand file tree Collapse file tree 1 file changed +12
-19
lines changed Expand file tree Collapse file tree 1 file changed +12
-19
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,18 @@ matplotlib-cpp
4
4
Welcome to matplotlib-cpp, possibly the simplest C++ plotting library.
5
5
It is built to resemble the plotting API used by Matlab and matplotlib.
6
6
7
+ ## 编译matplotlib-cpp
7
8
9
+ ### Windows
10
+
11
+ ``` bash
12
+ mkdir build
13
+ cd build
14
+ cmake .. -G " Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX=..\d ist
15
+ %comspec% /k " C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
16
+ msbuild /maxcpucount:4 /p:Configuration=Release /p:PreferredToolArchitecture=x64 ALL_BUILD.vcxproj
17
+ msbuild /maxcpucount:4 /p:Configuration=Release /p:PreferredToolArchitecture=x64 INSTALL.vcxproj
18
+ ```
8
19
9
20
Usage
10
21
-----
@@ -17,25 +28,7 @@ int main() {
17
28
plt::show();
18
29
}
19
30
```
20
- **一般方式编译**
21
-
22
- ```bash
23
- g++ minimal.cpp -std=c++11 -I/usr/include/python2.7 -lpython2.7 -o minimal
24
- ```
25
-
26
- ** Anaconda方式编译**
27
-
28
- ``` bash
29
- g++ minimal.cpp \
30
- -std=c++11 \
31
- -I${CONDA_PREFIX} /include/python3.7m \
32
- -I${CONDA_PREFIX} /lib/python3.7/site-packages/numpy/core/include \
33
- -L${CONDA_PREFIX} /lib
34
- -lpython3.7m \
35
- -o minimal
36
- ```
37
-
38
- 如果是` python3.8 ` ,那么相关地方修改成` 3.8 ` 即可。在运行的时候,必须把` libpython3.7m.so ` 的目录放在` LD_LIBRARY_PATH ` 中,否则` mininal ` 程序无法运行。
31
+ g++ minimal.cpp -std=c++11 -I/usr/include/python2.7 -lpython2.7
39
32
40
33
**Result:**
41
34
You can’t perform that action at this time.
0 commit comments