- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am having a problem overriding routines that are included in a library.
I build a library (static) from our routine-source (about 40000 lines). Some of the functions are dummy-functions and have to be exchanged by the user, depending to the problem. So functions having the same name will occur in the main-file, written by the user.
Trying to compile the main-program works fine, but when linking I receive the error: multiple defined... I can force him to build it (/force:multiple), but then the wrong functions (from the library) are used. In unit-surrounding I can solve this problem by giving the linker-command -noinhibit-exec, I can also define the order the parts of the program are loaded.
So I would need to advice the compiler to pick functions from the library only when they are not found in the main-program.
How do i do this in visual fortran?
Greetings Georg
I am having a problem overriding routines that are included in a library.
I build a library (static) from our routine-source (about 40000 lines). Some of the functions are dummy-functions and have to be exchanged by the user, depending to the problem. So functions having the same name will occur in the main-file, written by the user.
Trying to compile the main-program works fine, but when linking I receive the error: multiple defined... I can force him to build it (/force:multiple), but then the wrong functions (from the library) are used. In unit-surrounding I can solve this problem by giving the linker-command -noinhibit-exec, I can also define the order the parts of the program are loaded.
So I would need to advice the compiler to pick functions from the library only when they are not found in the main-program.
How do i do this in visual fortran?
Greetings Georg
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Normally, this should not be a problem, if the library was created to accomodate this design. Each library routine that is to be overrideable must be in a separately compiled source file, otherwise it will be combined with others in a "module" (object type) so that if one reference from the module is pulled in, they all will be.
Steve
Steve

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