Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6475733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:44:24+00:00 2026-05-25T06:44:24+00:00

I am going to call a C++ function from FORTRAN, for which I am

  • 0

I am going to call a C++ function from FORTRAN, for which I am using ISO_C_Binding module. After compaction of the FORTRAN main file and C++ function with commands

 gfortran -c mlp8.f90

 g++ -c mean_cpp.cc

Which will create the objects files but in the linking phase as suggested by some members I am going to use the commands

 g++ mlp8.o mean_cpp.o -o main –lgfortran

I.e. using C++ compiler with linking to FORTRAN libraries but it gives error like

 /Cygnus/cygwin-b20/H-i586-cygwin32/i586-win32/bin/ld: 
   cannot open –lgfortran: No such a file or directory 

 Collect2:ld return 1 exit status 

So I think the main problem is that the g++ linker can not link with the FORTRAN libraries, so may be I need to include some path in the linking option or may be I need to do some setting in the g++ complier, which I don’t know how to do this, so please help to sort out this problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:44:25+00:00Added an answer on May 25, 2026 at 6:44 am

    You should find file libgfortran.* (e.g. with locate of find / -name "libgfortran.*"; or in windows-way Win+g, F3 or any file manager), record the path where it is and do

     g++ mlp8.o mean_cpp.o -o main -LPATH_RECORDED –lgfortran
    

    where PATH_RECORDED is the path.

    Try this lib list (got it from my mingw gfortran with -v option)

     g++ mlp8.o mean_cpp.o -o main -LPATH_RECORDED –lgfortran -lmingw32 -lgcc_s -lgcc -lmoldname  -lmingwex -lmsvcrt
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am going to call a function which will retrieve some data value from
I am trying to call a function in another .php file from this one
I'm working on designing the kernel (which I'm going to actually call the core
I would like to call a javascript function from an aspx control. For instance,
I'm going to use a time interval to call function autoSave(). Inside the function
Is it possible to call a child function from within the parent? I know
I want to call a function right after a scroll ends. I have tried
Or more specific to what I need: If I call a function from within
I need to call a VBscript function on a classic asp page from some
I'm trying to call a function in my ActionScript from my JavaScript, I've managed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.