Compiling a Static Library



  • Hi Qt DevNet

    I'm working in a project for the classification of data patterns using a Neuro-Fuzzy aproach. I'm not programer (Mechanical Engenering), but this area is like a hobi.

    Well, I did do three modules for my program:

    NeuralNetwork -> C++ Library

    NetworkAssistent -> Qt Widget

    MainWindow -> Qt QMainWindow

    The first module is a static library for create and manipulate the algoritm of Neural Network, the second module is an assistent (GUI) for the creation and configuration of the Neural Network, finaly the MainWindow is the integrator of them all.

    When I make changes in a NetworkAssisten module, clean, and Build All, the changes don't have succes in the MainWindow application. I don't know what's wrong.

    I configured the *.pro files in the next way:
    @#common.pri
    INCLUDEPATH += . ..
    WARNINGS = -wall
    UI_DIR = ../uics
    MOC_DIR = ../mocs
    OBJECTS_DIR = ../objs
    RCC_DIR = ../rccs@
    MainProject.pro
    @#Main Project Net.pro
    TEMPLATE = subdirs
    CONFIG += ordered
    SUBDIRS += NetAssistent
    NeuralNetwork
    MainWindow \

    TestLibrary @

    NetAssisten.pro
    @#NetAssisten.pro
    !include(../common.pri){
    error("No se pudo encontrar common.pri")
    } else {
    message("common.pri cargado satisfactoriamente")
    }

    !contains(QT, core){
    QT += core
    }
    !contains(QT, gui){
    QT += gui
    }

    TARGET = NetAssistent
    TEMPLATE = lib

    !contains(CONFIG, staticlib){
    CONFIG += staticlib
    }

    DESTDIR = ../Libs
    SOURCES += netassistent.cpp
    listmodel.cpp
    listboxdelegate.cpp
    HEADERS += netassistent.h
    listmodel.h
    listboxdelegate.h
    FORMS += netassistent.ui
    TRANSLATIONS += netassistent_la.ts@
    NeuralNetwork.pro
    @#NeuralNetwork.pro
    !include(../common.pri){
    error("No se pudo encontrar common.pri")
    } else {
    message("common.pri cargado satisfactoriamente")
    }

    QT -= core gui
    TARGET = NeuralNetwork
    TEMPLATE = lib
    CONFIG += staticlib
    DESTDIR = ../Libs
    SOURCES +=
    ruleneuron.cpp
    classneuron.cpp
    fuzzyset.cpp
    universe.cpp
    network.cpp
    files.cpp

    HEADERS +=
    ruleneuron.h
    classneuron.h
    fuzzyset.h
    universe.h
    network.h
    files.h@
    And finaly MainWindow.pro
    @#MainWindow.pro
    !include(../common.pri){
    error("No se pudo encontrar common.pri")
    } else {
    message("common.pri cargado satisfactoriamente")
    }

    !contains(QT, core){
    QT += core
    }

    !contains(QT, gui){
    QT += gui
    }

    contains(CONFIG, console){
    CONFIG -= console
    }

    !contains(CONFIG, app_bundle){
    CONFIG += app_bundle
    }

    TARGET = MainWindow
    TEMPLATE = app
    DESTDIR = ../Aplication
    SOURCES += main.cpp
    mainwindow.cpp \

    HEADERS += mainwindow.h
    LIBS += -L../Libs -lNetAssistent
    RESOURCES += resource.qrc@

    I'm grateful if you can help me.

    For the moment thanks for your time.



  • Try following the guide at "http://doc.qt.nokia.com/qtcreator-2.1/creator-project-qmake-libraries.html":http://doc.qt.nokia.com/qtcreator-2.1/creator-project-qmake-libraries.html to see if that helps.

    The guide shows how to create new sub library projects in QtCreator.



  • Also, checkout the DEPENDPATH qmake variable. Try adding something like this to your application's .pro file:

    @DEPENDPATH += ../NetAssisten/NetAssistent ../NeuralNetwork/NeuralNetwork@



  • Ok, I'll check this.
    Thanks.

    BR.



  • [quote author="mario" date="1300609594"]Try following the guide at "http://doc.qt.nokia.com/qtcreator-2.1/creator-project-qmake-libraries.html":http://doc.qt.nokia.com/qtcreator-2.1/creator-project-qmake-libraries.html to see if that helps.

    The guide shows how to create new sub library projects in QtCreator.[/quote]

    I did this, but don’t work, thanks for your help.

    [quote author="ZapB" date="1300612005"]Also, checkout the DEPENDPATH qmake variable. Try adding something like this to your application's .pro file:

    @DEPENDPATH += ../NetAssisten/NetAssistent ../NeuralNetwork/NeuralNetwork@[/quote]

    I watched this variable (and I tried to do the last point), but neither worked.

    Well, what happen when I'm not include the ui_netassistent.ui (auto generated file) in the same directory that project?. I refer to the 4 line in the common.pri file UI_DIR = ../uics

    BR.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.