LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 06-23-2010, 12:08 PM   #1
McCoder
LQ Newbie
 
Registered: Jun 2010
Posts: 4

Rep: Reputation: 0
Reference problem - linking error?


Hi,

I'm using Fortran g95 to compile my code:

Code:
        subroutine get_geopack(l_iy,f_ps)
        IMPLICIT NONE

        REAL ST0,CT0,SL0,CL0,CTCL,STCL,CTSL,STSL,SFI,CFI,SPS,CPS,
     1       SHI,CHI,HI,PSI,XMUT,A11,A21,A31,A12,A22,A32,A13,A23,
     2       A33,DS3,CGST,SGST,
     5       BA(6)

        INTEGER K,IY

        integer*4  l_iy
        real*4  f_ps

       COMMON /GEOPACK/ ST0,CT0,SL0,CL0,CTCL,STCL,CTSL,STSL,SFI,CFI
     * CPS,SHI,CHI,HI,PSI,XMUT,A11,A21,A31,A12,A22,A32,A13,A23,A33,
     * K,IY,CGST,SGST,BA


        save

        INTEGER jint
        l_iy = jint(iy)   
        f_ps = psi        

        RETURN
        END
However, I receive the error "undefined reference to jint." How do I fix this? Is this a linking problem?
 
Old 06-23-2010, 02:25 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -
Code:
        INTEGER jint     ! declare "jint" as a local variable
        l_iy = jint(iy)  ! use "jint()" as a function
Q: Where (if anywhere) did you declare *function* "jint()"?

A: Define the function, and I'll bet you fix the problem.

ALSO: I'd strongly recommend you also use an "interface" for your function.

http://www.cs.rpi.edu/~szymansk/OOF90/bugs.html
http://www.cs.umbc.edu/~squire/fortr.../summary.shtml

'Hope that helps .. PSM
 
  


Reply



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
g++ linking problem: undefined reference to _Unwind_GetIPInfo ljbuturovic Ubuntu 3 03-03-2007 12:45 AM
gcc linking: undefined reference to just about everything shabbychef Programming 7 09-09-2005 08:42 PM
g++: inline functions can cause an undefined reference when linking? R00ts Programming 5 06-21-2005 03:13 AM
Linking own library: undefined reference to otosigo Programming 1 12-02-2004 08:05 AM
G++ Linking Error "undefined reference" djjumper9 Programming 2 04-13-2004 09:36 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:20 AM.

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
Open Source Consulting | Domain Registration