Структура моего проекта:
Код: Выделить всё
apps/
- /test
- /test2
Код: Выделить всё
STATIC_LIBS += test
CFLAGS += -I$(SWIFT_ROOT)/apps/test/
LDFLAGS += -L$(SWIFT_ROOT)/apps/test
Код: Выделить всё
/usr/bin/ld: cannot find -ltest
collect2: error: ld returned 1 exit status
Код: Выделить всё
ENABLE_VERSION_API=1
TARGET = test2
SRCS += \
main.cpp \
test2.cpp \
\
# Add more
LIBS +=
STATIC_LIBS += test
EXT_STATIC_LIBS += ssl crypto ssh2 curl protobuf
EXT_LIBS += z
CFLAGS += -I$(SWIFT_ROOT)/include/google/protobuf/
CFLAGS += -I$(SWIFT_ROOT)/libs/src/test2/
CFLAGS += -I$(SWIFT_ROOT)/apps/test/
LDFLAGS += -L$(SWIFT_ROOT)/apps/test
include $(SWIFT_ROOT)/build/app.mak
Код: Выделить всё
g++ -I/root/include/google/protobuf/ -
I/root/libs/src/test2/ -std =c++17 -Wno-unused-but-
set-variable -Wno-misleading-indentation -Wno-deprecated-
declarations -Wno-parentheses -Wno-switch -Wno-literal -suffix -
Wno-conversion-null -Wno-format-contains-nul -D_THREAD_SAFE -
D_GNU_SOURCE -D__USE_GNU .builtobjs/main.o .builtobjs/test2.o -L
/root/apps/test -Xlinker --start-group -lz -ldl
-lpthread -lrt -luuid -lstdc++fs -Wl,-Bstatic -lssl -lcrypto -
lssh2 -lcurl -lprotobuf -ltest -Wl,-Bdynamic -
Xlinker --end-grou p -Wl,-rpath,/opt/swift/lib64 -Wl,-
rpath,/opt/swift/lib -o test2
Подробнее здесь: https://stackoverflow.com/questions/772 ... ule-in-cpp
Мобильная версия