c++ - “ActivationsSource”不是类或命名空间名称
问题描述
我正在使用命名空间来保存我经常引用的常量变量,在我尝试编译程序之前似乎没有任何问题,然后我得到
C2653:“ActivationSource”不是类或命名空间名称
和
C3861:'IdentitySource':找不到标识符
我的包含文件看起来像这样(请注意,我没有使用预编译的头文件):
// includes.h
#pragma once
#include "pch.h"
#include <vector>
#include <iostream>
#include <string>
#include <functional>
#include <algorithm>
#include <utility>
#include "CustomTypes.h"
#include "ActivationSource.h"
#include "ThresholdSource.h"
#include "StaticVariables.h"
...
产生错误的文件看起来像这样
// StaticVariables.h
#pragma once
#include "includes.h"
namespace activations
{
const Activation Identity = ActivationSource::IdentitySource;
...
}
ActivationSource.h 看起来与此类似:
// ActivationSource.h
#pragma once
#include "includes.h"
namespace ActivationSource
{
float IdentitySource; // this is defined in ActivationSource.cpp
...
}
在此先感谢,我很抱歉可能不时拼写不同的名字。
解决方案
推荐阅读
- c++ - 为什么此代码在计算中间时出现运行时错误?
- php - 在 Docker 中配置 Caddy+PHP
- javascript - 在 onDismiss 处理程序之后重置 div 样式?
- python - 为什么我的 for 循环中的值没有正确附加?
- git - 在 Github 操作中获取提交 SHA
- html - 如何在 html 中的单个 div 内可互换地显示画布和表格?
- linux - 在服务器内如何找到我的 IP 地址
- rust - Cargo 不会从本地依赖项中获取更改。如何调试/修复?
- c# - 在不同的 Razor 页面区域之间共享页面
- arrays - 在 Numpy Arrays Python 中添加先前和当前索引