Results 1 to 20 of 28

Thread: project with a dll and a testprog (doesn't compile)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2006
    Posts
    79
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: project with a dll and a testprog (doesn't compile)

    So how can i get the lib file?

    I've tried compiling the lib statically and a calina.lib was created, but the result of compiling the tester was static too.

    I've looked into the qt/lib directory. For instance QtGui has 9 files:
    QtGui4.dll
    QtGui4.exp
    QtGui4.lib
    QtGui.prl

    QtGuid4.dll
    QtGuid4.exp
    QtGuid4.lib
    QtGuid4.pdb
    QtGuid.prl

    I assume the d in the second list stands for debug, because there is also a pdb file (program debug file from vs). But there are still 4 files for one lib, in my project there is only one (calina.dll) created.

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: project with a dll and a testprog (doesn't compile)

    It will be generated automatically...
    It is by default placed in Debug or Release, depending on which target you compile/.

    Regards

  3. #3
    Join Date
    Jul 2006
    Posts
    79
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: project with a dll and a testprog (doesn't compile)

    They aren't. In the debug/releas folders are only the moc_blabla.cpp, blabla.obj and calina.intermediate.manifest files.

  4. #4
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: project with a dll and a testprog (doesn't compile)

    check out your destdir... the .lib (and maybe .exp whatsoever...) should be in the same dir as the .dll unless they fail to be created which you would see when compiling the lib.
    Current Qt projects : QCodeEdit, RotiDeCode

  5. #5
    Join Date
    Jul 2006
    Posts
    79
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: project with a dll and a testprog (doesn't compile)

    I've looked into all directories, I've even tried to remove the target and destdir variables, but nmake always creates only the dll..

    Maybe I could post the project as an zip file and you look into it (if that isn't too much work)?

  6. #6
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: project with a dll and a testprog (doesn't compile)

    can't you send us the very last lines of compilation output? Those which would inform us of the linking process... If I remember well, under Windows, a missing symbol (e.g. a function defined but not implemented) can prevent the import library from being created...
    Current Qt projects : QCodeEdit, RotiDeCode

  7. #7
    Join Date
    Jul 2006
    Posts
    79
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: project with a dll and a testprog (doesn't compile)

    Qt Code:
    1. compiling, compiling blabla...
    2. cl -c -nologo -Zm200 -GS -O2 -MD -DNDEBUG -GR -EHsc -W3 -DUNICODE -DQT_L
    3. ARGEFILE_SUPPORT -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
    4. -DQT_THREAD_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI
    5. _LIB -DQT_CORE_LIB -I"c:\qt\include\QtCore" -I"c:\qt\include\QtCore" -I"c:\qt\in
    6. clude\QtGui" -I"c:\qt\include\QtGui" -I"c:\qt\include\QtOpenGL" -I"c:\qt\include
    7. \QtOpenGL" -I"c:\qt\include\QtXml" -I"c:\qt\include\QtXml" -I"c:\qt\include" -I"
    8. c:\qt\include\ActiveQt" -I"release" -I"." -I"c:\qt\mkspecs\win32-msvc2005" -Fore
    9. lease\ @C:\DOKUME~1\damdam\LOKALE~1\Temp\nm2.tmp
    10. moc_widget.cpp
    11. moc_layout.cpp
    12. moc_glwidget.cpp
    13. moc_graphicsobject.cpp
    14. Code is getting generated... //orig german: Code wird generiert..
    15. link /LIBPATH:"c:\qt\lib" /NOLOGO /DLL /MANIFESTFILE:"release\calina.int
    16. ermediate.manifest" /incremental:no /OUT:"..\bin\calina.dll" @C:\DOKUME~1\damdam
    17. \LOKALE~1\Temp\nm3.tmp
    18. mt.exe -nologo -manifest "release\calina.intermediate.manifest" -outputr
    19. esource:..\bin\calina.dll;2
    To copy to clipboard, switch view to plain text mode 

    There are some warnings because of converting double to float, but i don't think that should make any difference..

  8. #8
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: project with a dll and a testprog (doesn't compile)

    C:\environments\tests\libtest>nmake

    Microsoft (R) Program Maintenance Utility Version 7.10.3077
    Copyright (C) Microsoft Corporation. All rights reserved.

    nmake -f Makefile.Debug

    Microsoft (R) Program Maintenance Utility Version 7.10.3077
    Copyright (C) Microsoft Corporation. All rights reserved.

    cl -c -nologo -Zm300 -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -D
    WIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUP
    PORT -I"..\..\..\Qt\4.3.0rc1\include\QtCore" -I"..\..\..\Qt\4.3.0rc1\include\QtC
    ore" -I"..\..\..\Qt\4.3.0rc1\include\QtGui" -I"..\..\..\Qt\4.3.0rc1\include\QtGu
    i" -I"..\..\..\Qt\4.3.0rc1\include" -I"." -I"..\..\..\Qt\4.3.0rc1\include\Active
    Qt" -I"debug" -I"." -I"..\..\..\Qt\4.3.0rc1\mkspecs\default" -Fodebug\ @D:\DOCUM
    E~1\Marcel\LOCALS~1\Temp\nm76E.tmp
    libtest.cpp
    libtest.cpp(4) : warning C4273: 'libtest::libtest' : inconsistent dll linkage
    libtest.cpp(9) : warning C4273: 'libtest::~libtest' : inconsistent dll linkage
    link /LIBPATH:"c:\Qt\4.3.0rc1\lib" /NOLOGO /DEBUG /DLL /OUT:debug\libtes
    t.dll @D:\DOCUME~1\Marcel\LOCALS~1\Temp\nm76F.tmp
    Creating library debug\libtest.lib and object debug\libtest.exp

    C:\environments\tests\libtest>
    ################################################## ####################
    # Automatically generated by qmake (2.01a) Tue Jul 24 22:10:16 2007
    ################################################## ####################

    TEMPLATE = lib
    TARGET =
    DEPENDPATH += .
    INCLUDEPATH += .

    # Input
    HEADERS += libtest.h libtest_global.h
    SOURCES += libtest.cpp
    That is what you should get.

    Regards

  9. #9
    Join Date
    Jul 2006
    Posts
    79
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: project with a dll and a testprog (doesn't compile)

    I now have nearly the same pro file (only some more headers and sources), I have even dropped the double->floats and the opengl support.

    But the lib files are still not generating..


    Edit: I now see, that there is a difference. I have VS 8 (2005, no sp1) and you 7 (afaik 2003). Is that importand?

  10. #10
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: project with a dll and a testprog (doesn't compile)

    Can you post the code for the library?

    The problem must lie there.

    Regards

  11. #11
    Join Date
    Jul 2006
    Posts
    79
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: project with a dll and a testprog (doesn't compile)

    here you are..
    and thanks for looking into it..
    Attached Files Attached Files

  12. #12
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: project with a dll and a testprog (doesn't compile)

    Yes. You didn't export anything for the library so the linker didn't need to create a lib.
    You have to add Q_DECL_EXPORT to every class you want to export.
    Something like:
    Qt Code:
    1. //==========================================================//
    2. // //
    3. // Diplomprojekt Calina (platformuebergreifende 3d GUI) //
    4. // //
    5. //==========================================================//
    6. // Autoren: Adam Celarek (diplom_arbeit at xibo at) //
    7. // Patrick Freninger () //
    8. // Sebastian Raggl () //
    9. //==========================================================//
    10.  
    11. /***************************************************************************
    12.  * This program is free software; you can redistribute it and/or modify *
    13.  * it under the terms of the GNU General Public License as published by *
    14.  * the Free Software Foundation; either version 2 of the License, or *
    15.  * (at your option) any later version. *
    16.  * *
    17.  * This program is distributed in the hope that it will be useful, *
    18.  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
    19.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
    20.  * GNU General Public License for more details. *
    21.  * *
    22.  * You should have received a copy of the GNU General Public License *
    23.  * along with this program; if not, write to the *
    24.  * Free Software Foundation, Inc., *
    25.  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
    26.  ***************************************************************************/
    27. #ifndef CALINAGLWIDGET_H
    28. #define CALINAGLWIDGET_H
    29.  
    30. #include <QGLWidget>
    31. #include "helper.h"
    32.  
    33. namespace calina {
    34.  
    35. /**
    36.  * @brief
    37.  *
    38.  *
    39.  *
    40.  * @author Adam Celarek <testman@xibo.at>
    41.  * @todo Dokumentation von da Klassn.. Wegn Prototyp deadline keine Zeit..
    42.  */
    43.  
    44. class World;
    45.  
    46. class [B]Q_DECL_EXPORT[/B] GLWidget : public QGLWidget {
    47. Q_OBJECT
    48. public:
    49. GLWidget(WidgetList& widgetList, QObject *parent = 0);
    50. ~GLWidget();
    51.  
    52. void initializeGL();
    53. void resizeGL(int w, int h);
    54. void paintGL();
    55. World* parentWorld() const;
    56.  
    57. private:
    58. WidgetList& p_widgetList;
    59. };
    60.  
    61. }
    62.  
    63. #endif
    To copy to clipboard, switch view to plain text mode 

    I added them and got:
    Generating Code...
    cl -c -nologo -Zm300 -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -D
    WIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB
    -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"c:\Qt\4.3.0rc1\include\QtCore" -I"c:\Qt\4.3
    .0rc1\include\QtCore" -I"c:\Qt\4.3.0rc1\include\QtGui" -I"c:\Qt\4.3.0rc1\include
    \QtGui" -I"c:\Qt\4.3.0rc1\include\QtOpenGL" -I"c:\Qt\4.3.0rc1\include\QtOpenGL"
    -I"c:\Qt\4.3.0rc1\include\QtXml" -I"c:\Qt\4.3.0rc1\include\QtXml" -I"c:\Qt\4.3.0
    rc1\include" -I"." -I"c:\Qt\4.3.0rc1\include\ActiveQt" -I"debug" -I"." -I"c:\Qt\
    4.3.0rc1\mkspecs\default" -Fodebug\ @D:\DOCUME~1\Marcel\LOCALS~1\Temp\nm783.tmp
    moc_glwidget.cpp
    moc_graphicsobject.cpp
    moc_layout.cpp
    moc_widget.cpp
    Generating Code...
    link /LIBPATH:"c:\Qt\4.3.0rc1\lib" /NOLOGO /DEBUG /DLL /OUT:debug\calina
    .dll @D:\DOCUME~1\Marcel\LOCALS~1\Temp\nm784.tmp
    Creating library debug\calina.lib and object debug\calina.exp

    D:\Documents and Settings\Marcel\Desktop\calina\calina\calina>

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
  •  
Qt is a trademark of The Qt Company.