リンクステップで警告があります。これらの警告は、リリースモードでのみ表示されます。警告を削除する方法LNK4217およびLNK4049
私のプログラムは、.libを生成するライブラリと、このライブラリを使用する実行可能ファイルの2つの部分で構成されています。
ライブラリをビルドするときに警告が表示されません。しかし、私が実行ファイルをビルドすると、リンク上に警告LNK4217とLNK4049があります。例えば:私はMSDNに読んだ
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)
、これらの警告は、__declspec(DLLIMPORT)の宣言によって引き起こされ得ます。しかし、私のクラスの私のクラスでは、私はこのような宣言はしていません。たとえば、ここに私のクラスの例外がある:これらの警告が表示され、それらを削除する方法をなぜ
#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
誰かが私に言うことはできますか?
実際には、これは私の実行可能なプロジェクトではなく、「マルチスレッド・\ MT」の「マルチスレッドDLL \ MD」に定義されたので...私は理由を知りませんでした。 ..ありがとう;-) – Cedekasme