0
我試圖用共享文件設置目錄,但最終以No rule to make target 'position.cpp', ...
結束。我究竟做錯了什麼?qtmake - 兩個項目/目標之間的共享資源
文件系統樹(簡化):
Project.pro client server shared
./client:
client.pro main.cpp main.h
./server:
main.cpp main.h server.pro
./shared:
position.cpp position.h shared.pri
Project.pro:
TEMPLATE = subdirs
SUBDIRS = client server
client.pro(server.pro看起來類似於):
LIBS += $$system(sdl2-config --libs) -lSDL2_ttf -lSDL2_image -lSDL2_net
QMAKE_CXXFLAGS += $$system(sdl2-config --cflags) -Wall -Wextra -Werror -pedantic -std=c++11
SOURCES += \
main.cpp
HEADERS += \
main.h
include(../shared/shared.pri)
shared.pri:
SOURCES += \
position.cpp
HEADERS += \
position.h