Author Topic: ST(Structured Text) Compile error  (Read 6656 times)

Offline choongKi

  • PLUS+1 User
  • **
  • Posts: 5
  • Karma: +0/-0
ST(Structured Text) Compile error
« on: March 30, 2017, 07:43:14 AM »
I was compiling using Structured Text POUs and encountered a compile error (ERROR 302) in the following message

*** ERROR 302 *** [CL2000S] INTERNAL: UNEXPECTED EXCEPTION WITH MESSAGE: {Failed to compile file: "HydroFraise.C", Compiler error: 1}

What is the solution?

Offline Nilla

  • PLUS+1 Guru
  • *****
  • Posts: 253
  • Karma: +13/-0
Re: ST(Structured Text) Compile error
« Reply #1 on: April 03, 2017, 10:35:48 AM »
Hi ChoongKi!

What version of GUIDE are you using?

Looking at your compile error you seem to have a file called HydroFraise.C, a capital C as a file format. Before v9.0.8 it was possible to add C code files with upper case .C extension to a GUIDE project. This could cause issues as upper case .C extension is used by some compilers to indicate a C++ file.

Were you adding existing C-code files to your project or has it been created from within GUIDE?

If a C code file has been added to the project, but its extension is set as: ā€œ.Cā€ rather than: ā€œ.cā€, then it will be treated as a C++ file by some compilers. This will likely lead to link errors. Use of this upper case extension is only possible when adding existing C code files to a GUIDE project, not when creating new C code files from within GUIDE.

Workaround: Remove the C code files with upper case extension from the project, then rename them to the lower case extension in your usual file browser, and finally add them to the project again.

This information can be found in the Release Notes for PLUS+1 GUIDE v9.0.8, on page 4 and 8, found in the Help menu in GUIDE.

Best regards
Nilla
PLUS+1 Helpdesk