2

I create a new project and select Library->C++ Library. then select Statically Linked Library and simply next other pages in wizard. After this when i try to build this new project, no output files (like .a) are produced.

This is my .pro file content:

#-------------------------------------------------
#
# Project created by QtCreator 2015-11-23T03:48:12
#
#-------------------------------------------------

QT       -= gui

TARGET = ssss
TEMPLATE = lib
CONFIG += staticlib

SOURCES += ssss.cpp

HEADERS += ssss.h
unix {
    target.path = /usr/lib
    INSTALLS += target
}

I am using Qt 5.4.2 and Qt Creator 3.4.1

Shnd
  • 1,846
  • 19
  • 35
  • Is there something inside `ssss.cpp`? Perhaps the archive is not created at all if it would be empty? – Angew is no longer proud of SO Nov 23 '15 at 09:12
  • I thought about that and fill some blob code in my files but no chance. From voidrealms videos, he build a static library just after he create the project. – Shnd Nov 23 '15 at 09:41
  • Well, it souldn't be all that hard to write a function with a single `qDebug()` statement to check. – dtech Nov 23 '15 at 10:02
  • have you tried to add QT+= core to the .pro file ? Also you have to export the definitions using Q_DECL_EXPORT. I hope it helps. – Rafael Fontes Nov 23 '15 at 10:24
  • As i did some research on Libraries, it seems that Q_DECL_EXPORT used for shared libraries. – Shnd Nov 25 '15 at 23:01

1 Answers1

0

In order to change the output path to a specific path use:

DESTDIR = /your/output/path/

for example if you want your output to be created in your current project directory use:

DESTDIR = $$PWD
Shnd
  • 1,846
  • 19
  • 35