mingw - msys2 / mingw missing dynamic linker library
问题描述
I am attempting to build SpatiaLite in Msys2. The build goes well until it attempts to compile the examples. It throws an error because the linker cannot find the dynamic linker (dl) library. Is this something that I should expect msys2/mingw to support? Am I missing a package?
I build spatialite using
./configure && make
Here is the compiler/linker output
Making all in examples
make[2]: Entering directory '/home/myuser/libspatialite-4.3.0a/examples'
gcc -DHAVE_CONFIG_H -I. -I.. -I./../src/headers -g -O2 -MT demo1.o -MD -MP -MF .deps/demo1.Tpo -c -o demo1.o demo1.c
mv -f .deps/demo1.Tpo .deps/demo1.Po
/bin/sh ../libtool --tag=CC --mode=link gcc -I./../src/headers -g -O2 -L../src -lspatialite -lm -o demo1.exe demo1.o -L/mingw32/lib -lxml2 -lz -llzma -liconv -lws2_32 -lfreexl -liconv -lproj -lz -lsqlite3 -L/mingw32/lib -lgeos_c
libtool: link: gcc -I./../src/headers -g -O2 -o .libs/demo1.exe demo1.o -L../src /home/myuser/libspatialite-4.3.0a/src/.libs/libspatialite.a -L/mingw32/lib -lpthread -ldl -lxml2 -llzma -lws2_32 -lfreexl -liconv -lproj -lz -lsqlite3 -lgeos_c
C:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/7.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -ldl
collect2.exe: error: ld returned 1 exit status
make[2]: *** [Makefile:372: demo1.exe] Error 1
make[2]: Leaving directory '/home/myuser/libspatialite-4.3.0a/examples'
make[1]: *** [Makefile:473: all-recursive] Error 1
make[1]: Leaving directory '/home/myuser/libspatialite-4.3.0a'
make: *** [Makefile:380: all] Error 2
解决方案
msys2 需要mingw-w64-dlfcn
提供libdl.a
和libdl.dll.a
更多细节在这里
推荐阅读
- r - 在 R 中使用Integrate() 进行集成
- javascript - 获取数组中单个对象的索引或值
- mongodb - 遍历 MongoDB 中的列表
- javascript - fullcalendar 获取当前月份的开始和结束日期反应示例
- python - 矢量化读取 MongoDB
- entity-framework-core - EF Core 5.x + OData 7.5.6 - $Top 不在 EF 查询中插入 TOP
- python - Marshmallow:声明一个复杂的模式
- python-3.x - 如何使用 selenium webdriver 从网站上抓取链接 - python
- typescript - TypeScript 模块增强 - 将完整实例引用为“this”而不是子属性
- python - PPTK Python:是否可以实时可视化点云?