Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to delete warnings LNK4217 and LNK4049
    text
    copied!<p>I have warnings on the link step. These warnings appear only in release mode. </p> <p>My program is composed of two parts: a library which generates a .lib and an executable which uses this library. </p> <p>When I build the library I have no warnings. But when I build my executable, on the link I have warnings LNK4217 and LNK4049. For example:</p> <pre><code>3&gt;DaemonCommon.lib(Exception.obj) : warning LNK4217: locally defined symbol ??0exception@std@@QAE@ABQBD@Z (public: __thiscall std::exception::exception(char const * const &amp;)) imported in function "public: __thiscall std::bad_alloc::bad_alloc(char const *)" (??0bad_alloc@std@@QAE@PBD@Z) 3&gt;DaemonCommon.lib(CommAnetoException.obj) : warning LNK4217: locally defined symbol ??0exception@std@@QAE@ABQBD@Z (public: __thiscall std::exception::exception(char const * const &amp;)) imported in function "public: __thiscall std::bad_alloc::bad_alloc(char const *)" (??0bad_alloc@std@@QAE@PBD@Z) </code></pre> <p>I have read in the MSDN, these warnings may be caused by the declaration of __declspec(dllimport). But, in my classes of my lib, I haven't things declared like this. For example, here is my class Exception:</p> <pre><code>#ifndef _EXCEPTION_HPP__ #define _EXCEPTION_HPP__ #include &lt;string&gt; namespace Exception { class Exception { public: // Constructor by default Exception(); // Constructor parametrized Exception(std::string&amp; strMessage); // Get the message of the exception virtual std::string getMessage() const; // Destructor virtual ~Exception(); protected: // String containing the message of the exception std::string mStrMessage; }; } #endif </code></pre> <p>Can somebody tell me why these warnings appear and how to delete them ? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload