小编Tom*_*lla的帖子

从子目录中CMake链接库

我想在我的项目中包含SFML源代码.我的目录布局如下:

main
  SFML (subtree synced with the official git repo)
  src
    <various modules>
    General (here lies the binary)
Run Code Online (Sandbox Code Playgroud)

从主要级别我首先添加SFML子目录然后再​​添加src.正如我看到构建日志,这产生了库:

sfml?system
sfml?window
sfml?network
sfml?graphics
sfml?audio
sfml?main
Run Code Online (Sandbox Code Playgroud)

现在我想将它们链接到General目录中的二进制文件,如下所示:

add_executable(main ${main_SRCS})
target_link_libraries (main
  sfml?system
  sfml?window
  sfml?network
  sfml?graphics
  sfml?audio
  sfml?main
  # Other stuff here
)
Run Code Online (Sandbox Code Playgroud)

但我得到:

/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lsfml?system
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lsfml?window
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lsfml?network
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lsfml?graphics
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lsfml?audio
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lsfml?main
Run Code Online (Sandbox Code Playgroud)

为什么CMake尝试使用系统库而不是刚刚构建的系统库,如何解决这个问题呢?

c++ linker gcc cmake sfml

7
推荐指数
1
解决办法
1万
查看次数

为Django模板创建继承图/树

是否有任何工具可以使用Django应用程序的目录,扫描模板并绘制/打印/列出模板之间的继承层次结构?

在这样的工具中,查看在每个级别覆盖哪些块将是一个特别有用的功能.

python django templates uml class-hierarchy

6
推荐指数
1
解决办法
219
查看次数

标签 统计

c++ ×1

class-hierarchy ×1

cmake ×1

django ×1

gcc ×1

linker ×1

python ×1

sfml ×1

templates ×1

uml ×1