- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My code as below:
include 'param.h'
dimension alpha1(mx)
open(99,file='checking.dat')
and there is an error: Error 5 error #6591: An automatic object is invalid in a main program.[alpha1]
I cannot understand what I can fix it. Can someone help me?
Thank you.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'd guess that MX has a defined value within param.h, however, the compiler did not find param.h to include it hence the error.
If param.h does not reside in the same directory as the source file from which the code snippet you show comes from then you need to assist the compiler in finding param.h with the appropriate compiler option. Refer to here for some guidance.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page