문제

I am using Intel Visual Fortran Composer XE 2011 to build my Fortran project in MS Visual Studio 2008. I am getting linker errors: LNK2019 unresolved external symbol.

I did a dumpbin on my obj files and all of my symbols (under CVF calling convention) are exporting as _symbol1, _symbol2, _symbol3, and so on EXCEPT for three random ones that have some stuff prefixed to it.

For example: _imp_symbol4, _imp_symbol5, _imp_symbol6

At first I suspected my calling convention must have been the problem but if it was my calling convention, wouldn't ALL of the other symbols have exported with the imp prefixed to it as well? It's so random that three of them export weirdly and I don't quite understand what is going on. Any help would be appreciated.

도움이 되었습니까?

해결책 2

I found out the issue was because I had some DLL export statements for those symbols when I really didn't need them. It made the compiler expect _imp_sybmol because I was exporting them using the statement:

    !DEC$ATTRIBUTES STDCALL:: YOURSYMBOL
!DEC$ATTRIBUTES DLLEXPORT:: YOURSYMBOL

I just removed them and the linker errors went away.

다른 팁

The entities corresponding to those symbols may have the DLLIMPORT attribute. The link step may be missing the relevant import library.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top