Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Apr 2011

    Exclamation QT Application gives Multiple Definition Link Error

    Hi All,

    I am working on a nokia qt appliation development which uses zxing library.
    zxing provides support for decoding both qrcode and data matrix codes.

    There are specific directories for qrcode and data matrix libraries but the problem is that both have the files with the same names.
    eg: zxing/datamatrix/Version.cpp \
    zxing/datamatrix/decoder/BitMatrixParser.cpp \
    zxing/datamatrix/decoder/DataBlock.cpp \
    zxing/datamatrix/decoder/DecodedBitStreamParser.cpp \
    zxing/datamatrix/decoder/Decoder.cpp \
    zxing/datamatrix/detector/Detector.cpp \
    zxing/qrcode/Version.cpp \
    zxing/qrcode/decoder/BitMatrixParser.cpp \
    zxing/qrcode/decoder/DataBlock.cpp \
    zxing/qrcode/decoder/DecodedBitStreamParser.cpp \
    zxing/qrcode/decoder/Decoder.cpp \
    zxing/qrcode/detector/Detector.cpp \

    When I include both of the above folders path in .pro SOURCE += variable, i get multiple definition errors because the .o files generated for qrcode are having the same names as that of data matrix files.
    And thus i get multiple definition errors.
    I have tried using .pri file for and also tried playing around with OBJECTS_DIR qt variable but to no success.

    Can anyone please provide any help on this. How to separate these 2, and still be able to use both libraries?

  2. #2
    Super Contributor
    Join Date
    Nov 2009
    Minnesota, USA

    Re: QT Application gives Multiple Definition Link Error

    First off, are the two sets of files actually different? If not, you're probably only intended to compile one or the other when building the entire suite, and there's likely an #ifdef setting or whatnot to control this.

    If they are different, and there's no provision for adding a namespace or such, then either you're not intended to ever build both sets together or the developers have their heads up their posteriors.

Similar Threads

  1. Replies: 3
    Last Post: 2012-06-20, 11:48
  2. nmake gives error for QT setup
    By shrawan0786 in forum [Archived] Qt SDKs and Tools
    Replies: 3
    Last Post: 2010-06-30, 04:39
  3. Application @ \NokiaQtSDK\Examples\4.6\opengl Gives Link error
    By jafferss in forum [Archived] Qt SDKs and Tools
    Replies: 6
    Last Post: 2010-06-10, 12:35
  4. Multiple definition of `E32Main()'
    By jameskittu in forum Symbian
    Replies: 8
    Last Post: 2010-05-10, 13:14
  5. Replies: 1
    Last Post: 2004-07-17, 12:08

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts