windows - Qt link static built lib -


i have project targeted lib , 1 app.

first project builds static , dynamic (shared) lib.

second project links dynamic lib, can't link static one. many error messages lnk2001: unresolved external symbol appear.

app.pro:

template = app config += static link_prl ordered defines += qt_nodll qt += core gui network xml  ...  # --- link quazip lib shared ---  #libs += -l$$quote(c:/qt/quazip/build-quazip-0.5.1-qt_4_8_3_shared-debug/quazip/debug) -lquazip #pre_targetdeps += $$quote(c:/qt/quazip/build-quazip-0.5.1-qt_4_8_3_shared-debug/quazip/debug/quazip.lib)  # --- link quazip lib static ---  libs += -l$$quote(c:/qt/quazip/build-quazip-0.5.1-qt_4_8_3_static-release/quazip/release) -lquazip pre_targetdeps += $$quote(c:/qt/quazip/build-quazip-0.5.1-qt_4_8_3_static-release/quazip/release/quazip.lib) 

directories content:

 directory of c:\qt\quazip\build-quazip-0.5.1-qt_4_8_3_shared-debug\quazip\debug  04.04.2013  11:01    <dir>          .                                            04.04.2013  11:01    <dir>          ..                                           04.04.2013  11:01           188 498 jlcompress.obj                               04.04.2013  11:01             2 484 moc_quagzipfile.cpp                          04.04.2013  11:01            43 994 moc_quagzipfile.obj                          04.04.2013  11:01             2 501 moc_quaziodevice.cpp                         04.04.2013  11:01            44 026 moc_quaziodevice.obj                         04.04.2013  11:01             2 467 moc_quazipfile.cpp                           04.04.2013  11:01            62 441 moc_quazipfile.obj                           04.04.2013  11:01            40 936 qioapi.obj                                   04.04.2013  11:01            24 586 quaadler32.obj                               04.04.2013  11:01            24 554 quacrc32.obj                                 04.04.2013  11:01            73 276 quagzipfile.obj                              04.04.2013  11:01            69 745 quaziodevice.obj                             04.04.2013  11:01           188 928 quazip.dll                                   04.04.2013  11:01            40 067 quazip.exp                                   04.04.2013  11:01           999 808 quazip.ilk                                   04.04.2013  11:01               381 quazip.intermediate.manifest                 04.04.2013  11:01            65 678 quazip.lib                                   04.04.2013  11:01           156 746 quazip.obj                                   04.04.2013  11:01         1 166 336 quazip.pdb                                   04.04.2013  11:01           259 653 quazipdir.obj                                04.04.2013  11:01           117 317 quazipfile.obj                               04.04.2013  11:01            47 039 quazipfileinfo.obj                           04.04.2013  11:01            57 489 quazipnewinfo.obj                            04.04.2013  11:01            35 483 unzip.obj                                    04.04.2013  11:01            34 526 zip.obj                                                    25 file(s)      3 748 959 bytes                                                   2 dir(s)  17 125 515 264 bytes free   directory of c:\qt\quazip\build-quazip-0.5.1-qt_4_8_3_static-release\quazip\release  04.04.2013  12:46    <dir>          .                                                04.04.2013  12:46    <dir>          ..                                               04.04.2013  12:46         1 457 363 jlcompress.obj                                   04.04.2013  12:46             2 484 moc_quagzipfile.cpp                              04.04.2013  12:46         1 084 653 moc_quagzipfile.obj                              04.04.2013  12:46             2 501 moc_quaziodevice.cpp                             04.04.2013  12:46         1 084 461 moc_quaziodevice.obj                             04.04.2013  12:46             2 467 moc_quazipfile.cpp                               04.04.2013  12:46         1 199 125 moc_quazipfile.obj                               04.04.2013  12:46         1 084 170 qioapi.obj                                       04.04.2013  12:46           279 307 quaadler32.obj                                   04.04.2013  12:46           279 270 quacrc32.obj                                     04.04.2013  12:46         1 115 174 quagzipfile.obj                                  04.04.2013  12:46         1 108 222 quaziodevice.obj                                 04.04.2013  12:46        14 977 872 quazip.lib                                       04.04.2013  12:46         1 246 009 quazip.obj                                       04.04.2013  12:46               801 quazip.prl                                       04.04.2013  12:46         1 357 090 quazipdir.obj                                    04.04.2013  12:46         1 246 159 quazipfile.obj                                   04.04.2013  12:46         1 121 490 quazipfileinfo.obj                               04.04.2013  12:46         1 134 685 quazipnewinfo.obj                                04.04.2013  12:46            56 712 unzip.obj                                        04.04.2013  12:46            59 090 zip.obj                                                        21 file(s)     29 899 105 bytes                                                       2 dir(s)  17 123 479 552 bytes free 

as understand, qmake wants dll link it. how can tell want build static app , let externals inside static built lib?

to link quazip statically needs config += staticlib in qmake file.

or make sure, quazip_static defined before include quazip header application.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -