- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Dave
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page