Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29282 Discussions

linker search order no longer applies?

dajum
Novice
541 Views
Hi,

We have been using a "feature" of the linker for years that I find no longer works. We compile a main routine and some associated routines and then link with a very large library. If we want to build an executable that uses a different version of a subroutine that is in the library we would just add it to the main file and compile and link it. Now I find that we get a fatal LNK2005 error that says the routine is multiply defined. I know it is and want to use the behavior that the linker used a fixed order to resolve references in the code and use the routine from the object file just compiled and not the routine in the library.

Is there a way around LNK2005 without removing the routine from the library?

Thanks,

Dave
0 Kudos
1 Reply
dajum
Novice
541 Views
I found the problem! It appears that every routine that was in the original compilation unit must also be in the new unit. WHy this is - and why the error message doesn't indicate this is still puzzling to me.

Dave
0 Kudos
Reply