PDA

View Full Version : qmake - multiple definition ?



zaphod77
4th April 2011, 20:25
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

TemporalBeing
4th April 2011, 20:56
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.

zaphod77
4th April 2011, 22:04
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 ?

behlkush
6th April 2011, 12:11
Similiar issue is being faced by me. :( :( and still searching for a solution.