Jea*_*ond 6 c++ dll visual-studio-2015
我有 Visual Studio 的问题(在 C++ 中)
我收到一个警告,我不知道为什么,因为我从不调用 2 次同一个变量。
function: inconsistent dll linkage
我在 microsoft: Compiler Warning (level 1) C4273 上阅读,但我真的不知道这是否是我的问题,因为该示例与我的不一样。
我还阅读了关于不一致的 dll 链接(StackOverflow,它告诉我,因为我在 dll 中使用了 MFC,但我没有检查头文件 MFC。

这是我的“PayRespectdll.h”
#pragma once
#ifdef PAYRESPECTDLL_EXPORTS
#define PAYRESPECTDLL_API __declspec(dllexport)
#else
#define PAYRESPECTDLL_API __declspec(dllimport)
#endif
#include <ctime>
#include <time.h>
#include <string>
namespace PayRespectDLL
{
class PayRespect
{
private:
static struct std::tm when;
public:
static PAYRESPECTDLL_API bool is_setup();
static PAYRESPECTDLL_API void setup(std::string date);
static PAYRESPECTDLL_API bool is_possible();
}
}
Run Code Online (Sandbox Code Playgroud)
PayRespectDLL.cpp:
// PayRespectDLL.cpp :
//
#include "stdafx.h"
#include "PayRespectDLL.h"
#include <stdexcept>
#include <time.h>
#include <string>
#include <stdlib.h>
using namespace std;
namespace PayRespectdll
{
bool PayRespect::is_setup()
{
return false;//already_setup;
}
// setup attempt String: hh:mm:ss.
void PayRespect::setup(string date)
{
return;
}
bool PayRespect::is_possible()
{
return true;
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢你!
| 归档时间: |
|
| 查看次数: |
9077 次 |
| 最近记录: |