Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Compiling a Static Library
Qt 6.11 is out! See what's new in the release blog

Compiling a Static Library

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 10.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Thanatos.jsse
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mario
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        ZapB
        wrote on last edited by
        #3

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

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

        Nokia Certified Qt Specialist
        Interested in hearing about Qt related work

        1 Reply Last reply
        0
        • T Offline
          T Offline
          Thanatos.jsse
          wrote on last edited by
          #4

          Ok, I'll check this.
          Thanks.

          BR.

          1 Reply Last reply
          0
          • T Offline
            T Offline
            Thanatos.jsse
            wrote on last edited by
            #5

            [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.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved