Question

Is there way to force recompile other projects moc file? I use visual studio, and I got one qt project, where I added other project class with interface and signals/slots (let say thing.cpp, thing.h,

ui_thing.h(has been included generated files folder),

moc_thing.cpp in generated files\debug (because of main projects is in debug mode),

and thing.ui into Form files)

It was working ok until I decided made some changes, add some slot/signals stuff. As you can guess included moc file does not recompiles. I decided to change some properties of the thing.h .

I copied parameters from the main projects files so In the command line part there is

"$(QTDIR)\bin\moc.exe" "$(InputPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_THREAD_SUPPORT -DQT_CORE_LIB -DQT_GUI_LIB -DQWT3D_DLL -DQT_DLL -DQT_SVG_LIB -DQT_SCRIPT_LIB -DQT_MULTIMEDIA_LIB "-I.\parsers" "-I$(QWTDIR)\include" "-I.\ProductionHistory\GeneratedFiles" "-I.\ProductionHistory" "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtSql" "-I$(QTDIR)\include\QtGui" "-I." "-I$(Boost)\." "-I.\well groups widget" "-I.\rules widget" "-I.\gui" "-I$(QTDIR)\include\QtSvg" "-I$(QTDIR)\include\QtScript" "-I$(QTDIR)\include\ActiveQt" "-I$(QTDIR)\include\QtMultimedia"

In the output data part ".\databaseOpening\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp"

In the additional dependencies part there is "$(QTDIR)\bin\moc.exe"; $(InputPath)

But it still not recompiles. Is there way to solve this problem?

No correct solution

OTHER TIPS

Try check/fix project file *.vcxproj

  1. add Keyword in section PropertyGroup Label="Globals"
<PropertyGroup Label="Globals">
   <ProjectGuid>....
   <RootNamespace>...
   <Keyword>Qt4VSv1.0</Keyword> <-----------------
</PropertyGroup>
  1. Check ProjectExtensions/VisualStudio/UserProperties section the attribute Qt5Version_x0020_Win32 ( >>Qt5...)
 <ProjectExtensions>
    <VisualStudio>
      <UserProperties MocDir=".\GeneratedFiles\$(ConfigurationName)" 
         Qt5Version_x0020_Win32="$(DefaultQtVersion)"  <-------
         UicDir=".\GeneratedFiles" />
    </VisualStudio>
  </ProjectExtensions>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top