ANSI C declarations failed error after project copy and rename (Automation Studio 6.5.0.306)

Hello,

I am using Automation Studio version 6.5.0.306 and I am facing a build problem after copying and renaming a project.

I have two similar projects:

  • One project builds and runs without any problem.

  • The other project gives “ANSI C declarations failed” during build.

The issue occurs with the following workflow:

  1. I create a project in Automation Studio (project has its own unique name).

  2. I copy an existing working project.

  3. I rename the project (project name, configuration-related names, and all references I can find).

  4. I update all occurrences of the old project name:

    • File names

    • Inside .c and .h files

    • Macros / definitions related to the project name

  5. This project also contains Referenced Files (external .c / .h files added via Referenced Files).

  6. I first rename the project and local files, and after that I update the referenced files to match the new project name.

After these steps, the build fails with errors such as “ANSI C declarations failed”.

Important observations:

  • If I repeat the same steps but use a different project name with the same or longer character length, the project builds successfully.

  • If I copy the project and rename it to a name that is exactly 1 character shorter than the original working project name, the build fails.

  • If I keep the original project name or use a different name with similar length, the error does not occur.

  • This makes the problem look possibly to:

    • Project renaming

    • Relative length compared to the original project name

    • Internal name generation and caching behavior in Automation Studio

    • Generated files / cached build data

    • Referenced Files not being fully refreshed

    • Internal name references remaining after copy/rename

I suspect that:

  • Some generated or cached files still reference the old project name, or

  • Referenced Files are not fully re-integrated after renaming, causing missing or conflicting declarations during the ANSI C compile phase.

Question:

  • Is there a known limitation or issue in AS 6.5 regarding project copy + rename when using Referenced Files?

  • Is there a recommended procedure for renaming projects that contain referenced .c/.h files?

  • Should referenced files be removed and re-added after renaming the project?

  • Are there specific folders (generated/build cache) that must be manually cleaned to avoid this issue?

Any guidance or best practices would be appreciated.

Thank you.

Hello,
I do not have expirience with renaming or c-programming. But here my thoughts…

If you think it could be a issue due to old cashed Data. You migth delete the “Temp”-Folder in the AS-Project Folder. This is the location where AS-generates its temporary Data while compile, it can be deleted in Explorer while AS is closed.

The error message of the Automation Studio could help to better understand where this error points.

The issue seems to be pretty reproducable. This makes it easy to share it with a local support expert, and keep privacy of the project code.

Greetings
Michael

Hello Michael,

I tried cleaning diagnostic binaries and temporary build files each time, but the issue still persists. At this point, I suspect that the problem is related to the project/file naming and name length, not to leftover binaries or temporary data.

Hi @omer.alumur, do I understand it properly that you know how to reproduce the issue? If so, and because the problem is very likely related to your project, please get in contact with your local support. The community is not a place for project sharing and testing. If anyone can provide @omer.alumur with some general ideas, feel free to add them here.

1 Like

Hi,

do you mean cleaning in AS via Project → Clean Configuration?
My experience is that it makes a difference whether you delete data inside AS or at the file level.
I would recommend closing Automation Studio and deleting all folders (Binaries, Diagnosis, Temp) at the file level (explorer).
Than open AS and try it again.

1 Like

Hello, first of all,

As I said, I solved the problem, but I wanted to write here because I’m not sure about how I solved it. The only change I made was to put the project name at the beginning of my working project name and the associated header and .c files. In this example, let’s say it’s SM123S6DE456IN78_Sample. c. Let’s say in my new project, even if I delete any character from the SM123S6DE456IN78 part at the beginning of this name and keep everything else exactly the same, the project becomes uncompilable. But let’s say I add a new character, like SM123S6DE456INX78, adding the X character at the end (the 3rd character from the end). Then, when I do the exact same thing again, the project compiles and runs without any problems. I always close and delete the Temp Diagnostic and Binary files, but I still can’t figure out why this happens.

Hello,

i only know that some tokens/variables shall not begin with numbers.
I am not sure if removing a part would lead to have a number at the start of the element.

For all other theories i have to less knowledge about compiling and linker and so on…

Greetings
Michael

1 Like

Can be some bug in compilation process with token names. We had an issue with variable mappings between application modules. ModGlobal+Mod1+Mod10 doesnt work, but ModGlobal+Mod01+Mod10 worked.
OCX-10455: Overlapping names of logical packages can result in incorrect I/O and PV mappings.
Overlapping names of logical packages can result in incorrect I/O and PV mappings. If there is package “P10” and package “P1”, for example, and declarations with the same name are created in both, this can result
in overlaps. These overlaps can manifest themselves in build errors or invalid built I/O and PV mappings.

1 Like

As I mentioned, please provide a sample project with a project name that is not compile able and instructions on how to reproduce the issue to your local support colleagues. I think they can test it, maybe discuss it internally, and provide you with an explanation. It would be great if you could share the explanation here with us. From the comments here, I think people can only give you some guesses.

Hello everyone again,

After meeting with my local support, I will share any updates with you.