- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would like to call a C function from Fortran code and followed the instructions in the Fortran Compilers Users Guide. The result is as follows:
lfa4(~/test) ifc -V Intel Fortran Compiler for 32-bit applications, Version 7.1 Build 20030424Z Copyright (C) 1985-2003 Intel Corporation. All rights reserved. GNU ld version 2.11.90.0.29 (with BFD 2.11.90.0.29) Supported emulations: elf_i386 i386linux /usr/lib/crt1.o: In function `_start': /usr/lib/crt1.o(.text+0x18): undefined reference to `main' lfa4(~/test) cat sayhello.c #includeWhat would the correct steps be to call my C-function sayhello? Kind Regardsvoid sayhello(void) { printf("Hello world!"); } lfa4(~/test) icc -c sayhello.c lfa4(~/test) cat hello.f PROGRAM F2C CALL SAYHELLO() END lfa4(~/test) ifc hello.f sayhello.o program F2C 3 Lines Compiled /tmp/ifcuIM5Pn.o: In function `main': /tmp/ifcuIM5Pn.o(.text+0x1c): undefined reference to `sayhello_'
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The solution to my problem is clearly described in the documentation for the compiler version 7 (Intel Fortran Compiler for Linux* Systems User's Guide, Document No. FL-710-01). The description in the version 8 documentation (Intel Fortran Compiler for Linux* Systems User's Guide Volume I: Building Applications, Document Number: 253259-001) is very difficult to understand.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please let me know which sections of the documents you are looking at so I can ask our writers to improve the text.

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