【问题标题】:Problems with Arcsynthesis OpenGL 3.3 tutorials - MAKE errorArcsynthesis OpenGL 3.3 教程的问题 - MAKE 错误
【发布时间】:2014-01-20 04:12:17
【问题描述】:

我一直在关注 arcsynthesis(arcsynthesis.org/gltut/) 教程,在制作过程中遇到以下错误。我使用premake4 gmake生成makefile。

==== Building Tut 13 Basic Impostor (debug) ====
Creating obj/Debug/Tut 13 Basic Impostor
BasicImpostor.cpp
Linking Tut 13 Basic Impostor
/usr/bin/ld: ../glsdk/freeglut/lib/libfreeglutD.a(freeglut_window.o): undefined reference to symbol 'XGetWindowAttributes'
/usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [Tut 13 Basic ImpostorD] Error 1
make: *** [Tut 13 Basic Impostor] Error 2

这是我的生成文件。我不确定这是否是您所要求的,因为我是 Ubuntu 的初学者:

# GNU Make solution makefile autogenerated by Premake
# Type "make help" for usage help

ifndef config
  config=debug
endif
export config

PROJECTS := framework Tut\ 13\ Basic\ Impostor Tut\ 13\ Geometry\ Impostor

.PHONY: all clean help $(PROJECTS)

all: $(PROJECTS)

framework: 
    @echo "==== Building framework ($(config)) ===="
    @${MAKE} --no-print-directory -C ../framework -f Makefile

Tut\ 13\ Basic\ Impostor: framework
    @echo "==== Building Tut 13 Basic Impostor ($(config)) ===="
    @${MAKE} --no-print-directory -C . -f Tut\ 13\ Basic\ Impostor.make

Tut\ 13\ Geometry\ Impostor: framework
    @echo "==== Building Tut 13 Geometry Impostor ($(config)) ===="
    @${MAKE} --no-print-directory -C . -f Tut\ 13\ Geometry\ Impostor.make

clean:
    @${MAKE} --no-print-directory -C ../framework -f Makefile clean
    @${MAKE} --no-print-directory -C . -f Tut\ 13\ Basic\ Impostor.make clean
    @${MAKE} --no-print-directory -C . -f Tut\ 13\ Geometry\ Impostor.make clean

help:
    @echo "Usage: make [config=name] [target]"
    @echo ""
    @echo "CONFIGURATIONS:"
    @echo "   debug"
    @echo "   release"
    @echo ""
    @echo "TARGETS:"
    @echo "   all (default)"
    @echo "   clean"
    @echo "   framework"
    @echo "   Tut 13 Basic Impostor"
    @echo "   Tut 13 Geometry Impostor"
    @echo ""
    @echo "For more information, see http://industriousone.com/premake/quick-start"

【问题讨论】:

  • 能否显示实际的链接器/对象输入参数。通常,如果您忘记链接其他东西所需的动态共享对象,则会出现这种情况...-lX11 几乎肯定会解决您的问题。一些工具链对您指示依赖库的顺序也非常挑剔(例如,-lX11 需要在 -lfreeglutD 之后)。
  • 这不是必需的; Tut\ 13\ Basic\ Impostor.make 的内容很重要。也就是说,一旦Basic Impostor 正常工作,Geometry Impostor 构建目标可能也会出现此问题。
  • 非常感谢。就像你说的那样。我在 Geometry Impostor 和 Basic Impostor 中添加了 -lX11,它起作用了!如果您愿意,请将此评论添加为答案,我会接受它:)

标签: c++ opengl ubuntu makefile


【解决方案1】:

您的 Makefile 中缺少 -lX11 开关,这个特定的链接器错误告诉您 libfreeglutD 取决于动态共享对象 (DSO):libX11.so.

您必须将其添加到两个 makefile:Tut\ 13\ Basic\ Impostor.makeTut\ 13\ Geometry\ Impostor.make。为了从 Arcsynthesis 运行其他教程,您很可能必须这样做。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-11
    • 2011-05-06
    • 1970-01-01
    • 1970-01-01
    • 2014-11-07
    相关资源
    最近更新 更多