Fortran Error Undefined Reference To Main
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss
Fortran Undefined Reference To Subroutine
the workings and policies of this site About Us Learn more about undefined reference to fortran 77 Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow
Fortran Undefined Reference To Mod
Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each collect2 error ld returned 1 exit status fortran other. Join them; it only takes a minute: Sign up Fortran compilation error - undefined reference up vote 3 down vote favorite 2 I am trying to compile a fortran program which uses a bunch of modules. I obtain an error when I compile it, and it's driving me crazy. The error is originated by the addition of one fortran use module subroutine and takes place when I try to recompile the program: Main program contains these two lines: -- call read_step(nStepOne,molOne) call read_step(nStep,mol) -- This is calling one of the subroutines in a file "fileio.f90": -- subroutine read_step(n,tape) implicit none integer, intent(in) :: tape integer, intent(out) :: n character(len=6) :: dum rewind(tape) read (tape,*) read (tape,*) dum, n rewind(tape) return ! end subroutine read_step -- When I try to compile it, the following error arises: ifort -o SpIdMD.x *.o -static-intel -openmp SpIdMD.o: In function `MAIN__': SpIdMD.f90:(.text+0x3b2): undefined reference to `read_step_' SpIdMD.f90:(.text+0x3c5): undefined reference to `read_step_' make: *** [SpIdMD.x] Error 1 Other calls to subroutines in the same module did not give any error, and I just don't see any difference between the calls to the "old subroutines" and the one I just created. An example of one of these "old subroutines", which does not give any complaint, is: In the main program: call get_dim(n_atom,nSnap,mol) In the fileio.f90: subroutine get_dim(n,n_snap,tape) implicit none integer,intent(in) :: tape integer,intent(out) :: n, n_snap integer :: m rewind(tape) read (tape,
LearningModern CodeNetworkingOpen SourceStorageToolsDeveloper TypeEmbedded SystemsGame DevMediaTechnical, Enterprise, HPCWebOSAll ToolsAndroid*HTML5Linux*OS X*Windows*ResourcesCode SamplesContact SupportDocumentationFree SoftwareIntel Registration
Fortran Use Statement
CenterProduct ForumsSDKsResourcesPartner with IntelAcademic ProgramPartner SpotlightBlack Belt compile fortran DeveloperDeveloper MeshInnovator ProgramSuccess StoriesLearnBlogBusiness TipsEventsVideosSupportContact SupportDeveloper EvangelistsFAQsForums Search form Search
Fortran Interface
You are hereHome › Forums › Intel® Software Development Products › Intel® Fortran Compiler for Linux* and http://stackoverflow.com/questions/16088892/fortran-compilation-error-undefined-reference Mac OS X* FacebookLinkedInTwitterDiggDeliciousGoogle Plus Undefined Reference to Main error Undefined Reference to Main error Eric M. Fri, 07/05/2013 - 16:08 Greetings, I am obtaining the following error when attempting to build my code. (Note https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/401120 this is all created by a separate executable) mpif90 -D"FFTW3=1" -D"PARALLEL=0" -g -WB -traceback -debug all -warn all -mcmodel=medium -o ifc_ibm.exe "" -lfftw3 "" -lm "" -L/home/ejmurphy/FFTW_IFC/lib ""ifort: warning #10315: specifying -lm before files may supercede the Intel(R) math library and affect performanceifort: warning #10315: specifying -lm before files may supercede the Intel(R) math library and affect performance/opt/intel/composer_xe_2013.5.192/compiler/lib/intel64/for_main.o: In function `main':/export/users/nbtester/efi2linux_nightly/branch-13_0gt/20130608_000000/libdev/frtl/src/libfor/for_main.c:(.text+0x38): undefined reference to `MAIN__'make: *** [ifc_ibm.exe] Error 1 I have read through previous threads on errors like this, so I'll clarify some stuff upfront. The entire program, main program included, is written in fortran 90 and I am running in the curre
Get Kubuntu Get Xubuntu Get Lubuntu Get UbuntuStudio Get Mythbuntu Get Edubuntu Get Ubuntu-GNOME Get UbuntuKylin Ubuntu Code of Conduct Ubuntu Wiki Community Wiki Other Support Launchpad Answers Ubuntu IRC Support https://ubuntuforums.org/showthread.php?t=2005906 AskUbuntu Official Documentation User Documentation Social Media Facebook Twitter Useful Links Distrowatch Bugs: Ubuntu PPAs: Ubuntu Web Upd8: Ubuntu OMG! Ubuntu Ubuntu Insights Planet Ubuntu Activity Page Please read before SSO login Advanced Search Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Undefined reference to 'main' error in crt1.o function _start Having an Issue With Posting ? Do you want to help us undefined reference debug the posting issues ? < is the place to report it, thanks ! Page 1 of 2 12 Last Jump to page: Results 1 to 10 of 11 Thread: Undefined reference to 'main' error in crt1.o function _start Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode June 18th, 2012 #1 nigel332 View Profile View Forum Posts undefined reference to Private Message First Cup of Ubuntu Join Date Jun 2012 Beans 6 Undefined reference to 'main' error in crt1.o function _start Hello,all I've geting problems with my Makefile. I'm trying to create a programeg_in.but,When I try to make using this Makefile, I get the error: cc -lm peg_diag.o -o peg_diag /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o: In function `_start': (.text+0x20): undefined reference to `main' collect2: ld return 1 AND my makefile as follows: Code: 12 F90 = gfortran-4.4 13 F90FLAGS = -DDEC_ALPHA 14 CPP = gcc -E 15 CPPFLAGS = -DLINUX -DD_PRECISION 16 LDFLAGS = -lm 17 LIBS = 18 CMPLFLAGS = linux Last edited by nigel332; June 21st, 2012 at 02:41 AM. Adv Reply June 18th, 2012 #2 Zugzwang View Profile View Forum Posts Private Message Ubuntu Cappuccino Scuro Join Date Oct 2007 Beans 1,914 DistroLubuntu 12.10 Quantal Quetzal Re: Undefined reference to 'main' error in crt1.o function _start The "peg_diag.o" - where does it come from? Is it compiled from C source code? If yes, does it have a "main" function? If not, then the code that is to be executed upon starting the program is missing, and thus, you can't link it (before you defined a main function). I don't think that the Make