Results 1 to 5 of 5

Thread: Libraries, problems, external unresolveds..Steps to find the fix

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Libraries, problems, external unresolveds..Steps to find the fix

    I have a third party libs. (msvc10) a MT/MD (Static cfgs's) and dynamic DLL cfg.
    I have qt + msvc10 express + win sdk.7

    They say that QT can only use this libs on "dynamic configuration" (what is dynamic configuration?)
    What it is supossed I have to use ? (I feel as a stupid newbie...)


    Ok , I use the existing examples offered, (using the libs) I can't compile ..... I have 4 unresolved external errors of the same lib.
    (But I have zero errors for the others)
    I have not support for these lib...... (but they are legal, I am a member without rights)

    Which are the steps to investigate a possible fix? Where I have to look ?
    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Libraries, problems, external unresolveds..Steps to find the fix

    Did you tell your compiler you want it to link against this library? What does your Qt project file look like?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Libraries, problems, external unresolveds..Steps to find the fix

    The project just use the typical LIB +L and -l.
    Apparently the other libs can be compiled...
    ( I say this because If I comment some lib I have 300 errors related to it)


    If I use the .dll's I have :
    fatal error LNK1107: invalid or corrupt file: cannot read at 0x2B8 ????


    So... Have I to use .lib or .dll ?
    Thanks....


    This is the QT project: (I hope you can view it well )
    My 4 errors are related with TD_ExamplesCommon.


    Qt Code:
    1. TARGET = OdaQtApp
    2. TEMPLATE = app
    3. #TEMPLATE = lib
    4. #CONFIG += plugin # ? for dll
    5.  
    6. TD_CONF_NAME = vc10dll
    7.  
    8.  
    9. win32 {
    10. DESTDIR = ../exe
    11. PRJ_DESTDIR = ""
    12.  
    13. # [url]http://graphics.ethz.ch/~peterkau/coding.php[/url] :
    14. # (see result at project property / C/C++ / Output Files / Program Database File Name)
    15. QMAKE_CXXFLAGS += /Fd$(IntDir)/
    16. #QMAKE_CXXFLAGS_DEBUG and QMAKE_CXXFLAGS_RELEASE
    17.  
    18. OBJECTS_DIR = $$(PRJ_DESTDIR)build/$$TARGET
    19. MOC_DIR = $$(PRJ_DESTDIR)build/$$TARGET
    20. UI_DIR = $$(PRJ_DESTDIR)build/$$TARGET
    21. RCC_DIR = $$(PRJ_DESTDIR)build/$$TARGET
    22. }
    23.  
    24. COMMONPATH = ../Common
    25.  
    26. win32:LIBS += -L/../../../../lib/vc10dll #$$TD_CONF_NAME
    27.  
    28.  
    29. INCLUDEPATH += $$COMMONPATH
    30. INCLUDEPATH += C:\\Archivos de programa\\Microsoft SDKs\\Windows\\v7.1\\Samples\\winui\\tsf\\tsfapp
    31. INCLUDEPATH += ../../../Include
    32. INCLUDEPATH += ../../../Extensions/ExServices
    33.  
    34. HEADERS += ../Common/OdqInterfaces.h
    35. HEADERS += ../Common/ExDynamicModule.h
    36. HEADERS += ../Common/OdqAudit.h
    37. HEADERS += ../Common/OdqClipData.h
    38.  
    39.  
    40. !exists( $$(ODADIR)/$$(TD_FLD_NAME)/Include/ExAppServices.h ) {
    41. HEADERS += ../Common/ExAppServices.h
    42. DEFINES += ODA_QT_EX_APP_SERVICES_UNLINKED_RXINIT
    43. }
    44. else {
    45. HEADERS += $$(ODADIR)/$$(TD_FLD_NAME)/Include/ExAppServices.h
    46. }
    47.  
    48. !exists( $$(ODADIR)/$$(TD_FLD_NAME)/Include/PropServices.h ) {
    49. HEADERS += ../Common/PropServices.h
    50. DEFINES += ODA_QT_PROP_SERVICES_UNLINKED_RXINIT
    51. }
    52. else {
    53. HEADERS += $$(ODADIR)/$$(TD_FLD_NAME)/Include/PropServices.h
    54. }
    55.  
    56. HEADERS += OdqApplication.h
    57. HEADERS += OdqMainWindow.h
    58. HEADERS += OdqCustomization.h
    59. HEADERS += OdqAppProps.h
    60. HEADERS += OdqPropertyDialog.h
    61. HEADERS += OdqPropertyPalette.h
    62. HEADERS += OdqPlotDialog.h
    63. HEADERS += OdqXmlUtils.h
    64. HEADERS += Services.h
    65. HEADERS += AppModule.h
    66. HEADERS += AppCommands.h
    67. HEADERS += ExAppServicesImpl.h
    68. HEADERS += PropServicesImpl.h
    69. HEADERS += ResBufPropValueBaseConvertors.h
    70.  
    71. SOURCES += main.cpp
    72. SOURCES += OdqApplication.cpp
    73. SOURCES += OdqMainWindow.cpp
    74. SOURCES += OdqCustomization.cpp
    75. SOURCES += OdqAppProps.cpp
    76. SOURCES += OdqXmlUtils.cpp
    77. SOURCES += OdqPropertyDialog.cpp
    78. SOURCES += OdqPropertyPalette.cpp
    79. SOURCES += OdqPlotDialog.cpp
    80. SOURCES += Services.cpp
    81. SOURCES += AppModule.cpp
    82. SOURCES += AppCommands.cpp
    83. SOURCES += AppPlotCommands.cpp
    84. SOURCES += ExAppServicesImpl.cpp
    85. SOURCES += PropServicesImpl.cpp
    86.  
    87. # Cryptographic - support for DWG with password
    88. win32 {
    89. # via Window API
    90. INCLUDEPATH += ../../../Extensions/win/Crypt
    91. HEADERS += ../../../Extensions/win/Crypt/WinNTCrypt.h
    92. SOURCES += ../../../Extensions/win/Crypt/WinNTCrypt.cpp
    93. }
    94.  
    95.  
    96. exists( $$(ODADIR)/Caustic/OpenRL/Source/OpenRLKey/OpenRLKey.cpp ) {
    97.  
    98. INCLUDEPATH += $$(ODADIR)/Caustic/OpenRL/Source/OpenRLKey/include
    99. INCLUDEPATH += "$$(ODADIR)/Caustic/OpenRL/ThirdParty/OpenRL_SDK/Include"
    100. HEADERS += $$(ODADIR)/Caustic/OpenRL/Source/OpenRLKey/Include/OpenRLKey.h
    101. HEADERS += $$(ODADIR)/Caustic/OpenRL/Source/OpenRLKey/Include/OpenRLKeyPE.h
    102. HEADERS += $$(ODADIR)/Caustic/OpenRL/Source/OpenRLKey/OpenRLKeyPEImpl.h
    103. SOURCES += $$(ODADIR)/Caustic/OpenRL/Source/OpenRLKey/OpenRLKey.cpp
    104. SOURCES += $$(ODADIR)/Caustic/OpenRL/Source/OpenRLKey/OpenRLKeyPE.cpp
    105.  
    106. #7051 - TD_OpenRLKey.lib requires linking with Gs
    107. #LIBS += -l$$(TDLIBPREF)Gs
    108. }
    109. else {
    110. DEFINES += ODA_QT_NO_CAUSTIC_OPENRL
    111. }
    112.  
    113. # QZipReader is private for v 4.5 - 4.6 # TODO use for menu command
    114.  
    115. QTDIR = C:/QtSDK_ms/QtSources/4.8.0
    116.  
    117. exists( $$QTDIR/src/gui/text/qzip.cpp ) {
    118.  
    119. exists( $$QTDIR/include/Qt/private/qzipreader_p.h ) {
    120. #DEFINES += Q_AUTOTEST_EXPORT
    121. #DEFINES -= QT_NO_TEXTODFWRITER
    122. HEADERS += $$QTDIR/include/Qt/private/qzipreader_p.h
    123. HEADERS += $$QTDIR/include/Qt/private/qzipwriter_p.h
    124. INCLUDEPATH += $$QTDIR/src/3rdparty/zlib
    125. SOURCES += $$QTDIR/src/gui/text/qzip.cpp
    126. } else {
    127. # since 4.7.1
    128. INCLUDEPATH += $$QTDIR/src/gui/text
    129. HEADERS += $$QTDIR/src/gui/text/qzipreader_p.h
    130. HEADERS += $$QTDIR/src/gui/text/qzipwriter_p.h
    131. }
    132. }
    133. else {
    134. DEFINES += ODA_QT_NO_QZIP
    135. }
    136.  
    137. RESOURCES += data/data.qrc
    138.  
    139. win32 {
    140. RC_FILE = data/OdaQtApp.rc
    141.  
    142. CONFIG -= embed_manifest_exe
    143. #CONFIG -= embed_manifest_dll
    144. }
    145.  
    146. CONFIG += qt
    147. QT += xml
    148.  
    149.  
    150. # ----- DD set -----
    151.  
    152. TDLIBPREF = D:/I_DESARROLLO/c++okk/APCdwg/tdvc10dll/lib/vc10dll
    153.  
    154.  
    155. DEFINES += UNICODE
    156. DEFINES += _UNICODE
    157. DEFINES += _TOOLKIT_IN_DLL_
    158. DEFINES += $$TDLIBPREF/CLIENT_BUILD
    159. #DEFINES += ADT_DEBUG
    160. #DEFINES += ADT_DYNAMIC_BUILD
    161.  
    162.  
    163. LIBS += -l$$TDLIBPREF/TD_Alloc
    164. LIBS += -l$$TDLIBPREF/TD_DbRoot
    165. LIBS += -l$$TDLIBPREF/TD_Root
    166. LIBS += -l$$TDLIBPREF/TD_Db
    167. LIBS += -l$$TDLIBPREF/TD_Ge
    168.  
    169. ##macx {
    170. # LIBS += -l$$(TDLIBPREF)Gi
    171.  
    172. # # critical for linux :
    173. # TST = $$(TDLIBPREF)
    174. # isEqual(TST, TD_) {
    175. # LIBS += -l$$(TDLIBPREF)SpatialIndex
    176. # }
    177. # else {
    178. # LIBS += -lSpatialIndex
    179. # }
    180.  
    181. # #LIBS += -l$$(TDLIBPREF)Gs
    182. # #LIBS += -lModelerGeometry
    183. # #LIBS += -l$$(TDLIBPREF)AcisBuilder
    184. # #LIBS += -l$$(TDLIBPREF)Br
    185. # #LIBS += -l$$(TDLIBPREF)BrepRenderer
    186. ##}
    187.  
    188. LIBS += -l$$TDLIBPREF/TD_Key
    189.  
    190. win32 {
    191. LIBS += -l$$TDLIBPREF/TD_ExamplesCommon
    192. }
    To copy to clipboard, switch view to plain text mode 


    Added after 14 minutes:


    Maybe with the dependencywalker can I know something interesting.?
    Thanks.
    Last edited by tonnot; 27th March 2012 at 10:55.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Libraries, problems, external unresolveds..Steps to find the fix

    Maybe. The compiler claims your library (.lib) is corrupted.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Libraries, problems, external unresolveds..Steps to find the fix

    I have the solution.... (I receive help from the owners.)

    I link with the .lib's files but also I must to have the .dll's at the same folder than my executable.
    But.... I dont understand why it is possible?


    It seems that this variable is the guilty:

    DEFINES += _TOOLKIT_IN_DLL_

    But... I dont understand ....
    Static link is not automatic if you use .lib and dynamic if you use dll's ?

    Thanks Wy.

Similar Threads

  1. QtCreator and external libraries
    By GiuseppeBonfa in forum Qt Tools
    Replies: 6
    Last Post: 21st May 2012, 23:26
  2. About Qt and external libraries... Tutorials? Links?
    By tonnot in forum General Programming
    Replies: 3
    Last Post: 12th January 2011, 00:30
  3. Using external libraries
    By Handi in forum Newbie
    Replies: 5
    Last Post: 9th December 2010, 22:51
  4. How to add external Header files and libraries?
    By askbapi in forum Installation and Deployment
    Replies: 6
    Last Post: 30th September 2010, 17:33
  5. Replies: 4
    Last Post: 7th May 2009, 07:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.