Fortran Compiler Error Undefined Reference To
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site fortran undefined reference to main About Us Learn more about Stack Overflow the company Business Learn more about gfortran collect2: error: ld returned 1 exit status hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss
Undefined Reference To Fortran 77
Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Fortran 90 compiling
Fortran Undefined Reference To Mod
issue: undefined reference to
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this
Fortran Use Statement
site About Us Learn more about Stack Overflow the company Business Learn compile fortran more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question fortran interface x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error http://stackoverflow.com/questions/3904814/fortran-90-compiling-issue-undefined-reference-to-modulename in fortran, undefined reference to subroutine up vote 0 down vote favorite I am writing a subroutine and main function to call it, but getting error as undefined reference to ___. I found one reason: When I save the main and subroutine in the same file, compile and run that file, everything runs perfectly. However, when I save them into different .f90 files and http://stackoverflow.com/questions/29639760/error-in-fortran-undefined-reference-to-subroutine try to run the main file, I get error. Is there any way I can make subroutine into a separate file and call into main calling program? I got confused with another place - in the main program at !------ERROR------ place. I referred to Automatic width integer descriptor in fortran 90 I can use I0 as automatic width display indicator. But when I used the same, there is run time error expected integer but got character. Any idea about this? ! saved as sub_program.f90 file SUBROUTINE sub_program (v1,v2,ctr) IMPLICIT NONE INTEGER, INTENT(IN) :: ctr INTEGER, INTENT (OUT) :: v1,v2 SELECT CASE (ctr) CASE (1) v1=1 v2=0 CASE (2) v1=0 v2=1 END SELECT RETURN END SUBROUTINE ! main calling program, saved as caller.f90 PROGRAM caller IMPLICIT NONE INTEGER :: v1,v2,ctr DO ctr = 1,2,1 CALL sub_program (v1,v2,ctr) WRITE (*,100) 'STEP = ',ctr,'V1 = ',v1,'V2 = ',v2 !------ERROR------ 100 FORMAT (I0) END DO END PROGRAM Thanks! fortran fortran90 gfortran share|improve this question asked Apr 15 '15 at 0:45 user3705273 589 3 show the command used to compile –agentp Apr 15 '15 at 0:56 Please revisit the FORMAT sta
LearningModern CodeNetworkingOpen SourceStorageToolsDeveloper TypeEmbedded SystemsGame DevMediaTechnical, Enterprise, HPCWebOSAll ToolsAndroid*HTML5Linux*OS X*Windows*ResourcesCode SamplesContact SupportDocumentationFree SoftwareIntel Registration CenterProduct ForumsSDKsResourcesPartner with IntelAcademic ProgramPartner SpotlightBlack Belt DeveloperDeveloper MeshInnovator https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/271341 ProgramSuccess StoriesLearnBlogBusiness TipsEventsVideosSupportContact SupportDeveloper EvangelistsFAQsForums Search form Search You https://gcc.gnu.org/ml/fortran/2009-08/msg00389.html are hereHome › Forums › IntelĀ® Software Development Products › IntelĀ® Fortran Compiler for Linux* and Mac OS X* FacebookLinkedInTwitterDiggDeliciousGoogle Plus Undefined reference to _ ERROR in FORTRAN COMPILATION Undefined reference to _ ERROR in undefined reference FORTRAN COMPILATION jdbaba Fri, 05/11/2012 - 18:23 Hi I am using using LInux system to compile the fortran code. I have around 200 subroutines that I need to compile. Whiel I try to compile the subroutines it gives the error In function "Main" .......... undefined reference to undefined references to 'subroutinename". I have bunch of same error. This is the same code that worked perfectly on visual studio in windows. I am new to linux. Actually, I need to compile this code so that I could be able to run the code on supercomputer. Please help me .......I have uploaded a snapshot of the error on http://www.filedropper.com/errorinlinux. I am using SecureCRT interface to compile the code in Supercomputer.Thanks.JDBABA RSS Top 5 posts / 0 new Last post For more complete information about compiler optimizations, see our Optimization Notice. mecej4 Fri, 05/11/2012 - 22:37 If you want the compiler to compile Fortran source into object code but refrain from linking, you should use the -c compiler flag. Then, when all the necessary source have been compiled, you c
text] Re: undefined reference to `MAIN__' From: Tobias Burnus