Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
7117 Discussions

How do I find the conflicting library "Link warning link 4098"

Ever
New Contributor I
579 Views

I have a project I coded myself in VS 2019 Intel 2023. It works fine in Debug config, with Run time libraries /libs:static and Intel Math Kernel /qmkl:sequential. The results are correct!!! BUT when I build it w/Release config, I get "Link warning link 4098:Default lib can conflict with other lib use /NODEFAULTLIBS library" and the results are wrong!!! When I add /NODEFAULTLIBS to the link directive, I get 46 unresolved LNK 2019 errors. I recognize a few MKL that I used, the rest are unrecognizable to me. The compiler recognizes a conflict, but it does not highlight it. How do I find the one that creates the conflict???

 

0 Kudos
7 Replies
Steve_Lionel
Honored Contributor III
530 Views

The compiler isn't involved here - it's the linker. I generally find this particular diagnostic unhelpful in its suggestion to use /nodefaultlibs. Usually, this problem occurs when you have a mix of DLL and static libraries being linked in. Did you check to see that your selection of static libraries was carried over into the release configuration?

Asking for a link map and reading the map file can also help identify the issue. It happens when a symbol has been found in one library but a reference to an object in another library also defines that same symbol.

I'll also comment that your paraphrasing and excerpting the diagnostics interferes with people trying to help you.

0 Kudos
Ever
New Contributor I
517 Views

Yes, the /libs:static is present in both Debug and Release configurations, as shown below.

I can get both Debug and release to link w/o warnings and to calculate the correct results only if I add /libdir:noauto and run inside VS, but adding /libdir:noauto overwrites the libs:/static (I know that because the .exe in both Debug and Release folders do not run, because it is missing mkl_sequential.2.dll).

If I remove /libdir:noauto (change it to NO) the results are incorrect because the eigenvalues, which are calculated by MKL, are incorrect "Eigenvalue 1 is numerically infinite or undetermined".

I just updated to oneAPI 2025. The problem persists.  

Release.png

0 Kudos
Steve_Lionel
Honored Contributor III
480 Views

True - /libdir:noauto overrides both /libs and /Qmkl. But I see you have specified Debug Multithreaded for the Release configuration, which may conflict with the C code in some of the libraries. Try changing to the non-debug version.

0 Kudos
Ever
New Contributor I
452 Views

In Release config. I tried 4 options of Runtime Library:
--Multithreaded
--Multithread (/libs:dll ...

--Debug Multithread (/libs:static ...
--QuickWin /libs:qwin 

with...
/Qmkl:sequential (to use mkl for the calculation of the eigenvalues)
and
/libdir:noauto (which is my attempt to produce a static .exe that includes all the necesary libraries)... my code calculates correctly inside VS, but the .exe does not run standalone, displaying this:
   libifcoremdd.dll was not found
   mkl_sequential.2.dll was not found
   libmmdd.dll was not found

With Runtime libraries:
--Debug Multithread (/libs:static ...
--/Qmkl:sequential
and
Disable Default Library Search Rules: NO (instead if /libdir:noauto) ...
...I get warning LNK4098, & the results are incorrect. Incorrect results are computed by MKL. I am sure because in the code, I put a write() statement to print MKL errors if any, and that is what I get, the MKL cannot compute the eigenvalues, and thus the results are incorrect.

 

 

0 Kudos
Steve_Lionel
Honored Contributor III
438 Views

If you use /libdir:noauto you must specify all of the libraries to be used (or rely on some object not compiled that way to pull them in.) Clearly you're getting references to DLL libraries.

I suggest you take this to the MKL forum.

0 Kudos
Ever
New Contributor I
267 Views

OK, I'll open a post on the MKL forum, but let me share this with you.

The code has worked since 2010 with minor modifications over time, until recently I changed a few arrays from fixed dimensions, such as

 

integer parameter n=8;

double precision variable(n,3)

 

to

 

allocatable variable(:,:)

read(1,*) n

allocate(variable(n,3))

 

Now, I reverted to the original version, and everything works. The static *.exe produces correct results!!! 

Apparently, using allocatable() is the cause of the problems. 

 

Both Debug and Release work well, with configuration:

Runtime library: Debug Multithreaded (/libs:static /threads /dbglibs)

Use MKL: Sequential (/Qmkl:sequential)

 

 

 

0 Kudos
Shiquan_Su
Moderator
98 Views

Hi, Ever:

Glad that you found out the reversion can produce correct results. Do you still need help here? If so, would you please provide a reproducer to capture the issue you described? Thanks.

Shiquan

0 Kudos
Reply