LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Linking Fortran objects into a CVI project

Hi,

I have some trouble linking a fortran object to a CVI project. I managed to build a DLL (with corresponding *.h and *.lib files) from the fortran sources using g77, gcc and link.exe from MSVC.
The functions prototype is:

#define ECGPU_REAL double
void inicializa_cero_(ECGPU_REAL *iondat,
        ECGPU_REAL* iqtc,
        ECGPU_REAL* iqrspa,
        ECGPU_REAL* iqrsmw,
        ECGPU_REAL* iqrs,
        ECGPU_REAL* iondaq,
        ECGPU_REAL* iqt);

When linking my CVI project I get the following error message:
  Undefined symbol '_inicializa_cero_' referenced in "analyse.c".

This indicates in my humble opinion a problem with the name mangling. CVI expects functions to have a '_' prefix while link/g77 doesn't procedure a underscore for fortran functions.

Is there any solution for this dilemma?

Best regards,
Christian

0 Kudos
Message 1 of 3
(3,131 Views)

You could always try adding your own '_' to the function name in the source code and rebuilding the dll.

JR

0 Kudos
Message 2 of 3
(3,120 Views)
Smiley Happy
Doh, you are right, silly me!
Using
inicializa_cero__ (with a double underscore at the end) solved my problem.

Thanks!

BTW: I used "nm" (from cygwins binutils) to get the exact name of the function symbol.
0 Kudos
Message 3 of 3
(3,116 Views)