- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am tring to compile a program composed by .f and .c files.
I am using gcc :
gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
and intel fortran compiler 7.0:
Intel Fortran Compiler for 32-bit applications, Version 7.0 Build 20021028Z
Copyright (C) 1985-2002 Intel Corporation. All rights reserved.
FOR NON-COMMERCIAL USE ONLY
GNU ld version 2.13.90.0.2 20020802
Supported emulations:
elf_i386
i386linux
elf_i386_glibc21
The problem come when the program link and it does't reconise the c subroutine because it looks for somethinds like namesubroutine_
In the makefile I use the option for gcc -std=c99
I tried to use the ifc option -C90 but nothing change: I have always the same error type:
"
ld: Warning: type of symbol `stat_' changed from 2 to 1 in ccdne.o
ccdne_inp_03.o: In function `ccdne_inp_one_':
ccdne_inp_03.o(.text+0x9fc): undefined reference to `head_'
ccdne_inp_03.o(.text+0xad5): undefined reference to `head_'
ccdne_inp_03.o(.text+0xc19): undefined reference to `decod_oneframe_'
ccdne_inp_04.o: In function `ccdne_inp_':
ccdne_inp_04.o(.text+0xc33): undefined reference to `head_'
ccdne_inp_04.o(.text+0xd0b): undefined reference to `head_'
ccdne_inp_04.o(.text+0xe54): undefined reference to `decod_'
ccdne_inp_04.o(.text+0x1fa5): undefined reference to `cluster_c_'
ccdne_fit.o: In function `ccdne_fit_':
ccdne_fit.o(.text+0x9ce): undefined reference to `paralin_'
date.o: In function `rs6date_':
date.o(.text+0x28): undefined reference to `fdate__'
badpix.o: In function `badpix_':
badpix.o(.text+0x98f): undefined reference to `head_'
badpix.o(.text+0xaa4): undefined reference to `head_'
badpix.o(.text+0xbe3): undefined reference to `decod_'
make: *** [ccdm.exe] Error 1
"
where the head_, decod_ .. are .c subroutines.
Anybody knows the otption to use to put the underscore in the good place of the subroutine and so do the compatibility between ifc and gcc?
Thanks
Martino
I am tring to compile a program composed by .f and .c files.
I am using gcc :
gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
and intel fortran compiler 7.0:
Intel Fortran Compiler for 32-bit applications, Version 7.0 Build 20021028Z
Copyright (C) 1985-2002 Intel Corporation. All rights reserved.
FOR NON-COMMERCIAL USE ONLY
GNU ld version 2.13.90.0.2 20020802
Supported emulations:
elf_i386
i386linux
elf_i386_glibc21
The problem come when the program link and it does't reconise the c subroutine because it looks for somethinds like namesubroutine_
In the makefile I use the option for gcc -std=c99
I tried to use the ifc option -C90 but nothing change: I have always the same error type:
"
ld: Warning: type of symbol `stat_' changed from 2 to 1 in ccdne.o
ccdne_inp_03.o: In function `ccdne_inp_one_':
ccdne_inp_03.o(.text+0x9fc): undefined reference to `head_'
ccdne_inp_03.o(.text+0xad5): undefined reference to `head_'
ccdne_inp_03.o(.text+0xc19): undefined reference to `decod_oneframe_'
ccdne_inp_04.o: In function `ccdne_inp_':
ccdne_inp_04.o(.text+0xc33): undefined reference to `head_'
ccdne_inp_04.o(.text+0xd0b): undefined reference to `head_'
ccdne_inp_04.o(.text+0xe54): undefined reference to `decod_'
ccdne_inp_04.o(.text+0x1fa5): undefined reference to `cluster_c_'
ccdne_fit.o: In function `ccdne_fit_':
ccdne_fit.o(.text+0x9ce): undefined reference to `paralin_'
date.o: In function `rs6date_':
date.o(.text+0x28): undefined reference to `fdate__'
badpix.o: In function `badpix_':
badpix.o(.text+0x98f): undefined reference to `head_'
badpix.o(.text+0xaa4): undefined reference to `head_'
badpix.o(.text+0xbe3): undefined reference to `decod_'
make: *** [ccdm.exe] Error 1
"
where the head_, decod_ .. are .c subroutines.
Anybody knows the otption to use to put the underscore in the good place of the subroutine and so do the compatibility between ifc and gcc?
Thanks
Martino
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can compile with ifc -nus to avoid appending underscores to the external symbol names for subroutines. There are other ways to match symbol names between C and Fortran, (see the Fortran User's Guide), but this is the simplest. There is more than just the symbol name to match when calling C from Fortran, again see the corresponding chapter in the User's Guide.
Martyn
Martyn

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