Results 1 to 7 of 7

Thread: Using libraries compiled with Cygwin

  1. #1
    Join Date
    Mar 2010
    Posts
    55
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Using libraries compiled with Cygwin

    I'm trying to integrate a library into my Qt project; specifically, this one: http://trac.osgeo.org/proj/

    I would like to link statically, so I downloaded the zipped source and extracted. I then compiled the library in a Cygwin environment (I'm on a Windows platform) and consequently got my static library objects.

    Now I tried linking to them, but something odd happened.

    First when I ran it from Qt Creator, the program terminated immediately with an error code. So I tried running the executable from the debug directory, and it complained about missing Cygwin DLLs, specifically cygproj-0.dll and cygwin1.dll. Why do I need these libraries in my Qt project, when I'm not explicitly linking to them? Is it because the library I AM linking to was compiled in a Cygwin environment? Is there a way around this?

    So I copied over the necessary DLLs, but now when I run my executable, I can see that it appears in Task Manager, but just appears to be eating up CPU cycles (takes up 50% on my dual-core system.)
    I know there's nothing wrong with the libraries themselves, because if I write a very simple, minimalistic program (no using Qt, but just a simple C-program with a mainline) and link to the library, it runs just fine.

    Any idea what's going on?

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Using libraries compiled with Cygwin

    Yes, an application written using Cygwin requires the Cygwin DLLs. If you don't like this, use MinGW, and then you only need the MinGW DLLs in certain cases (if you use exceptions, I believe).

  3. #3
    Join Date
    Mar 2010
    Posts
    55
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Using libraries compiled with Cygwin

    Alright, that explains that.

    But I still don't understand why my Qt app freezes when linked to this library. If I try to create a very minimalistic Qt app and link, it doesn't work.

    Does Qt not play nice with external libraries?

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Using libraries compiled with Cygwin

    Maybe you don't have the calling convention correct ? The wrong calling type will trash the stack and crash your application.

  5. #5
    Join Date
    Mar 2010
    Posts
    55
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Using libraries compiled with Cygwin

    Calling convention is definitely correct. Used the same thing for both test programs. The one compiled without Qt worked, the one compiled with Qt did not.

  6. #6
    Join Date
    Jan 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Using libraries compiled with Cygwin

    I have the same issue by linking loundmouth library by Cygwin. To link the library without Qt is fine, but if linked with Qt, the program will eat 100% cpu

  7. #7
    Join Date
    Dec 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Using libraries compiled with Cygwin

    Sorry if this is just totally wrong (I'm still a n00b) but would how you compiled the Cygwin stuff have anything to do with the problem?

    http://www.mingw.org/wiki/FAQ
    Scroll down to the section: "How do I use MinGW with Cygwin"

Similar Threads

  1. Qt embedded,cygwin and windows xp
    By Atuti2009 in forum Installation and Deployment
    Replies: 1
    Last Post: 10th November 2009, 07:44
  2. Build Qt under cygwin with gcc
    By lixo1 in forum Installation and Deployment
    Replies: 0
    Last Post: 22nd June 2009, 11:37
  3. Qt4 in cygwin
    By ankit17.ag in forum Qt Programming
    Replies: 2
    Last Post: 11th December 2008, 21:11
  4. qt-x11-OS-4.3.3 on Cygwin? err: compiler not supported.
    By ghostcorps in forum Installation and Deployment
    Replies: 6
    Last Post: 15th January 2008, 17:01
  5. Qt, Windows and cygwin --- crt0.o: No such file ...?
    By TheRonin in forum Qt Programming
    Replies: 1
    Last Post: 27th October 2006, 10:16

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.