ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
hi im trying to compile one program who calculate the integral of a function with trapeze rule.here is the program.the problem is that i have an error: "file format not recognized,treating like a linker script".what does it mean?????
implicit real*8(a-h,o-z)
OPEN (1,FILE='.\AA.DAT',STATUS='unknown',access='append')
The program compiles fine on my system. Maybe it is some problem with shared libraries installed on your system. If the linker (ld) encounters a shared object which is not binary, it tries to interpret it as a script with instructions on how the link should be done. It would be useful to see the exact command line you used to compile and the complete error message.
Please use CODE tags to improve readability. CODE tags are available in advanced mode by clicking on the # button or you can explicitly write them around the code as
[CODE]some text here[/CODE]
so that it will appear as
ok.Thank you very much for replying.Actually I dont know exactly what I have to do to fix it.I have found another compiler but ,I got the same error message.Do I have to do something else for the shared libraries ???
Please, show us the complete error message together with the exact command line. There should be some information about what file is "treated like a linked script". The fortran code works, you should provide more information about the issue: what compilers have you tried? What linux OS is this?
It certainly appears to me that there is, in fact, nothing wrong with your FORTRAN program. Therefore, "quit pursuing that line of reasoning ... it is a red herring."
I suggest that you start by Googling the exact text of the message (put it in double-quotes). I am entirely sure that colucix is on the right track here. The linker (not the FORTRAN compiler ...) is encountering something that it does not know how to handle, and I shall presume that it's not supposed to be stumbling into whatever-it-is at all.
This sort of thing is what I call ... for lack of a better word ... "a bullsh*t problem." It's the sort of thing that leads you on a merry chase down one false theory after another, only to turn out to be caused by some stupid one-line change in some stupid configuration-file or .bash_profile script or something "off the wall" thing like that. The solution to the problem usually turns out to be quite trivial, and the entire time spent in fruitless pursuit of it is sunk. In short, "a magnificent time-waster."
(And all too familiar to this old man.)
Last edited by sundialsvcs; 11-17-2011 at 07:46 PM.
I'm using windows 7(32 bit).here is the complete error message that i got:
[CODE] ld:C:\Users\herve bakatamba\Documents\herv\AA.DAT: file format not recognized; treating as linker script
ld:C:\Users\herve bakatamba\Documents\herv\AA.DAT:1: syntax error [CODE]
Ok. The linker tries to link the file containing your output data! Difficult to tell what's going on without seeing the exact command line you used to compile (if there is a command line in windows environment). The AA.DAT should not be part of the build and the linker should never try to include it in the binary executable. You have to find out how is it possible and exclude it from the compilation.
Please, third time I ask you: show us the exact command line (if any) or tell us how did you run the fortran compiler (if from a graphical interface, maybe a snapshot should be useful).
Hi,
I dont understand very well what do u mean by the "exact command line".I've just clicked on "run-compile" and then i have all the time this message.
Please can u tell me if u did something else to compile this program before saving it to a file :AA.DAT???
Hi,
I dont understand very well what do u mean by the "exact command line".I've just clicked on "run-compile" and then i have all the time this message.
Please can u tell me if u did something else to compile this program before saving it to a file :AA.DAT???
Sorry, but I'm lost now. For exact command line I mean the actual command used to compile, but you already answered my question: if I understand well you're compiling your program in windows environment, using a kind of graphical interface, aren't you? What I don't understand is: what is the AA.DAT file?
It appears in your fortran code as an output file, but the compiler (or better the linker) complains about AA.DAT file format not recognized, etc. etc. The point is: the AA.DAT file should not exist until you are able to run the compiled program. Can you explain where it did come from? I suspect that something in your setup is confusing the fortran code to compile with a generic DAT file that should not have any role in the compilation process.
It would be much better if you could take a screenshot of your compiler interface (that one where you click "Run-Compile") and show us what's the actual set-up.
I am guessing that your compiler expects Fortran 90+ files to end in .f90 (most do). FORTRAN 77 files usually end in .f or .for for the same reason. If you called your input file .dat, that's probably why your IDE is complaining.
In many IDE's (integrated development environments) you start programming by creating a 'project' and adding files to it. Maybe you accidentally add 'aa.dat' to the project and your IDE tries to compile it?
My teacher, who also uses IDE for fortran, told me that if something do not work for unknown reason, it is a good idea to re-create project..
PS. Note that there is a slash in ending /CODE tag.
Hi,
the "AA.DAT" is simply a name of a "txt" file and I think there is not any relation with the programm error because I tried to complie the program without it and changed it to ".f90",but i got the same error mesage.But can someone tell me how did he do to compile this program??and which compiler did he use?I'm using 'force 2.0' and it doesn't compile it.I tried to use today another compiler called"Plato",it's a worst situation and I receive another kind error message:"THERE IS NO PLUG-IN THAT MATCHES THIS FILE'EXTENSION"Do you know what it is???
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.