Skip to main content
Associate III
Oct 22, 2024 9:37 AM UTC
Solved

error when compiling with makefile

Hi everyone,

I am developing a new project with SMT32H7 MCU series, in which I have added the ITTIA DB middleware.

I’m encountering an issue while trying to compile my project using a Makefile. The Makefile was auto-generated, and the error I get during compilation is:

make: *** No rule to make target `build/oslib.cpp', needed by `build/M0045-8000_TheHeecapDevice.elf'. Stop.
make: *** Waiting for unfinished jobs....

The oslib.cpp file is present in my project directory, but it seems like the Makefile isn’t properly handling the .cpp file. Therefore, I am assuming that there is a problem with the makefile, since it cannot find/build cpp files.

What do I have to change in order to compile my project?

Here is the makefile attached.

 

This topic has been closed for replies.
Pavel A.
Pavel A.Best answer
Oct 22, 2024 12:15 PM UTC

The makefile lacks definitions for .cpp sources. The cpp files are not added to OBJECTS, and no definition for the  c++ (g++) compiler, and vpath statement is missing for .cpp. 

3 replies

Pavel A.
Pavel A.Best answer
Oct 22, 2024 12:15 PM UTC

The makefile lacks definitions for .cpp sources. The cpp files are not added to OBJECTS, and no definition for the  c++ (g++) compiler, and vpath statement is missing for .cpp. 

Associate III
Oct 25, 2024 8:40 PM UTC

Thank you!

Pavel A.
Oct 25, 2024 8:54 PM UTC

OBJECTS += ...