链接器未使用命令与clang ++ 8

时间:2019-03-04 16:26:30

标签: c++ clang++

我正在使用此this tutorial的代码将简单的main函数与细丝库链接起来。

文件夹结构为:

|-- README.md
|-- bin
|-- docs
|-- include
|-- lib
|-- main.cpp

我已经按照以下步骤展开了内容文件:

/usr/bin/clang-cpp-8 main.cpp -L./lib/x86_64/ -I./include -lfilament -lbluegl -lbluevk -lfilabridge -lfilaflat -lutils -lpthread -lc++ -ldl -lm -std=c++14 -pthread -c

但是当我运行该行或原始生成文件时,我得到:

clang: warning: -lfilament: 'linker' input unused in cpp mode [-Wunused-command-line-argument]
clang: warning: -lbluegl: 'linker' input unused in cpp mode [-Wunused-command-line-argument]
clang: warning: -lbluevk: 'linker' input unused in cpp mode [-Wunused-command-line-argument]
clang: warning: -lfilabridge: 'linker' input unused in cpp mode [-Wunused-command-line-argument]
clang: warning: -lfilaflat: 'linker' input unused in cpp mode [-Wunused-command-line-argument]
clang: warning: -lutils: 'linker' input unused in cpp mode [-Wunused-command-line-argument]
clang: warning: -lpthread: 'linker' input unused in cpp mode [-Wunused-command-line-argument]
clang: warning: -lc++: 'linker' input unused in cpp mode [-Wunused-command-line-argument]
clang: warning: -ldl: 'linker' input unused in cpp mode [-Wunused-command-line-argument]
clang: warning: -lm: 'linker' input unused in cpp mode [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-L./lib/x86_64/' [-Wunused-command-line-argument]

由于某种原因加上以下输出(仅部分输出,因为过长)

# 1 "main.cpp"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 389 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "main.cpp" 2
# 1 "./include/filament/FilamentAPI.h" 1
# 20 "./include/filament/FilamentAPI.h"
# 1 "./include/utils/compiler.h" 1
# 21 "./include/filament/FilamentAPI.h" 2

# 1 "/usr/include/clang/8.0.0/include/stddef.h" 1 3
# 51 "/usr/include/clang/8.0.0/include/stddef.h" 3
typedef long int ptrdiff_t;
# 62 "/usr/include/clang/8.0.0/include/stddef.h" 3
typedef long unsigned int size_t;
# 118 "/usr/include/clang/8.0.0/include/stddef.h" 3
# 1 "/usr/include/clang/8.0.0/include/__stddef_max_align_t.h" 1 3
# 35 "/usr/include/clang/8.0.0/include/__stddef_max_align_t.h" 3
typedef struct {
  long long __clang_max_align_nonce1
      __attribute__((__aligned__(__alignof__(long long))));
  long double __clang_max_align_nonce2
      __attribute__((__aligned__(__alignof__(long double))));
} max_align_t;
# 119 "/usr/include/clang/8.0.0/include/stddef.h" 2 3
# 23 "./include/filament/FilamentAPI.h" 2

namespace filament {







class __attribute__((visibility("default"))) FilamentAPI {
protected:

    FilamentAPI() noexcept = default;
    ~FilamentAPI() = default;

没有太多迹象表明可能是什么错误,有人可以帮忙吗?

供参考的Makefile:

FILAMENT_LIBS=-lfilament -lbluegl -lbluevk -lfilabridge -lfilaflat -lutils
CC=clang++

main: main.o
    $(CC) -Llib/x86_64/ main.o $(FILAMENT_LIBS) -lpthread -lc++ -ldl -o main

main.o: main.cpp
    $(CC) -Iinclude/ -std=c++14 -pthread -c main.cpp

clean:
    rm -f main main.o

.PHONY: clean

0 个答案:

没有答案