Automake Libtool“没有创建目标的规则”

发布于 2024-12-20 01:34:02 字数 2425 浏览 2 评论 0 原文

我一直在尝试将 OpenGL SuperBible 附带的 GLTools 库构建到带有 automake 的 libtool 库中。

我已经设置了 autoconf 和 automake,但是当涉及到实际构建库时,我得到:

$ make
make: *** No rule to make target `GLBatch.lo', needed by `libgltools.la'.  Stop.

我已经在 google 上进行了尽可能多的搜索,但什么也没得到,我是 automake 的新手,所以我不是非常确定要寻找什么。我确信这要么是一个小错误,要么是我错过了一些基本的东西。

这是我的 Makefile.am:

ACLOCAL_AMFLAGS = -I m4

lib_LTLIBRARIES = libgltools.la
libgltools_la_SOURCES = GLBatch.cpp GLShaderManager.cpp GLTriangeBatch.cpp GLTools.cpp math3d.cpp glew.c
#libgltools_la_CFLAGS = 
libgltools_la_LIBADD = -lX11 -lglut -lGL -lGLU -lm

include_HEADERS = GLBatchBase.h GLBatch.h GLFrame.h GLFrustum.h GLGeometryTransform.h GLMatrixStack.h GLShaderManager.h GLTools.h GLTriangleBatch.h math3d.h StopWatch.h GL/glew.h GL/glxew.h GL/wglew.h

EXTRA_DIST = autogen.sh

还有我的 configure.ac(如果重要的话):

#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.67])
AC_INIT([libgltools.la], [0.1], [[email protected]])
AM_INIT_AUTOMAKE([libgltools.la], [0.1])
AC_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([src/])
AC_CONFIG_HEADERS([include/config.h])

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC

# Checks for libraries.
# FIXME: Replace `main' with a function in `-lGL':
AC_CHECK_LIB([GL], [main])
# FIXME: Replace `main' with a function in `-lGLU':
AC_CHECK_LIB([GLU], [main])
# FIXME: Replace `main' with a function in `-lX11':
AC_CHECK_LIB([X11], [main])
# FIXME: Replace `main' with a function in `-lglut':
AC_CHECK_LIB([glut], [main])
# FIXME: Replace `main' with a function in `-lm':
AC_CHECK_LIB([m], [main])

# Checks for header files.
AC_PATH_X
AC_CHECK_HEADERS([inttypes.h stddef.h stdint.h stdlib.h string.h sys/time.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_UINT64_T
AC_CHECK_TYPES([ptrdiff_t])

# Checks for library functions.
AC_HEADER_MAJOR
AC_FUNC_MALLOC
AC_CHECK_FUNCS([gettimeofday sqrt strchr strstr])

AC_CONFIG_FILES([Makefile])
AC_OUTPUT

非常感谢。

I've been trying to build to GLTools library that accompanies The OpenGL SuperBible into a libtool library with automake.

I've set up autoconf and automake but when it comes to actually build the library I get:

$ make
make: *** No rule to make target `GLBatch.lo', needed by `libgltools.la'.  Stop.

I've searched google as much as my sanity will let me and come up with nothing, I'm new to automake so I'm not quite sure what to be searching for. I'm sure it's either a tiny mistake or I've missed something fundamental.

Here is my Makefile.am:

ACLOCAL_AMFLAGS = -I m4

lib_LTLIBRARIES = libgltools.la
libgltools_la_SOURCES = GLBatch.cpp GLShaderManager.cpp GLTriangeBatch.cpp GLTools.cpp math3d.cpp glew.c
#libgltools_la_CFLAGS = 
libgltools_la_LIBADD = -lX11 -lglut -lGL -lGLU -lm

include_HEADERS = GLBatchBase.h GLBatch.h GLFrame.h GLFrustum.h GLGeometryTransform.h GLMatrixStack.h GLShaderManager.h GLTools.h GLTriangleBatch.h math3d.h StopWatch.h GL/glew.h GL/glxew.h GL/wglew.h

EXTRA_DIST = autogen.sh

And my configure.ac if it matters:

#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.67])
AC_INIT([libgltools.la], [0.1], [[email protected]])
AM_INIT_AUTOMAKE([libgltools.la], [0.1])
AC_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([src/])
AC_CONFIG_HEADERS([include/config.h])

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC

# Checks for libraries.
# FIXME: Replace `main' with a function in `-lGL':
AC_CHECK_LIB([GL], [main])
# FIXME: Replace `main' with a function in `-lGLU':
AC_CHECK_LIB([GLU], [main])
# FIXME: Replace `main' with a function in `-lX11':
AC_CHECK_LIB([X11], [main])
# FIXME: Replace `main' with a function in `-lglut':
AC_CHECK_LIB([glut], [main])
# FIXME: Replace `main' with a function in `-lm':
AC_CHECK_LIB([m], [main])

# Checks for header files.
AC_PATH_X
AC_CHECK_HEADERS([inttypes.h stddef.h stdint.h stdlib.h string.h sys/time.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_UINT64_T
AC_CHECK_TYPES([ptrdiff_t])

# Checks for library functions.
AC_HEADER_MAJOR
AC_FUNC_MALLOC
AC_CHECK_FUNCS([gettimeofday sqrt strchr strstr])

AC_CONFIG_FILES([Makefile])
AC_OUTPUT

Thanks very much.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

奢望 2024-12-27 01:34:02

根据您的描述很难说,但我敢打赌您需要将 Makefile.am 放在 src 目录中,然后创建一个 Makefile.am< /code> 在 GLTools 目录中,如下所示:

SUBDIRS = src
ACLOCAL_AMFLAGS = -I m4

也可以执行 非递归 make 但这需要一些额外的设置。

我在这里为您做到了:

https://github.com/msteinert/gltools

It's hard to say based on your description but I would wager that you need to put your Makefile.am in the src directory and then create a Makefile.am in the GLTools directory that looks like this:

SUBDIRS = src
ACLOCAL_AMFLAGS = -I m4

It is also possible to do a non-recursive make but that requires some extra setup.

Here I did it for you:

https://github.com/msteinert/gltools

英雄似剑 2024-12-27 01:34:02

您应该在 configure.ac 文件中添加某个位置:

LT_INIT
LT_LANG([C++])

或者,根据文档:

LT_INIT
AC_PROG_CXX

You should add somewhere in your configure.ac file:

LT_INIT
LT_LANG([C++])

Or alternatively, according to the docs:

LT_INIT
AC_PROG_CXX
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文