Software Archive
Read-only legacy content
17061 Discussions

Problems overriding routines

Intel_C_Intel
Employee
312 Views
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
0 Kudos
1 Reply
Steven_L_Intel1
Employee
312 Views
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
0 Kudos
Reply