Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can`t open compiled project

I have compiled project with qmake (qmake -project; qmake; nmake). When I opened file .pro, to reload project I got the following error:

The item "debug\moc_Rls.cpp" already exists under the filter "Generated Files"

Project, being part of soultion now is unavailiable when I open solution.

The evidient question: what to do?

like image 511
spin_eight Avatar asked Jul 18 '26 15:07

spin_eight


2 Answers

Oh, sorry it was my mistake I thought you were on Linux.

Follow these step:

1.Open the [Project_Name].vcxproj.filters file under project directory.

2.See the following lines (I am pasting mine)

  <ItemGroup>
    <ClCompile Include="Main.c">
      <Filter>Source Files</Filter>
    </ClCompile>
    <ClCompile Include="FunctBank.c">
      <Filter>Source Files</Filter>
    </ClCompile>
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="funcDef.h">
      <Filter>Header Files</Filter>
    </ClInclude>
  </ItemGroup>

3.Here you will see debug\moc_Rls.cpp defined twice under two filters.

4.One of them I can guess is

<ClInclude Include="debug\moc_Rls.cpp">
  <Filter>Generated Files</Filter>
</ClInclude>

And the other one you have to detect yourself.

After finding remove that filter and your project will run smoothly.

like image 80
perilbrain Avatar answered Jul 20 '26 04:07

perilbrain


This is an old question but I just experienced this issue so am sharing the solution. I had used QTCreator to create a form class in another subfolder. In doing so the "duplicate" files had been added to the qrc file, which for some reason QTCreator saw as the project file. Removing the entries from the qrc fixed it.

like image 22
garf_a Avatar answered Jul 20 '26 05:07

garf_a



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!