Skip to main content
DSwea.1
Associate III
November 15, 2021
Question

Attempt to rename screen Main cannot be completed. Old MainViewBase remains in generated subdir.mk

  • November 15, 2021
  • 2 replies
  • 757 views

This should be a pretty simple thing...

I created a TouchGFX 4.17.0 project for my STM32H735G-DK dev kit using the Keyboard Example. I import the project into STM32CubeIDE 1.7.0. I generate code in TouchGFX, refresh in the IDE, build and download in the IDE.

But I eventually intend to customize the project and then move into a separate multi-screen project that is my ultimate target. So, I wish to rename the screen "Main" in the example project to the more meaningful name "Keyboard". I use the rename function in TouchGFX to do so. This creates a new set of .cpp/.hpp files "KeyboardView, KeyboardPresenter, etc." but does not move the contents of the old files, which I must do manually (the old Main* files are not removed by the rename.

I then quit the IDE, and in Windows Explorer, locate all .cpp/.hpp files with the name MainView* and delete them from the project directories. I restart TouchGFX and generate code. I restart the IDE, refresh and build.

I get the error: "make: *** No rule to make target 'Application/User/generated/MainViewBase.o', needed by 'STM32H735G-DK.elf'. Stop."

Using NotePad++, I do a global file search of the project for references to "MainViewBase". Among numerous other results, the search returns:

 D:\STM32Cube\KeyboardExample-WS\KeyboardExample\STM32CubeIDE\Debug\Application\User\generated\subdir.mk (3 hits)

Line 24: ../Application/User/generated/MainViewBase.cpp \

Line 58: ./Application/User/generated/MainViewBase.o \

Line 92: ./Application/User/generated/MainViewBase.d \

Inspection of the tile subdir.mk shows that the references are entered in a distinctly different manner that other entries, as seen in the surrounding lines:

D:/STM32Cube/KeyboardExample-WS/KeyboardExample/TouchGFX/generated/texts/src/LanguageGb.cpp \

../Application/User/generated/MainViewBase.cpp \

D:/STM32Cube/KeyboardExample-WS/KeyboardExample/TouchGFX/generated/fonts/src/Table_RobotoCondensed_Regular_20_4bpp.cpp \

Despite multiple attempts to make this go away---clean project, rebuild; quit/restart TGFX/IDE, generate code, refresh, build---I cannot make this go away. TGFX keeps putting it back into the build, and, since it's a generated file, I can't just edit it out.

How can it be this difficult to simply rename a screen?

This topic has been closed for replies.

2 replies

DSwea.1
DSwea.1Author
Associate III
November 16, 2021

Solved by deleting the project's .metadata file (which contained references to MainViewBase) and restarting, and reimporting the project. How things got into this state remains a mystery, though I've seen similar cases of "orphans". Hope is that this solution will work for others in the future, though it's a bit of trouble to set things up again in the IDE the way they were before.

wired
Senior II
December 1, 2021

I had the same problem. I reported this as a bug, and it will supposedly be addressed in 'a future release'. You have to delete the old files in the /generated folder, rename the corresponding files in your /gui folder (you may need to delete the ones the Designer created), then open up all the files under the /gui folder that contain the old class name and do a global replace. Not fun. I did not have to delete the metadata file and re-import the project as you did.