September 6, 2010

lyuts lyuts
Lab Rat
169 posts

warning: duplicate script for target

 

Hi, guys.

I’m trying to build my project, but getting this error.

  1. "Makefile", line 353: warning: duplicate script for target ".obj/Language.o" ignored
  2. "Makefile", line 356: warning: duplicate script for target ".obj/Procedure.o" ignored

The truth is, I have several files Language.{cpp,h} and Procedure.{cpp,h} under different directories. And these files are different. And as I understand this conflict causes the above error.

My question is: Is there any way to make qmake handle this issue? Or I will have to rename some of these files in order to avoid name duplication?

 Signature 

I’m a rebel in the S.D.G.

2 replies

September 6, 2010

Denis Kormalev Denis Kormalev
Lab Rat
1654 posts

Maybe you can move them to SUBDIRS type of .pro file with staticaly linkage between them? It can help you. In this case each directory will be built into .a file (static library) and after it you can link them all into one executable.

September 7, 2010

lyuts lyuts
Lab Rat
169 posts

Thanks, Denis. What I’m trying to build now (this is actually a static lib) is already a part of SUBDIRS type .pro file. I thought about making the lib’s top .pro file with SUBDIRS template, and putting a separate .pro file in all nested directories with OBJECTS_DIR overridden for each directory, so that object files do not conflict. I will keep this solution in mind.

To my point view, the best solution would be making qmake create the same directory structure under specified OBJECTS_DIR. I mean, let say we have

  1. OBJECTS_DIR = .obj
  2. SOURCES = Type1/*.cpp \
  3.                Type2/*.cpp

and it will be just great, if qmake creates .obj, .obj/Type1, .obj/Type2 directories and puts .o files according to their location. Is this possible?

 Signature 

I’m a rebel in the S.D.G.

 
  ‹‹ QSqlTableModel submitAll problem      Building UI with QGraphics ››

You must log in to post a reply. Not a member yet? Register here!