Results 1 to 4 of 4

Thread: HELP! Need to run cryptopp from Qt Creator

  1. #1
    Join Date
    Aug 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default HELP! Need to run cryptopp from Qt Creator

    Hello,
    I have cryptopp 5.3.0 and try to run it from Qt Creator 2.1.0 (Qt 4.7.2).
    I have cryptopp.dll and cryptopp.lib downloaded from Crypto++ site.

    Any attempt to run any code from cryptopp library results in LINKER error (LNK2001).

    I will appreciate any help (like example or hint or link).

    The .pro file is:
    Qt Code:
    1. #-------------------------------------------------
    2. #
    3. # Project created by QtCreator 2011-08-11T15:29:52
    4. #
    5. #-------------------------------------------------
    6.  
    7. QT += core
    8. QT -= gui
    9.  
    10. TARGET = Testik
    11.  
    12. CONFIG += console
    13. CONFIG -= app_bundle
    14.  
    15. TEMPLATE = app
    16.  
    17. SOURCES += main.cpp
    18.  
    19. LIBS += -Lcryptopp
    To copy to clipboard, switch view to plain text mode 

    And my main.cpp (there is no more files):
    Qt Code:
    1. #include <iostream>
    2.  
    3. #define CRYPTOPP_DEFAULT_NO_DLL
    4. #include <cryptopp/dll.h>
    5. #ifdef CRYPTOPP_WIN32_AVAILABLE
    6. #include <windows.h>
    7. #endif
    8. #include <cryptopp/md5.h>
    9.  
    10. int main(int argc, char *argv[])
    11. {
    12.  
    13. byte digest[ CryptoPP::MD5::DIGESTSIZE ];
    14. CryptoPP::HexEncoder encoder;
    15.  
    16. return 0;
    17. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by Lykurg; 12th August 2011 at 06:53. Reason: missing [code] tags

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: HELP! Need to run cryptopp from Qt Creator

    Your LIBS setting is incorrect. Try:
    Qt Code:
    1. LIBS += -L/path/to/CryptoPP/lib_dir -lcryptopp
    To copy to clipboard, switch view to plain text mode 
    (lib_dir contains cryptopp.lib)

    You are possibly also missing an INCLUDEPATH, but if you get through compilation without it then the CryptoPP headers must be in a default location.
    "We can't solve problems by using the same kind of thinking we used when we created them." -- Einstein
    If you are posting code then please use [code] [/code] tags around it - makes addressing the problem easier.

  3. #3
    Join Date
    Feb 2013
    Posts
    71
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: HELP! Need to run cryptopp from Qt Creator

    Hello I too am having problems including cryptopp in qt creator...I have an include path and the path set just like you described chris. I try different methods and I get linker errors, debug/exe errors, cannot find cryptopp.h...don't know what debug/exe error is.

    this is my current include

    Qt Code:
    1. INCLUDEPATH += <C:\Users\myname\Documents\cryptoProject\cryptopp>
    2. LIBS += -L/path/to/CryptoPP/lib_dir -lcryptopp
    To copy to clipboard, switch view to plain text mode 

    The funny thing is when i hover over the includes in my mainwindow.cpp it shows the crypto includes directory...

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: HELP! Need to run cryptopp from Qt Creator

    Line 1: "<C:\Users\myname\Documents\cryptoProject\cryptopp >" is not a file path. Lose the "<" and ">" and switch all the "\" to "/". If the path contains spaces then you need to enclose it in quotes or move the library to somewhere without spaces in the path.
    Line 2: You are supposed to replace "/path/to/CryptoPP/lib_dir" with the actual path you the directory containing the Crypto++ library

Similar Threads

  1. QT creator +SDL
    By ShapeShiftme in forum Qt Tools
    Replies: 2
    Last Post: 19th December 2010, 11:44
  2. Using QCA with QT Creator
    By mrstif in forum Newbie
    Replies: 4
    Last Post: 18th October 2010, 16:31
  3. Using git with qt creator
    By dreamh4k in forum Qt Programming
    Replies: 1
    Last Post: 29th June 2010, 00:18
  4. Qt Creator
    By fnmblot in forum General Discussion
    Replies: 3
    Last Post: 12th April 2009, 08:06
  5. Qt Creator on Mac OS X
    By stephenju in forum Qt Tools
    Replies: 2
    Last Post: 12th March 2009, 21:51

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.