I have created an S32DS project for MPC5748G, running S32 design studio for power 1.0.
When I add a new C++ source file using template, the file is not included in the build process.
The new file shows up in the file tree but analyzis of the generated "Debug/src/subdir.mk" file shows that the new file has not been added.
The same thing happens if I try to import an existing file.
Adding a C-file from template works just fine.
已解决! 转到解答。
Hello Ville,
Thanks for the additional details!
I'm now able to reproduce the issue you described.
It seems that you created a C project instead of C++ by the project wizard.
Such a project does not accept .cpp file as a source file and therefore there is no tool associated with .cpp file.
On the other hand a C++ project accepts both .c and .cpp source files.
I'd recommend you to create a new project and change the Language to C++ (see the screenshot below):
This project should accept .cpp files without any problem.
Hope it helps.
Stanislav
Hello Ville,
Thanks for the additional details!
I'm now able to reproduce the issue you described.
It seems that you created a C project instead of C++ by the project wizard.
Such a project does not accept .cpp file as a source file and therefore there is no tool associated with .cpp file.
On the other hand a C++ project accepts both .c and .cpp source files.
I'd recommend you to create a new project and change the Language to C++ (see the screenshot below):
This project should accept .cpp files without any problem.
Hope it helps.
Stanislav
The problem seems to be that Design Studio fails to select a default build tool for files with the ".cpp" extension.
Changing from "--NO TOOL --" to "Standard S32DS C++ Compiler" in the "Tool Chain Editor" for each file solves the problem.
Although this method may be tolerable when adding new files it is not when importing existing projects with a large number of files.
Is there anyway to globally change this behaviour in DS?
Any tips are appreciated!
Ville
Hello Ville,
Thanks for your contribution on the NXP community!
I've tried it on my side, but I cannot reproduce it.
Where did you put your new file? into "src" source folder?
If you create a new generic folder in your project or if you e.g. copy a folder with source files into your project it may not be considered as a source folder.
The generic folder has this icon:
The source folder icon has little "C" letter above:
Please make sure your new .cpp file is located in a source folder.
If you need to change generic folder to source one (and vice versa): right click on the folder and select "Resource Configurations" -> "Exclude from Build...". Then uncheck the check box for specific Build configuration that should consider this folder as source one.
You can do the same in Build configurations dialog: click in Project Explorer area -> "Build Configurations Explorer". This dialog is more convenient if you need to select/de-select multiple files/folders into a build config.
If the info above does not help .... Can you please post reproducible step-by-step instructions?
Thanks
Stanislav
This is what I do to produce the error:
Install SDK using "S32_Power_Win32_v1.0_b151127.exe" on a machine running 64-bit Windows 7.
Restart (just in case).
Create a new project using the "New S32DS Project" wizard, name it "Test".
Select the MPC5748G processor and uncheck all but the first core.
Right-click on "src" folder and select New/Source File.
Name it vv.cpp and select "Default C++ source template".
The file appears in the "src" folder (which indeed has the "c"-icon).
Add "int Dummy = 0;" and "int Invalid = 42" (intentionally omitting the ";") to "vv.cpp".
Add "extern int Dummy;" and "Dummy++;" to appropriate places in "Test_Z4_1.c".
Run Project/Build All.
Result:
A linker error "undefined reference to ´Dummy´" is issued for "Test_Z4_1.c" but no compiler error for the missing semicolon in "vv.cpp".