문제

I have a project with the following structure:

MainProject.pro
    ExecProject.pro
    LibProject.pro

As you can guess there is a dependency between the ExecProject and the LibProject.

My problem is that when debugging I cannot step into the LibProject source code (even if the code is executed).

Here is the MainProject.pro file contents :

TEMPLATE = subdirs

CONFIG += ordered

SUBDIRS += \
    LibProject \
    ExecProject

ExecProject.dependes = LibProject

The LibProject.pro file content:

TARGET = LibProject
TEMPLATE = lib

CONFIG = staticlib

DEFINES += LIBPROJECT_LIBRARY

SOURCES += LibProject.cpp

HEADERS += LibProject.h\
   LibProject_global.h

And the ExecProject.pro file content:

QT       += core

TARGET = ExecProject
CONFIG   += console
CONFIG   -= app_bundle

TEMPLATE = app

SOURCES += main.cpp
INCLUDEPATH += ../LibProject
LIBS += -L../LibProject -lLibProject

Does anyone have an idea?

도움이 되었습니까?

해결책

I finally solved my problem using .pri files for my libs and using the following command in my .pro file:

include(path/to/my/lib/mylib.pri)

My project hierarchy is as follow:

root
    \app
        \app1
        \app2
    \libs
        \lib1
            - class1.h
            - class1.cpp
            - class2.h
            - class2.cpp
        \lib2
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top