- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I have ifort 11 , after compile this code ,I get error
[hamid@localhost untitled folder]$ ifort gofr.f
/opt/intel/Compiler/11.1/064/lib/ia32/for_main.o: In function `main':
/export/users/nbtester/x86linux_nightly/branch-11_1/20091202_010000/libdev/frtl/src/libfor/for_main.c:(.text+0x4d): undefined reference to `MAIN__'
/tmp/ifortqxUaHf.o: In function `gofr_':
gofr.f:(.text+0x93a): undefined reference to `uread_'
gofr.f:(.text+0x94e): undefined reference to `dcell_'
gofr.f:(.text+0xace): undefined reference to `invert_'
---------------------------------------------------
I change command to :
[hamid@localhost untitled folder]$ ifort gofr.f uread.f dcell.f invert.f
/opt/intel/Compiler/11.1/064/lib/ia32/for_main.o: In function `main':
/export/users/nbtester/x86linux_nightly/branch-11_1/20091202_010000/libdev/frtl/src/libfor/for_main.c:(.text+0x4d): undefined reference to `MAIN__'
--------------------------------------------
please help me. I attached gofr.f and other file
Best Regards
I have ifort 11 , after compile this code ,I get error
[hamid@localhost untitled folder]$ ifort gofr.f
/opt/intel/Compiler/11.1/064/lib/ia32/for_main.o: In function `main':
/export/users/nbtester/x86linux_nightly/branch-11_1/20091202_010000/libdev/frtl/src/libfor/for_main.c:(.text+0x4d): undefined reference to `MAIN__'
/tmp/ifortqxUaHf.o: In function `gofr_':
gofr.f:(.text+0x93a): undefined reference to `uread_'
gofr.f:(.text+0x94e): undefined reference to `dcell_'
gofr.f:(.text+0xace): undefined reference to `invert_'
---------------------------------------------------
I change command to :
[hamid@localhost untitled folder]$ ifort gofr.f uread.f dcell.f invert.f
/opt/intel/Compiler/11.1/064/lib/ia32/for_main.o: In function `main':
/export/users/nbtester/x86linux_nightly/branch-11_1/20091202_010000/libdev/frtl/src/libfor/for_main.c:(.text+0x4d): undefined reference to `MAIN__'
--------------------------------------------
please help me. I attached gofr.f and other file
Best Regards
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There should be one and only one main program used to build an executable. Likewise, any needed routines such as hread() should be satisfied by the existence of one and only one object file containing a corresponding external symbol. Such object files may be compiled from your sources or may be present in a library that is searched either because you ask for that explicitly or the compiler knows to search implicitly.
The compiler is telling you that none of the four source files that you compiled and linked contains a main program. If you examine your source files, you will find that you have multiple definitions of hread(). You will have to remove at least these two errors before you can build an executable.
You need to acquaint yourself with the basic framework of the process for building object files and executable programs from source files, by reading textbooks and Fortran compiler manuals.
The compiler is telling you that none of the four source files that you compiled and linked contains a main program. If you examine your source files, you will find that you have multiple definitions of hread(). You will have to remove at least these two errors before you can build an executable.
You need to acquaint yourself with the basic framework of the process for building object files and executable programs from source files, by reading textbooks and Fortran compiler manuals.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I need to compile only gofr.f but I have problem with this code.
I use this command for compile and link codes;
[hamid@localhost untitled folder]$ ifort -O3 gofr.f uread.f dcell.f invert.f
/opt/intel/Compiler/11.1/064/lib/ia32/for_main.o: In function `main':
/export/users/nbtester/x86linux_nightly/branch-11_1/20091202_010000/libdev/frtl/src/libfor/for_main.c:(.text+0x4d): undefined reference to `MAIN__'
or
[hamid@localhost untitled folder]$ gfortran -O3 -ffast-math gofr.f uread.f dcell.f invert.f
/usr/lib/gcc/i686-redhat-linux/4.4.4/libgfortranbegin.a(fmain.o): In function `main':
(.text+0x28): undefined reference to `MAIN__'
collect2: ld returned 1 exit status
please help me. i don't know how I solve problem
I need to compile only gofr.f but I have problem with this code.
I use this command for compile and link codes;
[hamid@localhost untitled folder]$ ifort -O3 gofr.f uread.f dcell.f invert.f
/opt/intel/Compiler/11.1/064/lib/ia32/for_main.o: In function `main':
/export/users/nbtester/x86linux_nightly/branch-11_1/20091202_010000/libdev/frtl/src/libfor/for_main.c:(.text+0x4d): undefined reference to `MAIN__'
or
[hamid@localhost untitled folder]$ gfortran -O3 -ffast-math gofr.f uread.f dcell.f invert.f
/usr/lib/gcc/i686-redhat-linux/4.4.4/libgfortranbegin.a(fmain.o): In function `main':
(.text+0x28): undefined reference to `MAIN__'
collect2: ld returned 1 exit status
please help me. i don't know how I solve problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please read mecej4's response above.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page