I am having a weird problem with namespace level constants and methods compiled into a library. The attached projects exhibit my trouble.
mylibrary/resources.pas declares a record type, a constant, and two methods, all at namespace level (i.e. not inside a class). They are all visible to the program when its project includes resources.pas directly (see myproblem_good) .
But when referencing resources.pas compiled into a library, the record type is visible, but not the constant (see myproblem_bad2) or the methods (see myproblem_bad1).
Prepending public to the constant or method declarations in resources.pas prevents the library from being built at all.
That is as designed. the default visibility for globals is “assembly”, unless they are marked as public. There’s also a global switch in Projects Settings for legal compatibility to treat all globals as public by default.
Can you give me a simple test case that show this error?