Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hi,

ich moechte fortran 77 routinen/funktionen in einer anderen programmiersorache nuzten(z.b. c/c++).

wie kann ich aus fortran 77 routinen/funktionen bibliotheken bauen und wie nutze ich diese in z.b. c?

p.s. das soll unter linux/gcc2.95 geschehen

Hallo,

sofern Du mit gcc/g77 arbeitest, sollte das kein größeres Problem sein. Quick and Dirty:


nicolai@troedel:~/fort> cat hello.f

        subroutine f_hello()

        implicit none

        write (*,*) 'hello world'

        end subroutine


nicolai@troedel:~/fort> f77 -c hello.f

nicolai@troedel:~/fort> cat main.c

extern f_hello__();


int main()

{

  f_hello__();

}

nicolai@troedel:~/fort> gcc -c main.c

nicolai@troedel:~/fort>  gcc -o main main.c hello.o -lg2c

nicolai@troedel:~/fort> ./main

 hello world

nicolai@troedel:~/fort> 

Weitere Informationen (auch bzgl. der Calling Conventions) sind in der Dokumentation zu der Gnu Compiler Sammlung zu finden.

Nic

danke für die antwort.

das problem hat sich mittlerweite beseitugt: hatte zum verlinken der beiden objectdateinen gcc benutzt da fehlten aber die bibliotheken für fortran 77. mit f77 geth es aber.

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.