Mex Build Error: the following files have the same file name which cannot be packaged together in a flat hierarchy

I have files that multiple Sfuns use. When I want to build the project, I get the following error. What is the reason for this and is there a solution?
"the following files have the same file name which cannot be packaged together in a flat hierarchy"

7 commentaires

To help you troubleshoot the error you're encountering, could you please provide more details about the steps you're taking when you face the error? What functions or methods are you trying to build the project?
I build the project via Simulink under the C++ code tab.
I have multiple Sfun projects and they had files that do the same job, for example in the 1st sfun I have 2 files a.cpp, b.cpp and in the 2nd sfun I have files x.cpp, y.cpp. Among these files, b.cpp and y.cpp files are exactly the same in content and I want to put them in a common file called common.cpp and use this file by calling a.cpp and x.cpp.
"the following files have the same file name which cannot be packaged together in a flat hierarchy
D:\......\Common\common.h
D:\......a\..\Common\common.h
D:\......x\..\Common\common.h"
I'm getting an error like this. In the error, a diagnostic shows that the relevant file has been used 3 times and where it is used.
Since I had received this error before, I had solved the problem by changing the names of files with exactly the same function and putting each Sfun project in a namespace with its own name, but now I want to know whether I can solve it in the way I mentioned above.
Could you share which command you are using, if any, for the build or packaging process? This error usually occurs while packaging which happens after the build is complete.
I am using the embedded coder plugin on simulink. I build with the "Build" option under the "C++ CODE" tab.
I am also facing a similar issue while carrying out one of my workflows.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Deployment, Integration, and Supported Hardware dans Centre d'aide et File Exchange

Question posée :

le 16 Sep 2024

Commenté :

le 15 Déc 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by