Windows下编译Tangram-ES

源码

先下载源码

1
2
3
4
5
6
7
8
9
PS D:\Code> git clone https://github.com/tangrams/tangram-es.git
Cloning into 'tangram-es'...
remote: Enumerating objects: 64497, done.
remote: Counting objects: 100% (646/646), done.
remote: Compressing objects: 100% (287/287), done.
remote: Total 64497 (delta 317), reused 560 (delta 273), pack-reused 63851
Receiving objects: 100% (64497/64497), 39.53 MiB | 1.73 MiB/s, done.
Resolving deltas: 100% (46340/46340), done.
Updating files: 100% (1050/1050), done.

然后进入源码目录下载依赖仓库

1
2
cd tangram-es
git submodule update --init --recursive
submodule输出为
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Submodule 'external/benchmark' (https://github.com/google/benchmark) registered for path 'bench/benchmark'
Submodule 'external/SQLiteCpp' (https://github.com/SRombauts/SQLiteCpp.git) registered for path 'core/deps/SQLiteCpp'
Submodule 'external/alfons' (https://github.com/hjanetzek/alfons) registered for path 'core/deps/alfons'
Submodule 'core/dependencies/csscolorparser' (https://github.com/tangrams/css-color-parser-cpp) registered for path 'core/deps/css-color-parser-cpp'
Submodule 'core/include/earcut.hpp' (https://github.com/tangrams/earcut.hpp) registered for path 'core/deps/earcut'
Submodule 'core/dependencies/geojson-vt-cpp' (https://github.com/tangrams/geojson-vt-cpp.git) registered for path 'core/deps/geojson-vt-cpp'
Submodule 'external/harfbuzz-icu-freetype' (https://github.com/tangrams/harfbuzz-icu-freetype.git) registered for path 'core/deps/harfbuzz-icu-freetype'
Submodule 'core/include/isect2d' (https://github.com/tangrams/isect2d.git) registered for path 'core/deps/isect2d'
Submodule 'core/include/variant' (https://github.com/tangrams/variant) registered for path 'core/deps/variant'
Submodule 'external/yaml-cpp' (https://github.com/tangrams/yaml-cpp) registered for path 'core/deps/yaml-cpp'
Submodule 'external/glfw' (https://github.com/glfw/glfw) registered for path 'platforms/common/glfw'
Cloning into 'D:/Code/tangram-es/bench/benchmark'...
Cloning into 'D:/Code/tangram-es/core/deps/SQLiteCpp'...
Cloning into 'D:/Code/tangram-es/core/deps/alfons'...
Cloning into 'D:/Code/tangram-es/core/deps/css-color-parser-cpp'...
Cloning into 'D:/Code/tangram-es/core/deps/earcut'...
Cloning into 'D:/Code/tangram-es/core/deps/geojson-vt-cpp'...
Cloning into 'D:/Code/tangram-es/core/deps/harfbuzz-icu-freetype'...
Cloning into 'D:/Code/tangram-es/core/deps/isect2d'...
Cloning into 'D:/Code/tangram-es/core/deps/variant'...
Cloning into 'D:/Code/tangram-es/core/deps/yaml-cpp'...
Cloning into 'D:/Code/tangram-es/platforms/common/glfw'...
Submodule path 'bench/benchmark': checked out 'e776aa0275e293707b6a0901e0e8d8a8a3679508'
Submodule path 'core/deps/SQLiteCpp': checked out '4e3d36af2d4a612d548f5959532a7b97c9724e6b'
Submodule 'googletest' (https://github.com/google/googletest.git) registered for path 'core/deps/SQLiteCpp/googletest'
Cloning into 'D:/Code/tangram-es/core/deps/SQLiteCpp/googletest'...
Submodule path 'core/deps/SQLiteCpp/googletest': checked out '703bd9caab50b139428cea1aaff9974ebee5742e'
Submodule path 'core/deps/alfons': checked out '26a4dc693ad35609d4909141f763f1bad32e681f'
Submodule path 'core/deps/css-color-parser-cpp': checked out '1771826bc3a868e5e23e3ba6d2a024872218812d'
Submodule path 'core/deps/earcut': checked out '195b2fdae9a354c0f86592f320df4988c896f822'
Submodule 'glfw' (https://github.com/glfw/glfw.git) registered for path 'core/deps/earcut/glfw'
Cloning into 'D:/Code/tangram-es/core/deps/earcut/glfw'...
Submodule path 'core/deps/earcut/glfw': checked out '96cdcec58ac9ed6d6d9c7de26a1fc88a4f948d18'
Submodule path 'core/deps/geojson-vt-cpp': checked out '52c96b66467e9cf154509860a1b5ff936022f957'
Submodule '.mason' (https://github.com/mapbox/mason.git) registered for path 'core/deps/geojson-vt-cpp/.mason'
Cloning into 'D:/Code/tangram-es/core/deps/geojson-vt-cpp/.mason'...
Submodule path 'core/deps/geojson-vt-cpp/.mason': checked out 'fe6185ab2550d54d1581afe430d5c0f753072960'
Submodule path 'core/deps/harfbuzz-icu-freetype': checked out '67b579e42f6afb39646909af33f156a2cfe9d5e4'
Submodule path 'core/deps/isect2d': checked out '2e1a75cee09d9949900e926c61c86505b09205b2'
Submodule path 'core/deps/variant': checked out 'e26e56c3e7d5b819702ff71ee57d82be5b097f65'
Submodule '.mason' (https://github.com/mapbox/mason.git) registered for path 'core/deps/variant/.mason'
Cloning into 'D:/Code/tangram-es/core/deps/variant/.mason'...
Submodule path 'core/deps/variant/.mason': checked out '07179f160b96c72ddedbbe6bf82580d1a1d0091a'
Submodule path 'core/deps/yaml-cpp': checked out '49e11f16c1691a61f89367d8eb7dfa10d9153700'
Submodule path 'platforms/common/glfw': checked out '999f3556fdd80983b10051746264489f2cb1ef16'

依赖包

先按照vcpkg配置与使用配置vcpkg。

进入Tangram-es目录

执行

1
vcpkg install

它会自动安装一切依赖。

编译

生成工程

1
2
mkdir build #创建独立目录用于保存生成的文件
cmake -S . -B .\build -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=".\build" -DCMAKE_TOOLCHAIN_FILE="C:\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCPKG_MANIFEST_DIR="." # 生成S2019工程

参数:

  • S 源码位置
  • B 编译目录
  • G 生成参数
  • A 架构
  • CMAKE_BUILD_TYPE 编译类型
  • CMAKE_INSTALL_PREFIX 编译结果位置
  • CMAKE_TOOLCHAIN_FILE vcpkg工具链配置文件位置
  • VCPKG_MANIFEST_DIR vcpkg.json所在目录
生成输出为
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
-- Running vcpkg install
Detecting compiler hash for triplet x64-windows...
Compiler found: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe
The following packages will be built and installed:
benchmark:x64-windows@1.8.3#3
* brotli:x64-windows@1.1.0#1
* bzip2[core,tool]:x64-windows@1.0.8#5
curl[core,http2,non-http,schannel,ssl,sspi]:x64-windows@8.8.0#1
* egl-registry:x64-windows@2024-01-25
* freetype[brotli,bzip2,core,png,zlib]:x64-windows@2.13.2#1
glad[core,loader]:x64-windows@0.1.36
glfw3:x64-windows@3.4
harfbuzz[core,freetype,icu]:x64-windows@8.5.0#1
* icu[core,tools]:x64-windows@74.2#2
* libpng:x64-windows@1.6.43#2
* nghttp2:x64-windows@1.62.1
* opengl-registry:x64-windows@2024-02-10#1
* vcpkg-cmake:x64-windows@2024-04-23
* vcpkg-cmake-config:x64-windows@2024-05-23
* vcpkg-tool-meson:x64-windows@1.3.2#6
yaml-cpp:x64-windows@0.8.0#1
zlib:x64-windows@1.3.1
Additional packages (*) will be modified to complete this operation.
Restored 18 package(s) from C:\Users\Administrator\AppData\Local\vcpkg\archives in 1.1 s. Use --debug to see more details.
Installing 1/18 vcpkg-cmake-config:x64-windows@2024-05-23...
Elapsed time to handle vcpkg-cmake-config:x64-windows: 20.7 ms
vcpkg-cmake-config:x64-windows package ABI: 3f50421f5206fc2b75665fe1cec24b9325b9667e8f3c198962b9a79258fb6911
Installing 2/18 vcpkg-cmake:x64-windows@2024-04-23...
Elapsed time to handle vcpkg-cmake:x64-windows: 8.49 ms
vcpkg-cmake:x64-windows package ABI: c66bdd9a0d3da980fb091f3fa8dc01f56c4b3e4d169471cb343443b48bd0af31
Installing 3/18 benchmark:x64-windows@1.8.3#3...
Elapsed time to handle benchmark:x64-windows: 19.7 ms
benchmark:x64-windows package ABI: c1c27fbdece8b256ed302d5fbad7a2bd75f9fe614dbb12d2ddb2662bb50f024e
Installing 4/18 nghttp2:x64-windows@1.62.1...
Elapsed time to handle nghttp2:x64-windows: 13.3 ms
nghttp2:x64-windows package ABI: 3312e4811d16ec0c80855d498619f6bf1b2c7afcf36d25608867d08a9e0377b9
Installing 5/18 zlib:x64-windows@1.3.1...
Elapsed time to handle zlib:x64-windows: 14.6 ms
zlib:x64-windows package ABI: 4885856726cc49b53c12600875d07b531bfc66f378821b885aee7323b1fae067
Installing 6/18 curl[core,http2,non-http,schannel,ssl,sspi]:x64-windows@8.8.0#1...
Elapsed time to handle curl:x64-windows: 35.8 ms
curl:x64-windows package ABI: 2698ff16ec6ac98af75360a0b0dd1b90a41ff67fc2e3faa262b92c0fafa1fb79
Installing 7/18 egl-registry:x64-windows@2024-01-25...
Elapsed time to handle egl-registry:x64-windows: 16.4 ms
egl-registry:x64-windows package ABI: b6bfcc9ebfec2bb6743e43f6fd9f09e5a5b7d95ba182eb4ce651dd1ef7c1b33c
Installing 8/18 opengl-registry:x64-windows@2024-02-10#1...
Elapsed time to handle opengl-registry:x64-windows: 31 ms
opengl-registry:x64-windows package ABI: 247e6119230dbad32772c25be0aa43e8989dda5f331e1718f5b755ab2011fe27
Installing 9/18 glad[core,loader]:x64-windows@0.1.36...
Elapsed time to handle glad:x64-windows: 12.3 ms
glad:x64-windows package ABI: a9e3b46afafc5635e62f690774d344477c2fcb9f36244515c0b322eca6f95fde
Installing 10/18 glfw3:x64-windows@3.4...
Elapsed time to handle glfw3:x64-windows: 16.7 ms
glfw3:x64-windows package ABI: 3b26359c775c8d869dd2b1f4862486ecc76073583682ea21d965a5fc8dd7f27a
Installing 11/18 icu[core,tools]:x64-windows@74.2#2...
Elapsed time to handle icu:x64-windows: 242 ms
icu:x64-windows package ABI: 046bda7a6d2bbf90cf4c72d2bbbda72829379f4db0e3c8398ddc793c4254b6a4
Installing 12/18 libpng:x64-windows@1.6.43#2...
Elapsed time to handle libpng:x64-windows: 24.2 ms
libpng:x64-windows package ABI: a5bfb3d1cf406676f359588a4f25fd2d9b581d28b39260a9f2d504875a4863aa
Installing 13/18 bzip2[core,tool]:x64-windows@1.0.8#5...
Elapsed time to handle bzip2:x64-windows: 17.5 ms
bzip2:x64-windows package ABI: 0ef8f19940986acd13aa22e06222450590f16630c6932bb54509066c2b96f485
Installing 14/18 brotli:x64-windows@1.1.0#1...
Elapsed time to handle brotli:x64-windows: 39.1 ms
brotli:x64-windows package ABI: 5ee600496756013321f69aad7bf88fc2e3ba9eee97c8290e722339a46a92d254
Installing 15/18 freetype[brotli,bzip2,core,png,zlib]:x64-windows@2.13.2#1...
Elapsed time to handle freetype:x64-windows: 61.7 ms
freetype:x64-windows package ABI: a39606ae6d6fce824a43c0860c5f65c604a40a59689bf02b48dd93773bb7879d
Installing 16/18 vcpkg-tool-meson:x64-windows@1.3.2#6...
Elapsed time to handle vcpkg-tool-meson:x64-windows: 13.8 ms
vcpkg-tool-meson:x64-windows package ABI: ae05ec3f1ace0557e3d8fe3b3b7aca11c741781c6958ca1818ff98878a6bca7c
Installing 17/18 harfbuzz[core,freetype,icu]:x64-windows@8.5.0#1...
Elapsed time to handle harfbuzz:x64-windows: 75.6 ms
harfbuzz:x64-windows package ABI: c2faa7c67e85e806a66eed7b711f02dc4e6d3a088e8be93f8634984521ec2c30
Installing 18/18 yaml-cpp:x64-windows@0.8.0#1...
Elapsed time to handle yaml-cpp:x64-windows: 42.2 ms
yaml-cpp:x64-windows package ABI: 230b6a741a805b071462d442c790239ac3225b16c6528f3eda43a2f0e698c781
Total install time: 706 ms
benchmark provides CMake targets:

# this is heuristically generated, and may not be correct
find_package(benchmark CONFIG REQUIRED)
target_link_libraries(main PRIVATE benchmark::benchmark benchmark::benchmark_main)

benchmark provides pkg-config modules:

# Google microbenchmark framework
benchmark

The package zlib is compatible with built-in CMake targets:

find_package(ZLIB REQUIRED)
target_link_libraries(main PRIVATE ZLIB::ZLIB)

curl is compatible with built-in CMake targets:

find_package(CURL REQUIRED)
target_link_libraries(main PRIVATE CURL::libcurl)

glad provides CMake targets:

# this is heuristically generated, and may not be correct
find_package(glad CONFIG REQUIRED)
target_link_libraries(main PRIVATE glad::glad)

glfw3 provides CMake targets:

# this is heuristically generated, and may not be correct
find_package(glfw3 CONFIG REQUIRED)
target_link_libraries(main PRIVATE glfw)

glfw3 provides pkg-config modules:

# A multi-platform library for OpenGL, window and input
glfw3

The harfbuzz package provides CMake targets:

find_package(harfbuzz CONFIG REQUIRED)
target_link_libraries(main PRIVATE harfbuzz::harfbuzz harfbuzz::harfbuzz-subset)

yaml-cpp provides CMake targets:

# this is heuristically generated, and may not be correct
find_package(yaml-cpp CONFIG REQUIRED)
target_link_libraries(main PRIVATE yaml-cpp::yaml-cpp)

yaml-cpp provides pkg-config modules:

# A YAML parser and emitter for C++
yaml-cpp

-- Running vcpkg install - done
-- Selecting Windows SDK version 10.0.26100.0 to target Windows 10.0.19045.
-- The C compiler identification is MSVC 19.40.33811.0
-- The CXX compiler identification is MSVC 19.40.33811.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Use vcpkg: ON
-- Build type configuration:
-- No platform target specified. Choose a target with -DTANGRAM_PLATFORM=platform.
-- Using your OS as the platform target: windows.
-- Including platform CMake config file: platforms/windows/config.cmake
-- Found OpenGL: opengl32
-- Found ZLIB: optimized;D:/Code/tangram-es/build/vcpkg_installed/x64-windows/lib/zlib.lib;debug;D:/Code/tangram-es/build/vcpkg_installed/x64-windows/debug/lib/zlibd.lib (found suitable version "1.3.1", minimum required is "1")
CMake Deprecation Warning at platforms/common/glfw/CMakeLists.txt:5 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.


CMake Deprecation Warning at platforms/common/glfw/CMakeLists.txt:10 (cmake_policy):
The OLD behavior for policy CMP0042 will be removed from a future version
of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.


-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
-- Could NOT find Vulkan (missing: VULKAN_LIBRARY VULKAN_INCLUDE_DIR)
-- Using Win32 for window creation
-- Found ZLIB: optimized;D:/Code/tangram-es/build/vcpkg_installed/x64-windows/lib/zlib.lib;debug;D:/Code/tangram-es/build/vcpkg_installed/x64-windows/debug/lib/zlibd.lib (found version "1.3.1")
-- Found the following ICU libraries:
-- data (required): optimized
-- D:/Code/tangram-es/build/vcpkg_installed/x64-windows/lib/icudt.lib
-- debug
-- D:/Code/tangram-es/build/vcpkg_installed/x64-windows/debug/lib/icudtd.lib
-- Found ICU: D:/Code/tangram-es/build/vcpkg_installed/x64-windows/include (found version "74.2")
-- Found the following ICU libraries:
-- uc (required): optimized
-- D:/Code/tangram-es/build/vcpkg_installed/x64-windows/lib/icuuc.lib
-- debug
-- D:/Code/tangram-es/build/vcpkg_installed/x64-windows/debug/lib/icuucd.lib
-- Found ICU: D:/Code/tangram-es/build/vcpkg_installed/x64-windows/include (found suitable version "74.2", minimum required is "61")
CMake Deprecation Warning at core/deps/alfons/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.


-- Looking for GLM
-- GLM include D:/Code/tangram-es/core/deps/glm
CMake Deprecation Warning at core/deps/SQLiteCpp/CMakeLists.txt:7 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.


-- Using c++ standard c++11
-- CMake version: 3.29.2
-- Project version: 3.1.1
-- CMAKE_CXX_COMPILER 'C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe' 'MSVC' '19.40.33811.0'
-- CMAKE_CXX_FLAGS '/DWIN32 /D_WINDOWS /W3 /GR /EHsc'
-- CMAKE_CXX_FLAGS_DEBUG '/MDd /Zi /Ob0 /Od /RTC1'
-- CMAKE_CXX_FLAGS_RELEASE '/MD /O2 /Ob2 /DNDEBUG'
-- CMAKE_CXX_FLAGS_RELWITHDEBINFO '/MD /Zi /O2 /Ob1 /DNDEBUG'
-- CMAKE_CXX_FLAGS_MINSIZEREL '/MD /O1 /Ob1 /DNDEBUG'
-- Compile sqlite3 from source in subdirectory
-- SQLITECPP_RUN_CPPLINT OFF
-- SQLITECPP_RUN_CPPCHECK OFF
-- SQLITECPP_RUN_DOXYGEN OFF
-- SQLITECPP_BUILD_EXAMPLES OFF
-- SQLITECPP_BUILD_TESTS OFF
-- Configuring done (12.6s)
CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at core/CMakeLists.txt:236 (target_link_libraries):
The library that is being linked to, yaml-cpp, is marked as being
deprecated by the owner. The message provided by the developer is:

The target yaml-cpp is deprecated and will be removed in version 0.10.0.
Use the yaml-cpp::yaml-cpp target instead.

This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done (0.2s)
-- Build files have been written to: D:/Code/tangram-es/build

自动生成的VS工程

VS工程

编译中

1
cmake --build .\build # 编译

编译中

编译中

结果

编译完成后在Debug目录可以找到可执行文件

编译结果

Next Zen申请一个API KEY,从终端导入,

1
2
$env:NEXTZEN_API_KEY="key" #Win下
export NEXTZEN_API_KEY="key" #Linux下

tangram-es/scenes目录复制到程序目录,并重命名为res,运行程序

运行效果

程序

CSDN:Tangram-ES 0.17.1 64位 Debug/Release版 基于OpenGL地图渲染引擎

效果

效果演示

错误

错误1

编译报错

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
D:\Code\tangram-es\platforms\common\glfwApp.cpp(706,110): error C2664: “bool ImGui::InputFloat2(const char *,float [],c
onst char *,ImGuiInputTextFlags)”: 无法将参数 3 从“int”转换为“const char *” [D:\Code\tangram-es\build\tangram.vcxproj]
glfwApp.obj : error LNK2019: 无法解析的外部符号 "bool __cdecl ImGui::SliderAngle(char const *,float *,float,float,char const *,i
nt)" (?SliderAngle@ImGui@@YA_NPEBDPEAMMM0H@Z),函数 "void __cdecl Tangram::GlfwApp::showViewportGUI(void)" (?showViewportG
UI@GlfwApp@Tangram@@YAXXZ) 中引用了该符号 [D:\Code\tangram-es\build\tangram.vcxproj]
...
glfwApp.obj : error LNK2019: 无法解析的外部符号 "bool __cdecl ImGui::DebugCheckVersionAndDataLayout(char const *,unsigned __int6
4,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64)" (?DebugCheckVersionAndDataLayo
ut@ImGui@@YA_NPEBD_K11111@Z),函数 "void __cdecl Tangram::GlfwApp::create(class std::unique_ptr<class Tangram::Platform,st
ruct std::default_delete<class Tangram::Platform> >,int,int)" (?create@GlfwApp@Tangram@@YAXV?$unique_ptr@VPlatform@Tang
ram@@U?$default_delete@VPlatform@Tangram@@@std@@@std@@HH@Z) 中引用了该符号 [D:\Code\tangram-es\build\tangram.vcxproj]
imgui_impl_glfw.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl ImGuiIO::AddInputCharacter(unsigned int)" (?AddInp
utCharacter@ImGuiIO@@QEAAXI@Z),函数 "void __cdecl ImGui_ImplGlfw_CharCallback(struct GLFWwindow *,unsigned int)" (?ImGui_
ImplGlfw_CharCallback@@YAXPEAUGLFWwindow@@I@Z) 中引用了该符号 [D:\Code\tangram-es\build\tangram.vcxproj]
D:\Code\tangram-es\build\Debug\tangram.exe : fatal error LNK1120: 3 个无法解析的外部命令 [D:\Code\tangram-es\build\tangram.vcxpro
j]

Tangram-es源码自带了imgui代码,vcpkg.json里面也有一个imgui,而且比较新,把vcpkg.json字段删除就可以了。


Windows下编译Tangram-ES
https://feater.top/tangram-es/compile-tangram-es-under-windows/
作者
JackeyLea
发布于
2024年1月4日
许可协议