我正在尝试在Msys2中构建SpatiaLite。构建进展顺利,直到尝试编译示例。它会抛出错误,因为链接器找不到动态链接器 (dl) 库。这是我应该期望 msys2/mingw 支持的东西吗?我是不是少了一个包裹?
我使用构建spatialite
./configure && make
Run Code Online (Sandbox Code Playgroud)
这是编译器/链接器输出
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 …Run Code Online (Sandbox Code Playgroud) 我有以下代码,其中正在加载的共享库作为预编译的二进制文件提供.它是用linaro工具链编译的.
gbm_create_device(int fd)
{
struct gbm_device *gbm = NULL;
void *module;
const struct gbm_backend *backend = NULL
module = dlopen("/usr/lib/gbm/gbm_pvr.so", RTLD_NOW | RTLD_GLOBAL);
backend = dlsym(module, "gbm_backend");
gbm = backend->create_device(fd);
gbm->surface_create(gbm, width, height, format, flags);
}
struct gbm_device {
/* Hack to make a gbm_device detectable by its first element. */
struct gbm_device *(*dummy)(int);
int fd;
const char *name;
unsigned int refcount;
struct stat stat;
...
void (*bo_destroy)(struct gbm_bo *bo);
struct gbm_surface *(*surface_create)(struct gbm_device *gbm,
uint32_t width, uint32_t height,
uint32_t …Run Code Online (Sandbox Code Playgroud) 我正在尝试从Windows 上的源代码构建shapelib。该库使用自动工具。我已经安装了带有适当软件包的 MinGW。当我跑
C:\MinGW\msys\1.0\bin\sh autogen.sh
Run Code Online (Sandbox Code Playgroud)
它输出
autogen.sh: line 4: readlink: command not found
autogen.sh: line 4: dirname: command not found
**Error**: Directory `' does not look like the top-level package directory
Run Code Online (Sandbox Code Playgroud)
我不希望 readlink 可以与 Windows 一起使用,所以我直接跳过了
C:\MinGW\msys\1.0\bin\sh configure
Run Code Online (Sandbox Code Playgroud)
但是,这也会引发错误
configure: line 478: sed: command not found
configure: line 477: expr: command not found
configure: line 478: sed: command not found
configure: line 492: sed: command not found
: error: cannot create .lineno; rerun with a POSIX …Run Code Online (Sandbox Code Playgroud)