- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am still using CVF as I have still not gotten my new IVF to compile my projects and have not had time to sort it out.
I am trying to call a c routine FLOATTOIBM from Fortran 90. the .c file is part of my project.
CALL FloatToIbm(SR%TRACES(1,I),TRACE,,SR%NSAMP,1)
I have tried various naming conventions including upper and lower case with and without the underline character and I always get the message
Compiling...
IBMFormat.c
Linking...
LINK : warning LNK4075: ignoring /EDITANDCONTINUE due to /INCREMENTAL:NO specification
LINK : warning LNK4098: defaultlib "LIBCD" conflicts with use of other libs; use /NODEFAULTLIB:library
Segyout.obj : error LNK2001: unresolved external symbol _FLOATTOIBM@20
Debug/ixseg2segy.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
ixseg2segy.exe - 2 error(s), 2 warning(s)
What do I need to do to get the system to recognize the c program?
I have looked in the Fortran Help and do not seem to be able to find anything useful.
Thanks, Charles
/* Assumes sizeof(int) == 4 */
extern void __stdcall _FLOATTOIBM(int from[], int to[], int n, int endian)
/**********************************************************************
float_to_ibm - convert between 32 bit IBM and IEEE floating numbers
***********************************************************************
Input:
from input vector
n number of floats in vectors
endian =0 for little endian machine, =1 for big endian machines
Output:
to output vector, can be same as input vector
***********************************************************************
Notes:
Up to 3 bits lost on IEEE -> IBM
IBM -> IEEE may overflow or underflow, taken care of by
substituting large number or zero
Only integer shifting and masking are used.
***********************************************************************
Credits: CWP: Brian Sumner
***********************************************************************/
{
register int fconv, fmant, i, t;
for (i=0;i
if (fconv) {
fmant = (0x007fffff & fconv) | 0x00800000;
t = (int) ((0x7f800000 & fconv) >> 23) - 126;
while (t & 0x3) { ++t; fmant >>= 1; }
fconv = (0x80000000 & fconv) | (((t>>2) + 64) << 24) | fmant;
}
if(endian==0)
fconv = (fconv<<24) | ((fconv>>24)&0xff) |
; ((fconv&0xff00)<<8) | ((fconv&0xff0000)>>8);
to = fconv;
}
return;
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you! I should have known. I started out without the underscore, and I should have realized that asking for IBMTOIEEE@20 when there were only 4 arguments was a dead giveaway.
Charles

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page