PDA

View Full Version : Error LINK.3230


R. T. (Fortran Man)
08-22-2003, 07:10 PM
I am getting an error when linking with lf95 v5.6:
Error LINK.3230: Undefined Symbol...
If I use v5.7, the error is:
error LNK2001: unresolved external symbol
and
fatal error LNK1120: unresolved externals
How do I go about fixing this error?

Lahey Support
08-22-2003, 07:56 PM
The undefined symbols error LINK.3230 (Pharlap linker) or LNK2001 (Microsoft linker) means that somewhere in your program, you are calling a subroutine or function, but this subprogram is not being provided to the linker. The call could either be in your code, or in a library or DLL being used by your code.
Some reasons that the linker is not getting the subprogram:
The source file is not getting into the compile command, or the object file is not being specified to lf95;
An extraneous source or object file is sneaking in to the link command which does not belong. This can occur when using wildcards for filenames or when using automake;
You are using the wrong version of a library or DLL (DLL Hell);
A compile error is occurring which prevents the creation of the object file which contains subprogram;
A misspelling might be occurring, which causes the linker to not be able to find the subprogram, or is making it look for the wrong subprogram.
If this is the first time that you are compiling the code, the last two possibilities should be considered, because it is relatively easy to introduce problems that do not occur on the development machine, but pop up on the machine where the code is distributed.
The first thing to try is to grep for all occurrences of the undefined symbol (without any leading or trailing underscores or decoration). Look for a function or subroutine declaration, and see if that file is getting into the compile/link command. Look for a function of subroutine call, and make sure that source or object file actually belongs with the program.