Results 1 to 2 of 2

Thread: .lib and .a file considerations when using DLLs?

  1. #1
    Join Date
    Jan 2013
    Posts
    1
    Platforms
    Windows

    Default .lib and .a file considerations when using DLLs?

    Hi, I'm attempting to start writing a GUI program that must make use of an open source DLL called "epanet2". I've done some google searches on the topic and they seem to only lead to more and more google searches.

    I originally attempted to use this guy's method:

    http://www.youtube.com/watch?v=EIcysZtl8AE

    He just adds the following to project file after compiling the DLL.

    INCLUDEPATH += "C:/Users/Gangming Zhang/Desktop/Epa_Toolkit/include"
    LIBS += "C:/Users/Gangming Zhang/Desktop/Epa_Toolkit/epanet2.lib"


    However upon adding "#include <epanet/epanet.h>" to main, I get an error saying "can't find file epanet.h ". I then tried creating a new project file called epanet.h and pasting the source into it, and then calling it from main via "#include "epanet.h". This leaves me with about 50 compiler errors such as "C4518: 'int ' : storage-class or type specifier(s) unexpected here; ignored" and others.

    After some further googling I found the issue may be I'm attempting to use a .lib file (for MSVC) instead of a .a file for MinGW. (I'm using Qt with MinGw)

    What are my options here? I have the library source and the makefile, but I'd like to avoid messing with them if possible... don't want to screw anything up.

    I assume I could either a) Reinstall QT with Microsoft Virtual Studios or b) Attempt to compile the library with MinGW instead of Virtual studios to produce a .a file?

    Which of these do y'all think makes more since? Or are there any other options I'm not aware of?

    Much thanks,

    Hunt

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: .lib and .a file considerations when using DLLs?

    You already figured out the options you have.

    I will say try recompiling epanet with MinGw (as you already have the it setup), installing Qt for MSVC, or compiling it with Qt with MSVC will take some time.
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

Similar Threads

  1. Implementation considerations for data flow pattern
    By redBeard in forum Qt Programming
    Replies: 20
    Last Post: 12th January 2011, 00:25
  2. Where are .dlls searched for?
    By Cruz in forum Qt Programming
    Replies: 2
    Last Post: 15th October 2010, 15:40
  3. Replies: 4
    Last Post: 16th May 2010, 12:26
  4. Considerations for a GUI with rich text?
    By hackerNovitiate in forum Newbie
    Replies: 1
    Last Post: 2nd April 2010, 07:39
  5. Qt and dlls ?
    By probine in forum Qt Programming
    Replies: 4
    Last Post: 15th December 2006, 15:12

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.