Software Archive
Read-only legacy content
17061 Discussions

'Symbol not previously declared' for subroutines that are part of project

kvrichardson
Beginner
912 Views
I'm getting tons of these warnings for calls to subroutines that are included in my project.
C:Cp32TenTensiz.for(404) : Warning: Symbol not previously declared. [LPRINT]
call LPRINT(box(7),44,0)

How do I get rid of them?

The LPRINT subroutine is in my project, so I'm not sure why it's saying "not declared".

Thanks,

Keith Richardson
0 Kudos
5 Replies
Steven_L_Intel1
Employee
912 Views
Short answer - you have !DEC$ (or !MS$) DECLARE in your source and have not explicitly declared LPRINT. However, the documentation doesn't lead me to believe that a subroutine reference should trigger this warning - IMPLICIT NONE doesn't. I'll ask the appropriate engineer about it.

You can add EXTERNAL LPRINT (or whatever) to "declare" the routines, or switch to using the standard IMPLICIT NONE instead of the old MS DECLARE directive.

Steve
0 Kudos
Steven_L_Intel1
Employee
912 Views
Longer answer - this is a bug which has been in the compiler for several years! We'll fix it. My advice above still holds.

Steve
0 Kudos
Jugoslav_Dujic
Valued Contributor II
912 Views
I wonder how would a still longer answer look like :-)?
Besides, Steve, don't be so eager to say it's a bug -- I'm sure that some Microsoft people would say "oh, it's not a bug, it's a feature" -- after all, these subroutines are kind of undeclared, since they don't have neither EXTERNAL nor INTERFACE block.

(Oh, yes, these warning messages are a real PITA)

Jugoslav
0 Kudos
kvrichardson
Beginner
912 Views
Luckily we only had one !DEC$ DECLARE statement - and removing it did the trick!

Thanks, Steve.

Keith Richardson
0 Kudos
Steven_L_Intel1
Employee
912 Views
It is a bug. The documentation clearly states that the behavior should be the same as that for IMPLICIT NONE, which requires that every object with a datatype must be explicitly typed. A subroutine has no type, therefore should not be considered "undeclared" here.

At first, I wondered if MS had a stricter definition, requiring an explicit interface for subroutines, but their manual says not. While this would be an interesting definition, and even useful, it's not what's documented, so bug it is.

Steve
0 Kudos
Reply