Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7414565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:07:32+00:00 2026-05-29T07:07:32+00:00

I have 2 classes with the same name but in different namespaces. I can’t

  • 0

I have 2 classes with the same name but in different namespaces. I can’t change the naming of these classes or files. The problem is, qmake generates a Makefile with folder information dropped. So it creates OBJECTS targets with flat file names.

Makefile generated by qmake:

SOURCES       = ../quml/src/lang/Type_.cpp \
    ...
    ../quml/src/uml/Type_.cpp \
    ...

OBJECTS       = Type_.o \
    ...
    Type_.o \
    ...

As you can see, there are 2 .cpp files in very different folders. This is supposed to link both objects files later into one executable. It does try so, but taking twice the same file, producing duplicate symbols and lacking the others, because the Type_.o is created from only one of the .cpp files (last one wins). This basically means I can never have 2 source files with same name in different folders applied to the same target.

Anybody any idea how I can solve this? Would any pro/pri tricks or subdir’ing help here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:07:34+00:00Added an answer on May 29, 2026 at 7:07 am

    The best of solutions I’ve found for this issue is try to create .pro (or simple Makefile) files for each folder and compile them as static libraries, or simply change their names.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have two different cpp files. Both declare classes with the same name,
The same problem as NHibernate DuplicateMappingException when two classes have the same name but
I have a function with the same name, but with different signature in a
I have 2 different classes but same primitive type declaration as you see below
Is it possible to use 2 CSS classes that have the same name for
I have classes that are named exactly the same across different plug-ins that I
I have two different packages with the same name, each with a set of
If I have those two classes that have two different properties but with the
I have 2 classes within same package. Both classes have main method in them.
I have the same classes on my server and on my web service. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.