Results 1 to 4 of 4

Thread: qmake - multiple definition ?

  1. #1
    Join Date
    Mar 2011
    Location
    Germany, Munic
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default qmake - multiple definition ?

    hi coderz

    i have a problem of how to organize source files for qmake.
    structure

    a/viewer3.cpp
    ...
    ..
    b/x/nice/viewer3.cpp

    viewer3.cpp is just a simple name within a directory for a bunch of methods.
    same filenames in different folders sometimes can happen and make sense in the right context.
    cmake can handle this.

    if i call qmake -project everything seems ok.
    after calling make i get "multiple definition"... what's not right from my point of view.


    qmake also created "object_script.lea.Release" // project called lea
    ...
    ./winRelease/.obj/viewer3.o
    ./winRelease/.obj/bubble.o
    ./winRelease/.obj/overpaint.o
    ./winRelease/.obj/viewer3.o
    ./winRelease/.obj/calc3.o
    ...

    allright - viewer3.o 2 times found in same folder - this cannot work!

    do i have to use unique filnames always in every subfolder?
    i thought (hoped) that qmake can handle files with same name and different path.

    can i persuade qmake to create subdirs for the o files in the same structure like the source of project ?

    thank you for help,
    greetings

  2. #2
    Join Date
    Feb 2009
    Posts
    29
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy Re: qmake - multiple definition ?

    Sadly it does not seem that qmake can handle this case at that time. Yes, I keep running into that issue too. Yes, cmake and pretty much any other tool out there can handle that use-case.

    So for now it seems that yes we have to ensure that any cpp file in a single Qmake project is unique - beware using PRI's and such since they can add files to your project too.

  3. The following user says thank you to TemporalBeing for this useful post:

    zaphod77 (4th April 2011)

  4. #3
    Join Date
    Mar 2011
    Location
    Germany, Munic
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qmake - multiple definition ?

    Quote Originally Posted by TemporalBeing View Post
    beware using PRI's and such since they can add files to your project too.
    mmmh - i'm new with qmake and it's hard to find infos about PRI files.
    What are PRI files ?
    How can PRI files help to have non-unique source-filenames ?

  5. #4
    Join Date
    Apr 2011
    Posts
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qmake - multiple definition ?

    Similiar issue is being faced by me. and still searching for a solution.

Similar Threads

  1. multiple definition error - NokiaQtSDK maemo
    By raedbenz in forum Newbie
    Replies: 2
    Last Post: 21st July 2010, 08:03
  2. Multiple definition of a variable?
    By T0bi4s in forum Newbie
    Replies: 5
    Last Post: 14th January 2010, 22:13
  3. Replies: 2
    Last Post: 25th June 2009, 19:47
  4. Multiple Definition errors in moc_<Obj>.cpp and moc_<Obj>_obj.cpp
    By Doug Broadwell in forum Qt Programming
    Replies: 2
    Last Post: 27th October 2007, 19:10
  5. Getting multiple definition error from qatomic_x86_64.h
    By markcole in forum General Programming
    Replies: 1
    Last Post: 30th August 2007, 19:39

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.