LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 12-16-2007, 06:06 AM   #1
mperez
LQ Newbie
 
Registered: Jul 2006
Location: Germany
Distribution: SuSe, CentOS
Posts: 28

Rep: Reputation: 15
help gfortran


Hi everyone

I'm trying to compile an old fortran file (.f) with gfortran

gfortran -o k2b1 k2b1


/tmp/ccamVShq.o: In function `MAIN__':
k2b1.f.text+0x1b9): undefined reference to `julday_'
k2b1.f.text+0x1d6): undefined reference to `flmoon_'
k2b1.f.text+0x30d): undefined reference to `flmoon_'
k2b1.f.text+0x3f5): undefined reference to `caldat_'
collect2: ld returned 1 exit status

can somebody help me?


help!
ps. gfortran -V : 4.2.1 (OpenSuSe10.3)
i was usig the option -ffree-form
-ff2c
 
Old 12-16-2007, 12:43 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,005
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
You're referencing a file that defines calendar functions
but aren't linking it to your program.



Cheers,
Tink
 
Old 12-16-2007, 01:50 PM   #3
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
julday, caldat and flmoon are classic functions of Numerical Recipes in Fortran: you have to compile them and your main program together, by specifying them first on the command line. The compiler will build the functions and then the main program which calls them.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Easy way to get gfortran? sgware Linux - Newbie 2 10-22-2007 02:40 AM
Gfortran compile error aukuntin Linux From Scratch 2 01-28-2007 09:08 PM
gfortran makefile c.m.klaij Programming 0 01-23-2006 06:04 AM
gfortran libraries curosie Programming 1 08-26-2005 11:37 PM
gfortran and pgf90 peeInMyPantz Programming 1 08-08-2005 05:54 AM


All times are GMT -5. The time now is 10:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration