Results 1 to 4 of 4

Thread: Including GMP in Qt-Project

  1. #1
    Join Date
    Jun 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Including GMP in Qt-Project

    Hi there,

    I have a problem, which is a general Qt/C++-Question: How do I include an external library (adding it to the include path)?

    In this case I want to include GMP-Library. I think the answer is very simple, but I don't get it work.
    I'm using Linux Ubuntu 10.4 and M$ Windows, but I think this question is platform independent.

    Please help me,
    Tillorgias

  2. #2
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Including GMP in Qt-Project

    Something along these lines:
    Qt Code:
    1. win32:INCLUDEPATH += C:\Qt\libs\zlib-1.2.5
    2.  
    3. #INCLUDEPATH - add here path to the SRC that will NEVER change i.e. system src etc.
    4. #DEPENDPATH - add here SRC that WILL CHANGE, to trigger BUILD!
    To copy to clipboard, switch view to plain text mode 

    in pro file
    Last edited by Talei; 3rd July 2010 at 18:54.

  3. #3
    Join Date
    Jun 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Including GMP in Qt-Project

    Hi,

    thanks for the help. But do you know WHICH paths are needed for using GMP-Library (on Ubuntu)? That would help a lot because I never worked with external libs before.

    Tillorgias
    You ask me, why I don't like Mac OS X? It's because I like computers.

    C++ with Qt is an other language.

  4. #4
    Join Date
    Jun 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Including GMP in Qt-Project

    OK. I now installed GMP completely. But once I compile it, I get the following (linker-)errors:

    Qt Code:
    1. main.o: In function `initializeGMP()':
    2. main.cpp:(.text+0x3e): undefined reference to `__gmpz_init'
    3. main.cpp:(.text+0x4a): undefined reference to `__gmpz_init'
    4. main.cpp:(.text+0x56): undefined reference to `__gmpz_init'
    5. main.cpp:(.text+0x62): undefined reference to `__gmpz_init'
    6. main.cpp:(.text+0x6e): undefined reference to `__gmpz_init'
    7. main.o: In function `RSA_checkKeys()':
    8. main.cpp:(.text+0x21f): undefined reference to `__gmpz_set_str'
    9. main.cpp:(.text+0x237): undefined reference to `__gmpz_set_str'
    10. main.cpp:(.text+0x255): undefined reference to `__gmpz_set_str'
    11. main.o: In function `clearGMP()':
    12. main.cpp:(.text+0x28e): undefined reference to `__gmpz_clear'
    13. main.cpp:(.text+0x29a): undefined reference to `__gmpz_clear'
    14. main.cpp:(.text+0x2a6): undefined reference to `__gmpz_clear'
    15. main.cpp:(.text+0x2b2): undefined reference to `__gmpz_clear'
    16. main.cpp:(.text+0x2be): undefined reference to `__gmpz_clear'
    17. main.o: In function `RSA_generateKeys()':
    18. main.cpp:(.text+0x347): undefined reference to `__gmpz_init'
    19. main.cpp:(.text+0x355): undefined reference to `__gmpz_init'
    20. main.cpp:(.text+0x461): undefined reference to `__gmpz_set_str'
    21. main.cpp:(.text+0x47b): undefined reference to `__gmpz_set_str'
    22. main.cpp:(.text+0x48d): undefined reference to `__gmpz_nextprime'
    23. ...
    To copy to clipboard, switch view to plain text mode 

    I am using the Qt Creator.

    Please help...
    You ask me, why I don't like Mac OS X? It's because I like computers.

    C++ with Qt is an other language.

Similar Threads

  1. Replies: 1
    Last Post: 3rd December 2009, 23:34
  2. including Qt headers in DLL
    By dave_mm0 in forum Newbie
    Replies: 7
    Last Post: 15th July 2009, 21:39
  3. Including libs on windows
    By ucomesdag in forum Qt Programming
    Replies: 2
    Last Post: 17th August 2007, 08:31
  4. including
    By mickey in forum General Programming
    Replies: 2
    Last Post: 26th July 2006, 21:08
  5. Errors including shellapi.h
    By SkripT in forum Qt Programming
    Replies: 8
    Last Post: 1st May 2006, 18:13

Tags for this Thread

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.