vs2017编译器,在win10上,头文件中有中文注释,文件编码为UTF-8
中文注释下面一行的成员函数(或者中文注释同一行,前面的成员函数),在这个对应的cpp文件中,报出C2039:XXX不是XXX的成员的奇怪报错


解决方法方法:
(1)删除中文注释,或者改成英文注释。
(2)文件编码为UTF-8 BOM格式,就没有问题。
(3)中文注释和代码之间空一行
本文介绍了使用VS2017编译器在Win10环境下,当头文件采用UTF-8编码且含有中文注释时,可能会遇到的C2039错误,并提供了三种解决方案。
vs2017编译器,在win10上,头文件中有中文注释,文件编码为UTF-8
中文注释下面一行的成员函数(或者中文注释同一行,前面的成员函数),在这个对应的cpp文件中,报出C2039:XXX不是XXX的成员的奇怪报错


解决方法方法:
(1)删除中文注释,或者改成英文注释。
(2)文件编码为UTF-8 BOM格式,就没有问题。
(3)中文注释和代码之间空一行
傅里叶红外(FT-IR):Origin数据处理、光谱绘图、曲线优化、图形美化
双击 X 轴,选择“轴线和刻度线”,设置粗细为“2”(较常用的粗细度),主刻度和次刻度为“朝内”,然后在此对话框内选择左轴,设置粗细为“2”,主刻度和次刻度为“无”,上轴和右轴同左轴。(4)在第二个图层基础上新建第三个图层,针对第二组数据重复上述中(1)和(2)的操作,再添加第三组数据的折线图,并重复上述中(3)的操作。FTIR 光谱上的峰只有相对的强弱,因此只分析一个光谱上的一个峰的强度大小并无意义,一般分析两个光谱在同一位置的峰强相对大小,或者分析同一光谱不同位置的峰强相对大小并与另一光谱进行比较。
error C2039,不是类成员 问题出现的原因之一与解决方法
error C2039,不是类成员 问题出现的原因之一与解决方法 在visual stdio中编代码时,编译器有时会给代码报出 不是类成员 的错误,错误为error C2039。 场景:例如观察者模式中,两个类相互需要以对方做为自己函数的参数或本身包含对方类的指针,也需要在自己类的方法定义中调用另一个类的函数 报错原因:使用了未被声明 的类或函数,即类和函数被调用前必须声明。不然报错error C2039,不是类成员 正确步骤: 1.写出两个类的声明 2.写出两个类中成员与函数的声明
Hypermesh静力学仿真分析与模态分析-02
hypermesh中对较复杂实体进行静力学分析和模态分析,包含材料属性添加,载荷设置等等
Qt报错:错误 C2039 “Value“: 不是 “`global namespace‘“ 的成员
Qt报错:错误 C2039 "Value": 不是 "`global namespace'" 的成员 查看对正在编译的函数 模板 实例化“QMetaObject::Connection QObject::connect(const OsgWindow *,Func1,const WndTrajectories *,Func2,Qt::Connection
FT601Q芯片深度解析:从USB3.0引脚定义到FPGA FIFO协议实战选型
本文深入解析FT601Q芯片在USB3.0接口设计与FPGA协议栈开发中的应用,详细介绍了USB3.0引脚定义、FT601Q芯片架构、245同步FIFO模式及硬件设计要点,帮助工程师实现高速数据传输系统。
EMB电子机械制动器夹紧力预估策略分析
本文探讨了电子机械制动器(EMB)夹紧力的四种预估方法:1)基于电机电流的方法简单经济但易受干扰;2)基于位置传感器的方法实时性好但依赖模型精度;3)直接力测量精度最高但成本较高;同时提出未来将结合AI和数字孪生技术提升预估精度。研究显示,准确的夹紧力预估对制动安全性、能效和舒适性至关重要,当前面临温度稳定性、参数漂移等技术挑战。随着智能算法的发展,EMB夹紧力预估将实现更高精度和可靠性。
error: C2039: “qt_metacast“: 不是 “DeclareInterface“ 的成员
error: C2039: "qt_metacast": 不是 "DeclareInterface" 的成员
计算机组成原理(第三版)唐朔飞-第九章控制单元的功能-课后习题
计算机组成原理(第三版)唐朔飞-第九章控制单元的功能-课后习题
C++的errorC2039
1)未包含相关头文件,如string 解决方案,添加相关头文件 2) 已包含头文件 ,为何还会报错? 检查是否有头文件stdafx.h,若无则包含进去,若有但不在第一行,则调整至代码首行。 stdafx.h名称的英文全称为:Standard Application Framework Extensions #include “stdafx.h” 必须是所有的CPP实现文件第一条语句,由系统自动生成。 Microsoft C 和 C++ 编译器提供了用于预编译任何 C 或 C++ 代码(包括内联代码)的选项。
YOLO26改进 - SPPF模块 | 发论文神器!LSKA注意力改进SPPF,增强多尺度特征提取能力,高效涨点!!!
本文介绍了Large Separable Kernel Attention (LSKA)模块及其在YOLO26中的结合应用。LSKA旨在解决Visual Attention Networks (VAN)使用大内核卷积时的计算效率问题,通过将2D深度卷积层的卷积核分解为级联的水平和垂直1-D卷积核,降低了计算复杂度和内存占用,且使VAN更关注物体形状。我们将集成LSKA的SPPF_LSKA模块引入YOLO26,大量实验表明,改进后的模型在对象识别、检测、分割和稳健性测试上表现出色。
GRSL 2026 即插即用 | Transformer篇 | DCSA:动态稀疏门控自注意力,兼顾长距离依赖与局部细节表达!
SDANet整体架构和模块Dynamic Channel Sparse Attention (DCSA):DCSA为Transformer块中的自注意力层。DCSA架构:样本级动态稀疏注意力:首次实现每个样本独立预测注意力稀疏度:通过轻量门控网络根据输入特征的复杂度自适应调整保留的通道数,简单样本使用更高稀疏度(如保留 20% 通道),复杂样本使用更低稀疏度(如保留 80% 通道),在保证精度的前提下平均计算量降低 50% 以上。
SeetaFace6 windows下编译记录
SeetaFace6 编译过程
ROS从入门到精通1-1:ROS核心架构、常用指令与计算图
本文介绍ROS的核心架构,各个文件、目录的用途、常用命令行工具、动态计算图原理。
重写QGraphicsEllipseItem,报错error C2039: “staticMetaObject“: 不是 “QGraphicsEllipseItem“ 的成员
如图新建一个继承 QGraphicsEllipseItem 类报错 moc_myEllipseItem.cpp(67,56): error C2039: "staticMetaObject": 不是 "QGraphicsEllipseItem" 的成员moc_myEllipseItem.cpp(86,34): error C2039: "qt_metacast": 不是 "QGraphicsEllipseItem" 的成员moc_myEllipseItem.cpp(91,33): error C2039
深度学习工具包 DeepLearningToolbox
深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[](https://bitdeli.com/free "Bitdeli Badge")
温度PID控制PLC程序
温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值
【c/c++问题总结】error C2039、 C2001、 C2146、C2297、 C2601、C2065、 C2660、 C2440
将整理增添以后遇见的所有错误
假人有限元模型
假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用
解决方案:关于C2039,XXX不是XXX的成员的奇怪报错
有时候不是函数的问题,是编码的问题,把中文注释全去掉就行了
OV9734 DATASHEET,完整规格书
OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等
qt 错误 多继承 造成错误:error C2039: “qt_metacall“: 不是 “xxxxxx“ 的成员
今天用Qt使用多继承发现报如下错误: error C2039: "qt_metacall": 不是 "xxxxxx" 的成员 原格式 class TCPCommunication : public TcpBaseMethod,public QObject 其中TcpBaseMethod就是一个普通的自定义类,没有继承任何东东,QObject是Qt得类,后面发现需要更改继承的顺序,错误就解决了 更改后 class TCPCommunication : public QObject, public TcpB
QT error: C2039: “jifen_lineEdit”: 不是“Ui::UIMainFrame”的成员
前提: 在ui界面新增了一个edit控件,在对应cpp中使用ui->jifen_lineEdit时就报错error: C2039: “jifen_lineEdit”: 不是“Ui::UIMainFrame”的成员 或者error: no member named 'jifen_lineEdit' in 'Ui::UIMainFrame'尝试:我把build文件删掉,执行清除,qmake,重新编译后都不管用。这是因为程序此时还是。
error: C2039: “staticMetaObject”: 不是“QGraphicsItem”的成员
当使用Qt的图形视图框架时,自定义图形类时,一般这样写 class myItem:public QGraphicsItem { public: myItem(); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); QRectF boundingRect() const; }; 然而有些时候,我们需要使用信号与槽,就需要增加 Q_OBJECT,这时,就会报错 error: C2039:
Qt错误C2039 ‘widget‘ is not a member of ‘Ui::TrendLineClass‘解决办法
3.跟之前运行成功的代码仔细比较发现,是ui文件包含的次序问题。如果先包含了,该对话框在执行时候会先进入到ui里,发现我提升为QChartView的widget,他不认识(需要#include<QtCharts>他才能知道),因为 #include<QtCharts>在ui文件的后面,还没有读取到。新建了一个QDialog的类,并拖入了一个widget的控件,用于作为绘图显示的窗口。打开UI文件,看内部代码发现widget确实是在这个文件里。2.百度搜索,让重新编译ui文件,然后重新扫描项目,依然没有用。
C++的errorC2039和C2679的解决
欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦: Markdown和扩展Markdown简洁的语法 代码块高亮 图片链接和图片上传 LaTex数学公式 UML序列图和流程图 离线写博客 导入导出Markdown文件 丰富的快捷键 快捷键 加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl
error C2039,老是报不是类成员
关闭VS,重新打开 转载于:https://www.cnblogs.com/zqhiuui/p/10331349.html
vs c++代码 c2039错误 “xxx” 不是“xxx“的成员
c++ c2039错误
[QT] 记录使用Qt Creator遇到的问题
原因:项目配置没弄好,一开始生成的编译文件在源代码所在文件夹A里,后来修改【构建目录】B后,编译还是使用原来A文件夹下的编译文件,将A目录下的"ui_xxx.h"删除后,重新编译即可通过编译了。报错:error C2039: "label_xxx": 不是"Ui::xxx"的成员。详情:修改ui文件后,编译不通过。
108
873
882

被折叠的 条评论
为什么被折叠?



