- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正尝试在 Cygwin 上用 C 构建一个非常简单的 PostgreSQL 客户端。
这是我到目前为止所做的:
从这里开始,我使用下面的 makefile 编译并链接了客户端程序:
testlibpq: testlibpq.c
gcc -o testlibpq -I /cygdrive/c/workspace/src/postgresql-9.1.2/src/interfaces/libpq -I /cygdrive/c/workspace/src/postgresql-9.1.2/src/include -L /cygdrive/c/workspace/src/postgresql-9.1.2/src/interfaces/libpq testlibpq.c -Bstatic -lpq
编译和链接成功,没有错误或警告。
但是,当我尝试运行该程序时,出现以下错误:
$ ./testlibpq
/cygdrive/c/Users/dleclair/Dropbox/denis/src/testlibpq/testlibpq.exe: error while loading shared libraries: cygpq.dll: cannot open shared object file: No such file or directory
我还没想好怎么解决这个问题。任何指针将不胜感激。哦,还有一件事,我找到了 cygpq.dll 所在的文件夹并将我的 LD_LIBRARY_PATH 设置为指向它,但它仍然给了我相同的结果。
dleclair@dleclair-win7l ~/Dropbox/denis/src/testlibpq
$ ls /cygdrive/c/workspace/src/postgresql-9.1.2/src/interfaces/libpq
bcc32.mak encnames.o fe-connect.o fe-misc.o fe-protocol3.o ip.o libpq-events.c md5.c pgstrcasecmp.c pqsignal.c thread.o
blibpqdll.def exports.txt fe-exec.c fe-print.c fe-secure.c libpq.a libpq-events.h md5.o pgstrcasecmp.o pqsignal.h wchar.c
chklocale.c fe-auth.c fe-exec.o fe-print.o fe-secure.o libpq.rc.in libpq-events.o nls.mk po pqsignal.o wchar.o
chklocale.o fe-auth.h fe-lobj.c fe-protocol2.c inet_net_ntop.c libpqddll.def libpq-fe.h noblock.c pqexpbuffer.c pthread-win32.c win32.c
cygpq.dll fe-auth.o fe-lobj.o fe-protocol2.o inet_net_ntop.o libpq-dist.rc libpq-int.h noblock.o pqexpbuffer.h README win32.h
encnames.c fe-connect.c fe-misc.c fe-protocol3.c ip.c libpqdll.def Makefile pg_service.conf.sample pqexpbuffer.o thread.c win32.mak
dleclair@dleclair-win7l ~/Dropbox/denis/src/testlibpq
$ echo $LD_LIBRARY_PATH
/cygdrive/c/workspace/src/postgresql-9.1.2/src/interfaces/libpq
dleclair@dleclair-win7l ~/Dropbox/denis/src/testlibpq
最佳答案
通常在 unix/linux 系统上构建源代码后会执行 make install,将 header 复制到标准位置,如/usr/local/include 和/usr/local/lib。您可能必须在 cygwin 上执行此操作才能在搜索路径中获取 DLL。
或者您可以自己找到 DLL 并将其放在搜索路径或与可执行文件相同的文件夹中。
关于postgresql - 从 Cygwin 在 C 中运行 PostgreSQL 客户端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13213545/
假设我有一个在 cygwin 下编译的应用程序,并且我想在不让用户安装 cygwin 的情况下分发该应用程序。打包可执行文件和 cygwin DLL 就足够了吗? 最佳答案 事情发生了变化。 Cygw
我从一个镜像站点下载了 cygwin,几个月后,当我尝试更新时,我收到一条消息:“当前 ini 文件来自较新版本的 setup-x86_64.exe” 如果我下载了新的 ini 文件,是否也意味着必须
有什么办法可以回去安装旧版本的 Cygwin? 说我想要 1.7.9 版本,但是 setup.exe在 Cygwin 网站上总是指向最新版本? 最佳答案 http://www.cygwin.com/s
我试图从我的C++代码运行这两个.data文件进行分配。我已经获得了所有文件,并且仅打算为程序实现一些功能(所有内容都应能够运行make命令进行编译)。 我曾经运行过MAC,只是刚开始使用Window
关闭。这个问题是off-topic .它目前不接受答案。 想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。 8年前关闭。 Improve this q
当我尝试对CVS管理的文件使用Emacs 23.2.1下的ediff-revision时,在*ediff-errors*框架中收到以下错误,而不是直接开始到ediff结果: cygwin warnin
我一直在用 Cygwin (许久)。具体来说,我在Win7上使用它(包括gcc/g++)进行开发工作。我最近才注意到现在存在一个 64-bit version . 我没有特定的需求要求我过渡到 64
我从安装程序 2.905 安装了 cygwin 3.1.7 64 位,如果我不使用 grep --color=always 我在终端中看不到彩色输出,即 grep - -color=auto 在我的终
如何使用 cygwin 挂载软盘镜像文件。我想挂载镜像,将文件复制到挂载的驱动器,然后从命令行卸载它。 我知道你可以使用 Virtual Floppy Drive在 Windows 中,但有没有办法在
这个question说明cygwin的软链接(soft link)和ntfs的junctions有些不同。我希望 cygwin 创建一个真正的连接点。我想过运行mklink但是,见鬼,没有mklink
我想设置一组最小的 cygwin 应用程序(ls、diff、path、find、grep),以便它们在没有完整 cygwin 安装的机器上运行。 我假设我需要的只是相关的 *.exe 文件和 *.dl
我的机器设置可以运行 cmake 和 gcc,我想在构建机器上安装具有完全相同的包和参数集的 cygwin,也可能在其他开发机器上。有没有一种方法可以做到这一点,而不必使用提供的 Setup.exe
我正在尝试使用 Cygwin 运行 Nutch。我在设置 JAVA_HOME 时遇到问题。 $ export JAVA_HOME='/cygdrive/f/program files/java/jd
如果您尝试“全局”安装 Composer,则它无法在 Cygwin 中正确运行。 将 composer.phar 放入/usr/local/bin/composer 中,然后尝试运行它会导致错误: C
要为 Cygwin 安装其他软件包,我是否只需要运行 setup.exe再次从包列表中选择? 此外,就安装 2 个 Cygwin 实例或此类问题而言,这样做不会损害我的计算机(我对这些事情有点菜鸟)。
我刚刚安装了 Cygwin,bash 提示符中的主目录看起来位于我的 Z: 驱动器上。这不是我想要的。 如何更改此设置? 最佳答案 Starting with Cygwin 1.7.34 ,建议的方法
cygwin 上的当前目录是 home/myuser。我导航到 cygwin,发现它有一个名为 home/myuser 的目录,我不知道如何导航到桌面。我不想在那里添加桌面目录,而且我无法在根文件夹
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,因为
我使用当前版本的 Cygwin,1.7.9-1。 当我输入“$ which python”时,Cygwin 输出“/usr/bin/python”。 为了确认根目录是我的 Windows 7 文件系统
我想在 Windows 中使用 cmd 做类似的事情: start dir c:\ 应打开一个新控制台,并显示 dir c: 的输出。 对于 Cygwin 我尝试了这个: cmd /c start b
我是一名优秀的程序员,十分优秀!