Results 1 to 7 of 7

Thread: dll yet again

  1. #1
    Join Date
    Sep 2009
    Location
    Belgrade, Serbia
    Posts
    40
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default dll yet again

    Ok. I have made a shared library project. Compiled it into a dll. It is very simple dll just defining one class with one member and one method. Then I tried to add this dlll to a new project and failed. I have read post on this forum concerning this problem but I am still unable to do this. Probably missing something stupid.

    In the attachment are MyClass project which makes the dll, Using project in which I what to add MyClass.dll and Using1 project in which I tried to add MyClass.dll and failed. Please take a look and tell me what am I doing wrong.

    I have tried this using Qt 4.5.2 and Windows XP servise pack 2.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: dll yet again

    read this thread.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. The following user says thank you to spirit for this useful post:

    frenk_castle (19th October 2009)

  4. #3
    Join Date
    Sep 2009
    Location
    Belgrade, Serbia
    Posts
    40
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: dll yet again

    First thanks. I will take I detailed look at your example after a completely wake up.

    If I see correctly and I say again I just woke up so my mental powers are not 100% you needed the whole project which makes the dll in order this to work. I was trying to make the dll as a shared library using Qt and then just connect that complete dll to my next project. For instance. I make a dll which has classes used for fractal computing. I email that dll to my friend who is a physicist he connect his project to my dll and use my classes for his project.

    I know that this may be ungrateful on my part but can you connect Qt project to an already compiled dll, dll is made by Qt also, and use it without anything else? When i think about it the answer will probably be no but just to be sure.

    Thanks in advance.

  5. #4
    Join Date
    Jun 2008
    Posts
    25
    Thanks
    9
    Thanked 1 Time in 1 Post

    Default Re: dll yet again

    I tried out your zip file with the following modifications...

    First in your usage1, include the path for the header file. This removes the compiler errors..

    Second: linker - Aditional Library Directories: include the path to the lib file
    Aditional Dependencies : include MyClass.lib
    Also copy your dll file to the usage1 debug folder.

  6. #5
    Join Date
    Sep 2009
    Location
    Belgrade, Serbia
    Posts
    40
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: dll yet again

    Thanks. I will try it like that. If it is not to much trouble could you zip your modifications and put that modified and working project back on the board just in case I can't replicate your instructions. Thanks again.

  7. #6
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: dll yet again

    this is your example with some modifications. after compilation you should put dll in directory with executable.
    Attached Files Attached Files
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  8. #7
    Join Date
    Sep 2009
    Location
    Belgrade, Serbia
    Posts
    40
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: dll yet again

    Thank you guys very much.

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.