Results 1 to 7 of 7

Thread: Problem using discount library

  1. #1
    Join Date
    Mar 2014
    Posts
    17
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Problem using discount library

    i’m working on project that uses discount library.
    http://www.pell.portland.or.us/~orc/Code/discount/
    i installed the library on my machine and included:

    Qt Code:
    1. #include <mkdio.h>
    To copy to clipboard, switch view to plain text mode 

    and i have this piece of code:

    Qt Code:
    1. MMIOT* document = 0;
    2. char* result;
    3. QString sourceMarkdown(markdown);
    4. if (!sourceMarkdown.endsWith('\n'))
    5. sourceMarkdown.append('\n');
    6. QByteArray data = sourceMarkdown.toUtf8();
    7. document = mkd_string(data,data.length(),MKD_NOPANTS);
    8. mkd_compile(document,MKD_NOPANTS);
    9. mkd_document(document,&result);
    10. QString renderedHtml = QString::fromUtf8(result);
    11. return renderedHtml;
    To copy to clipboard, switch view to plain text mode 

    usualy i use “-lmarkdown” flag to compile it (for discount shared library). but in Qt i dont know how.
    i tried
    Qt Code:
    1. QMAKE_LFLAGS += -lmarkdown
    To copy to clipboard, switch view to plain text mode 

    and

    Qt Code:
    1. unix|win32: LIBS += -lmarkdown
    To copy to clipboard, switch view to plain text mode 

    but didn’t work.
    any help?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Problem using discount library

    The LIBS variant is the right one, but this will only find the library if it is in the compiler/linker's search path.
    Usually the LIBS string also needs and -L directive to add the library's path to that.

    Cheers,
    _

  3. #3
    Join Date
    Mar 2014
    Posts
    17
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Problem using discount library

    welcom,
    i tried this

    LIBS += -L/usr/local/lib/ -lmarkdown

    but didn't work either :-(
    and the result is : undefined reference to ...

  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: Problem using discount library

    Is /usr/local/lib where you installed the library?
    Did you rerun qmake after making that change?
    Is the "undefined reference to ..." Error message even related to the discount library? ... We cannot see.

  5. #5
    Join Date
    Mar 2014
    Posts
    17
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Problem using discount library

    the path is:
    /usr/local/lib/libmarkdown.a
    i'm using QtCreator and qmake should update automaticlly
    sure :-) , undefined reference to mkd_string() mkd_compile() mkd_document()

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Problem using discount library

    Does the library contain the symbol?

    Qt Code:
    1. objdump -t /usr/local/lib/libmarkdown.a | grep mkd_compile
    To copy to clipboard, switch view to plain text mode 

    Cheers,
    _

  7. #7
    Join Date
    Mar 2014
    Posts
    17
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Problem using discount library

    Thank you guys
    i solved it, just used:

    Qt Code:
    1. extern "C" {
    2. #include <mkdio.h>
    3. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Using Qt 4.8.2 with OpenCV 2.4 Library Problem
    By omaroo161 in forum Installation and Deployment
    Replies: 1
    Last Post: 25th July 2012, 11:02
  2. Ssl library problem
    By zgulser in forum Installation and Deployment
    Replies: 0
    Last Post: 16th April 2012, 11:32
  3. Custom library problem
    By Dario in forum Newbie
    Replies: 6
    Last Post: 16th February 2011, 06:45
  4. so shared library problem
    By mtrpoland in forum Newbie
    Replies: 3
    Last Post: 13th August 2007, 21:51
  5. shared library problem
    By nhatkhang in forum KDE Forum
    Replies: 9
    Last Post: 28th November 2006, 04:07

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.