求助,不知道如何制作这个Makefile
我已经阅读了几个教程,但我仍然没有任何线索:-)我有一个 ac 文件“liboratidy.c”,该文件包含一些 oder 库:
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <tidy.h>
#include <buffio.h>
#include <oci.h>
#include <ociextp.h>
所需的文件位于 /user/lib/libtidy.so 中,头文件位于/usr/include/tidy/ 和 /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public/
我尝试将代码编译为共享库,但每次调用 gcc 编译器时我会收到“xy.h 文件未找到”错误。但这些文件是存在的。我从来没有用 c,c++ 做过什么...我如何制作一个 Makefile 来编译这个源代码?
谢谢 基督教
I have read several tutorials but I still do not have any clue :-) I have a c File "liboratidy.c" this file includes some oder libraries:
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <tidy.h>
#include <buffio.h>
#include <oci.h>
#include <ociextp.h>
The needed files are located in /user/lib/libtidy.so and header files in /usr/include/tidy/ and /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public/
I try to compile my code as shared library but every way I invoke my gcc compiler I will get a "xy.h file not found" error. But the files are existing. I have never done something with c,c++ ... how do I make a Makefile for compiling this source?
Thanks
Christian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
-I
选项应该指向包含您需要编译的头文件的目录(例如-I /usr/include/tidy
)。-L
选项应指向包含您需要构建的库的目录(例如-L /usr/lib/opracle/.....
)。-l
选项应包含要构建的库的缩写名称(例如libfoo.so
->-lfoo
)。The
-I
options should point to the directories (e.g.-I /usr/include/tidy
) that contain the header files you need to compile against. The-L
options should point to the directories (e.g.-L /usr/lib/opracle/.....
) that contain the libraries you need to build against. The-l
options should contain the shortened name (e.g.libfoo.so
->-lfoo
) of the libraries you want to build against.