Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

ldexpf already defined linker error

Sergey_N_1
Beginner
1,329 Views

Hi, when I try to build a project with intel compiler 19.0 , I get following linker error:

1>libmmd.lib(libmmd.dll) : : error LNK2005: ldexpf already defined in mkl_intel_lp64_dll.lib(dftifreedescriptor_lp64.obj)

Any ideas what I am doing wrong ?

Edit: Forgot to mention that I'm building on windows10 x64 .

Thanks,

Sergey.

0 Kudos
5 Replies
Viet_H_Intel
Moderator
1,329 Views

Can you search to see where was another definition of ldexpf coming from?

0 Kudos
Sergey_N_1
Beginner
1,329 Views

I have a slightly different version of this issue now. I've changed from using  a direct list of mkl libraries to link with to using /Qmkl option if building with intel compiler (why do I have to do this ???) and now the problem is the following:

1>libmmd.lib(libmmd.dll) : : error LNK2005: ldexpf already defined in 3rdparty.cuda.lib(CudaKernels.cu.cubin)

3rdparty.cuda.lib is cuda based static library built with MSVC. It doesn't use any exp or expf explicitly, it does use some std::complex<float> math and that's it.

I don't understand why is this even a problem since it builds just fine with  MSVC and the only way I can workaround it is to add /FORCE:MULTIPLE to the link line.

Regards,

Sergey.

 

Edit: spelling

0 Kudos
Viet_H_Intel
Moderator
1,330 Views

You  use /Qmkl to link to the Intel Math Kernel Library. Seems that you have another ldexpf definition in 3rdparty.cuda.lib

0 Kudos
Sergey_N_1
Beginner
1,330 Views

Viet Hoang (Intel) wrote:

You  use /Qmkl to link to the Intel Math Kernel Library. Seems that you have another ldexpf definition in 3rdparty.cuda.lib

Hi Viet. I can't see it being defined explicitly anywhere . What should I be looking for ? And why does it link fine when linked with microsoft compiler ?

 

Thanks,

Sergey.

0 Kudos
Viet_H_Intel
Moderator
1,330 Views

If you don't use /Qmkl, will it link? Is this possible to look into your linker command to see what are being linked in?

0 Kudos
Reply