Tengo advertencias en el paso del enlace. Estas advertencias aparecen solo en modo de lanzamiento.Cómo eliminar las advertencias LNK4217 y LNK4049
Mi programa se compone de dos partes: una biblioteca que genera un .lib y un ejecutable que utiliza esta biblioteca.
Cuando construyo la biblioteca no tengo advertencias. Pero cuando construyo mi ejecutable, en el enlace tengo advertencias LNK4217 y LNK4049. Por ejemplo:
3>DaemonCommon.lib(Exception.obj) : warning LNK4217: locally defined symbol [email protected]@@[email protected]@Z (public: __thiscall std::exception::exception(char const * const &)) imported in function "public: __thiscall std::bad_alloc::bad_alloc(char const *)" ([email protected]@@[email protected]@Z)
3>DaemonCommon.lib(CommAnetoException.obj) : warning LNK4217: locally defined symbol [email protected]@@[email protected]@Z (public: __thiscall std::exception::exception(char const * const &)) imported in function "public: __thiscall std::bad_alloc::bad_alloc(char const *)" ([email protected]@@[email protected]@Z)
He leído en el MSDN, estas advertencias pueden ser causados por la declaración de __declspec (dllimport). Pero, en mis clases de mi lib, no he declarado cosas así. Por ejemplo, aquí está mi clase Excepción:
#ifndef _EXCEPTION_HPP__
#define _EXCEPTION_HPP__
#include <string>
namespace Exception
{
class Exception
{
public:
// Constructor by default
Exception();
// Constructor parametrized
Exception(std::string& 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
Puede alguien decirme por qué estas advertencias aparecen y cómo eliminarlos?
De hecho, esto se debe a que mi proyecto ejecutable se definió en "DLL de subprocesos múltiples \ MD" en lugar de "Varios subprocesos \ MT" ... No sé por qué. .. Así que gracias ;-) – Cedekasme