nightn / CloudViewer

A cross-platform point cloud visualization software powered by PCL and Qt.
https://nightn.github.io/2017/04/15/cloudviewer/
Apache License 2.0
418 stars 170 forks source link

VS编译失败,一堆奇怪的ERROR #15

Closed Aeyer closed 4 years ago

Aeyer commented 4 years ago

<vs2017 、pcl1.9.1 、 qt513 、 vtk8.1>

CloudViewer.cpp 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp : warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 2>c:\users\ljh\desktop\cloudviewer-master\src\CloudViewer.h : warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 2>D:\pcl191\PCL 1.9.1\include\pcl-1.9\pcl/point_traits.h : warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 2>D:\pcl191\PCL 1.9.1\include\pcl-1.9\pcl/visualization/interactor_style.h : warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 2>D:\pcl191\PCL 1.9.1\include\pcl-1.9\pcl/visualization/pcl_visualizer.h(1609): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(30): error C2039: “convertWireframe”: 不是“CloudViewer”的成员 2>c:\users\ljh\desktop\cloudviewer-master\src\CloudViewer.h(74): note: 参见“CloudViewer”的声明 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(30): error C2065: “convertWireframe”: 未声明的标识符 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(101): error C2065: “timeCostSecond”: 未声明的标识符 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(107): error C2065: “timeCostSecond”: 未声明的标识符 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(103): error C2660: “CloudViewer::consoleLog”: 函数不接受 3 个参数 2>c:\users\ljh\desktop\cloudviewer-master\src\CloudViewer.h(140): note: 参见“CloudViewer::consoleLog”的声明 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(235): error C2065: “j”: 未声明的标识符 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(236): error C2065: “j”: 未声明的标识符 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(237): error C2065: “j”: 未声明的标识符 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(238): error C2065: “j”: 未声明的标识符 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(239): error C2065: “j”: 未声明的标识符 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(240): error C2065: “j”: 未声明的标识符 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(246): error C3927: "->": 非函数声明符后不允许尾随返回类型 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(246): error C3484: 语法错误: 返回类型前应为“->” 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(246): error C3613: “->”后缺少返回类型(假定为“int”) 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(246): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(246): error C2371: “multiMyCloud”: 重定义;不同的基类型 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(245): note: 参见“multiMyCloud”的声明 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(246): error C2146: 语法错误: 缺少“;”(在标识符“cloud”的前面) 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(247): error C3927: "->": 非函数声明符后不允许尾随返回类型 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(247): error C3484: 语法错误: 返回类型前应为“->” 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(247): error C3613: “->”后缺少返回类型(假定为“int”) 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(247): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int 2>C:\Users\ljh\Desktop\CloudViewer-master\src\CloudViewer.cpp(247): error C2371: “multiMyCloud”: 重定义;不同的基类型

Leon1128 commented 4 years ago

你好,我也遇到同样的问题,请问你解决了吗

urchinbin commented 3 years ago

一样的问题 <vs2017 、pcl1.9.1 、 qt5.14.1 、 vtk8.1>

urchinbin commented 3 years ago

问题解决了。是vs编程环境的编码问题。 解决方案:使用notepad++,将有问题的cpp(有中文注释的cpp)的编码从utf-8修改为utf-8-BOM 重新编译。完美解决!