- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a project which has a bunch of Fortran files, some of which are new versions of files which already exist in a library (OLIEngineCore.lib) which needs to be linked in to provide the remainder of the files the program needs. For example GETAQU exists in OLIEngineCore.lib, but I have a new version which I link directly.
However when I link I get:
error LNK2005: _GETAQS already defined in getaqs.obj OLIEngineCore.lib(getaqs.obj)
My understanding is that the linker should use the files linked in directly, then look in the library for the remainder, and ignore those from the library it does not need. Indeed that is how it has worked in the past to my knowledge.
Why am I getting this error?
However when I link I get:
error LNK2005: _GETAQS already defined in getaqs.obj OLIEngineCore.lib(getaqs.obj)
My understanding is that the linker should use the files linked in directly, then look in the library for the remainder, and ignore those from the library it does not need. Indeed that is how it has worked in the past to my knowledge.
Why am I getting this error?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found the problem. The calling convention has to be the same as in the library. In this case /CVF.

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