B&R Automation Studio compile error: undefined reference to `FileOpen’

I was working with another programmer in the same Automation Studio project that was shared using SVN, and after a new SVN checkout I had this compiler error message:

Error : undefined reference to `FileOpen’

So it looked like someone started using some file handling library, looking around the documentation I realize that it is the FileIO library. The undefined reference means the corresponding binary file was not found by the compiler…

Looking into the SVN history I see that nothing changed on the configuration side of the project for the latest couple of weeks, so there were no reason to have this error message. I checked the project configuration and everything looked OK. Then I looked for the libraries folder and I found them inside project-name\Logical\Libraries. This is the main libraries folder and inside it there is a folder for each library. In each library folder there is a sub folder SG4 and inside it we normally have one .h file, one .br file and one .a file. It is not the case for FileIO, inside the SG4 sub folder we only have the FileIO.h file. I did not find a FileIO.a file. I found a FileIO.br binary file inside the projects operating system folder:

project-name\as\system\D0410\SG4\IA32

It looks like the system libraries binary files come with the operating system files, which makes sense. Looking around I found some other libraries organized the same way.

So in conclusion, when the project was committed to SVN we somehow didn’t commit some of the files inside project-name\as\system\D0410\SG4\IA32. It was compiling OK on the other PC because those files were still there, but not in SVN and my PC local files.

Removing and adding this library again to the project copied the library files to the correct places. After a SVN commit making sure the new files are included fixed the issue.

Advertisements

Author: pedro_nf

Independent contractor on IT solutions and automation

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s