以2个翻译单元乘以类函数的定义

时间:2019-02-09 21:28:36

标签: c++ cmake

我正在尝试将我的代码从linux移植到Windows,并且我已经链接到类函数。

我尝试了以下解决方案以将这些函数设置为内联并且仍然具有,我尝试使用#pragma一次,但问题仍未解决。

这是我的头文件PciResources.h

所有波纹管函数都在PciResources.cpp中声明

10

我正在从其他翻译部门获得以下链接:

#ifndef PCI_RESOURCES_H_
#define PCI_RESOURCES_H_
#include <HostCliAgent.h>
#include "PciCrspaceFactory.h"
#include "PciConfigurationSpaceAgent.h"
class PciResources {
public:

void addPciConfigurationSpaceAgent(pPciConfigurationSpaceAgent pci_configuration_space_agent);
void addHostCliAgent(pHostCliAgent hostCliAgent);
void addPciCrspaceAgent(pCRPci pciCrspace);

pPciConfigurationSpaceAgent getPciConfigurationSpaceAgent();
pHostCliAgent getHostCliAgent();
pCRPci getPciCrspace();

bool hasCrspace();
bool hasConfigurationSpaceAgent();
bool hasHostCliAgent();

private:
pCRPci                      _pci_crspace;
pPciConfigurationSpaceAgent _pci_configuration_space_agent;
pHostCliAgent               _host_cli_agent;
};
typedef shared_ptr<PciResources>    pPciResources;
#endif /* PCI_RESOURCES_H_ */

这些功能均未在其他文件中声明。

提前谢谢。

0 个答案:

没有答案