gpt4 book ai didi

c++ - 错误 C2732 : linkage specification contradicts earlier specification for 'log'

转载 作者:行者123 更新时间:2023-11-28 06:09:00 27 4
gpt4 key购买 nike

我写了一些函数,并编译成一个dll模块。在我的头文件中如下:

#ifndef GET_DATAFEED_FORKDB_H
#define GET_DATAFEED_FORKDB_H

#include "..\include\stdafx.h"
#include <windows.h>

#include "..\include\TDFAPI.h"
#include "..\include\TDFAPIStruct.h"
#include "..\include\PathHelper.h"
#include "..\include\ConfigSettings.h"

// some helper functions
// ....

extern "C" void openConnect();
extern "C" void closeConnect();

#endif

但是,当我使用 Visual Studio 2013 Professional 编译它时,出现了一些错误:

F:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(501) :
error C2732: linkage specification contradicts earlier specification for 'log'
F:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(501) :
see declaration of 'log'
F:\Program Files (x86)\Microsoft Visual Studio12.0\VC\INCLUDE\xtgmath.h(104)
:error C2732: linkage specification
contradicts earlier specification for 'log'
F:\Program Files (x86)\Microsoft Visual Studio12.0\VC\INCLUDE\xtgmath.h(104)
: see declaration of 'log'
F:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\xlocale(337)
: warning C4530: C++ exception handler used, but unwind semantics are not
enabled. Specify /EHsc

我没有用过数学方法。所以我尝试使用 this method解决它,但它没有用。包含的头文件不能不修改,我也试过用这个方法:

 extern "C" {
#include "..\include\TDFAPI.h"
#include "..\include\TDFAPIStruct.h"
#include "..\include\k.h"
#include "..\include\PathHelper.h"
#include "..\include\ConfigSettings.h"
}

,更糟糕的是,它发生了更多的错误。

最佳答案

刚遇到和你一样的问题。我遇到了和你一样的问题。 #include "k.h" 必须放在包含任何标准 header 之后。

关于c++ - 错误 C2732 : linkage specification contradicts earlier specification for 'log' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31692286/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com