- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a C-code with calls to Fortran subroutines which doesn't work. I wonder if anybody can guess what I'm doing wrong?
The fortran code isdefined as below:
SUBROUTINE FLYCUR2(datafile,grffile)
!DEC$ ATTRIBUTES DLLEXPORT, STDCALL, REFERENCE :: FLYCUR2
!DEC$ ATTRIBUTES ALIAS: 'FLYCUR2' :: FLYCUR2
CHARACTER*(*) datafile, grffile
...
It's compiled with Intel Fortran compiler v.10 into a dll. I have tested it with a test example written in C# and it works.
The C code is defined as below:
extern int __stdcall FLYCUR2(char *,int,char *,int);
...
FLYCUR2(filename1,n1,filename2,n2);
...
Visual Studio 2008 is used to create a project with theC code. The fortran library (.lib) from the fortrancode is included in "Aditional Depencencies" with the linker.
However when I tried to build the code I get the following error:
Error50error LNK2019: unresolved external symbol __imp__FLYCUR2 referenced in function _print_pages@0GRAFDLL.objGraf_09
Any idea what I'm doing wrong?
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As far as I know, C# works in the same manner as Visual Basic -- it does not use the .lib file, but "looks" at the actual exported symbols from the dll.
You can export the same symbol from the dll under multiple aliases though. To do that, you must write a .def file. It is sufficient that you just insert it in the project and it will be automatically recognized by the linker. (I recommend that you remove the DLLEXPORT attribute from the code, because I don't know how two means interact). The contents of the file (yourlib.def) should be just:
[cpp]EXPORTS _flycur2@16 FLYCUR2 = _flycur2@16 [/cpp]As result, both "_flycur2@16" and "FLYCUR2" will be exported from the dll (verify it with Dependency Walker!) and refer to the same routine. The first one will be used by C++, and the second by C#.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As far as I know, C# works in the same manner as Visual Basic -- it does not use the .lib file, but "looks" at the actual exported symbols from the dll.TVB actors actresses for phim hong kong film model world.Fashion brand names thoi trang high quality. Top level cotton thoi trang for teen men women fashion lovers.
You can export the same symbol from the dll under multiple aliases though. To do that, you must write a .def file. It is sufficient that you just insert it in the project and it will be automatically recognized by the linker. (I recommend that you remove the DLLEXPORT attribute from the code, because I don't know how two means interact). The contents of the file (yourlib.def) should be just:clothes fashion korean wholesale fashion for model world. Asian fabrics korean wholesale fashion models garment.
[cpp]EXPORTSAs result, both "_flycur2@16" and "FLYCUR2" will be exported from the dll (verify it with Dependency Walker!) and refer to the same routine. The first one will be used by C++, and the second by C#.
_flycur2@16
FLYCUR2 = _flycur2@16
[/cpp]

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »