I have a visual studio solution (generated from a Qt project, but I don't know that it's relevant) that has the general form:
Application.exe (depends on):
Library A (which depends on):
Library B.
I use the Intel MKL libraries throughout all of the libraries, and let the visual studio MKL plugin handle linking those to my projects. I had been building the libraries as static libs, which worked, but was giving me probably thousands of duplicate definition warnings:
1>mkl_intel_thread_dll.lib(mkl_intel_thread.dll) : warning LNK4006: __NULL_IMPORT_DESCRIPTOR already defined in mkl_intel_lp64_dll.lib(libimalloc.dll); second definition ignored
1>mkl_intel_thread_dll.lib(mkl_intel_thread.dll) : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
1>mkl_core_dll.lib(mkl_core.dll) : warning LNK4006: sdttrsb_4dfl already defined in mkl_intel_lp64_dll.lib(_sdttrsb_4dfl_lp64.obj); second definition ignored
1>mkl_core_dll.lib(mkl_core.dll) : warning LNK4006: sdttrfb_4dfl already defined in mkl_intel_lp64_dll.lib(_sdttrfb_4dfl_lp64.obj); second definition ignored
etc...
I would just ignore these warnings, but there are so many of them that it dramatically slows down the build process.
So, I changed the libraries to build as .dlls, thinking that it would get rid of the duplicate definition warnings (which it did), but it raised linker errors between my libraries which look like this:
2>metricsmodel.obj : error LNK2019: unresolved external symbol "public: class QSharedPointer<class QVector<double> > __cdecl SpectralImage::GetWaveNumbers(void)" (?GetWaveNumbers@SpectralImage@@QEAA?AV?$QSharedPointer@V?$QVector@N@@@@XZ) referenced in function "public: void __cdecl MetricsModel::RunMetrics(class MetricsRunConfig *)" (?RunMetrics@MetricsModel@@QEAAXPEAVMetricsRunConfig@@@Z)
2>metricsmodel.obj : error LNK2019: unresolved external symbol "public: __cdecl Hyperslab::Hyperslab(class QVector<int>,class QVector<int>,class QObject *)" (??0Hyperslab@@QEAA@V?$QVector@H@@0PEAVQObject@@@Z) referenced in function "public: void __cdecl MetricsModel::RunMetrics(class MetricsRunConfig *)" (?RunMetrics@MetricsModel@@QEAAXPEAVMetricsRunConfig@@@Z)
2>metricsmodel.obj : error LNK2019: unresolved external symbol "public: virtual __cdecl Hyperslab::~Hyperslab(void)" (??1Hyperslab@@UEAA@XZ) referenced in function "private: class QVector<class QString> __cdecl MetricsModel::ComputeMetrics(class QVector<class QSharedPointer<class Metric> >,class HDFDataset *,class Hyperslab *)" (?ComputeMetrics@MetricsModel@@AEAA?AV?$QVector@VQString@@@@V?$QVector@V?$QSharedPointer@VMetric@@@@@@PEAVHDFDataset@@PEAVHyperslab@@@Z)
Where metricsmodel.obj is from Library A, and the unresolved symbols are in Library B.
Is there a step that I missed when trying to transition my build from static libs to .dlls? All the other dependencies are met, so I'm unsure why Library A cannot find the symbols defined in Library B at link.