【发布时间】:2012-04-15 10:19:36
【问题描述】:
描述如何从我自己的 GNU Makefile 将“getoptpp”编译为阴影库并将其静态链接到我的程序?
我的工作:
在我的程序目录中,我将 getoptpp 库解压缩到具有相同名称的子目录中。 比向我的 Makefile 添加新目标:(自述文件说我使用 SHARED 标志来制作。$> make SHARED=n)
getoptpp:
cd getoptpp; $(MAKE) SHARED=n
比我将此目标添加到我的程序的请求目标列表中:
myprogram: getoptpp
g++ **** myprogram
但在调用 make myprogram 之后 - 根本没有创建新的 .so。 调用“make getoptpp”时 - make 说“是最新的”
*添加:.PHONY 建议后出现错误 *
cd getoptpp; make SHARED=n
"Makefile", line 15: Missing dependency operator
"Makefile", line 19: Need an operator
"Makefile", line 24: Need an operator
"Makefile", line 45: Missing dependency operator
"Makefile", line 47: Need an operator
make: fatal errors encountered -- cannot continue
*** Error code 1
http://code.google.com/p/getoptpp/
或
请为我的 c++ 程序推荐非常好的命令行解析库。我可以简单地编译为链接到我的程序的 .o 对象。没有提升!
【问题讨论】:
标签: c++ command-line makefile gnu