LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-01-2004, 09:18 AM   #1
KevinG
LQ Newbie
 
Registered: Dec 2003
Posts: 7

Rep: Reputation: 0
ld errors


Hi All,
I have been tring to interface a C++ code and a fortran code. Everything seems to work fine. Howver at the final step, I get a message like "collect2: ld returnes exit status". Can anybody help me out with this problem.

Thanks.
 
Old 12-01-2004, 11:35 PM   #2
randyding
Member
 
Registered: May 2004
Posts: 552

Rep: Reputation: 31
Hmm, I'm going way back but remember something like Fortran uses pascal calling convention. The difference is the order the arguments are placed on the stack. If I remember right C goes right to left and relies on the caller to do stack clean up. And pascal/fortran/basic all use left to right and relies on the called function to do stack clean up.
With C++ calling fortran, I think you have prototype the functions like this
extern "C" int myfunc(int x) __attribute__ ((stdcall));
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
HCL link error Artanicus LQ Suggestions & Feedback 13 09-14-2005 07:36 AM
libtool link error tibbar66 Linux - Newbie 1 04-09-2005 05:14 PM
can link with crt1.o error. wolver Linux From Scratch 0 01-16-2005 09:02 AM
link error??? raven Programming 2 12-28-2003 08:24 AM
libclntsh.so.9.0 link error srramkumar Linux - Software 1 10-02-2003 02:37 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration