错误:“std”之前的预期初始值设定项
error: expected initializer before ‘std’
anisha@linux-trra:~> make
g++ -c -m64 -pipe -I/usr/lib64/R/include -I/usr/lib64/R/library/Rcpp/include -I/usr/lib64/R/library/RInside/include -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/home/anisha/qtsdk-2010.05/qt/mkspecs/linux-g++-64 -I. -I/home/anisha/qtsdk-2010.05/qt/include/QtCore -I/home/anisha/qtsdk-2010.05/qt/include/QtGui -I/home/anisha/qtsdk-2010.05/qt/include -I. -o zoomCornerPanDatabaseParser.o zoomCornerPanDatabaseParser.cpp
In file included from zoomCornerPanDatabaseParser.h:9:0,
from zoomCornerPanDatabaseParser.cpp:1:
*******************boundaryLineEquation.cpp:6:1: error: expected initializer before ‘std’
make: *** [zoomCornerPanDatabaseParser.o] Error 1
.cpp
:
#include <math.h>
#include <string>
#include "boundaryLineEquation.h"
/// This function will return the direction of the new point as w.r.t to the given rectangle.
********************std :: string findPanDirection (float x1, float y1, float x2, float y2, float newX, float newY)
{
if (x1 > x2)
{
float temp = x1;
x1 =x2;
x2 = temp;
}
if (y2 > y1)
{
float temp = y2;
y2 = y1;
y1 = temp;
}
if (newX < x1 )
{
.h
:
#include <iostream>
#ifndef RLINE
#define RLINE
std :: string findPanDirection (float x1, float y1,
float x2, float y2,
float newX, float newY);
bool returnDistance (float centerPointLng, float centerPointLat,
float newCenterPointLng, float newCenterPointLat)
#endif
声明中缺少returnDistance()
;
。应该是:
bool returnDistance (float centerPointLng, float centerPointLat,
float newCenterPointLng, float newCenterPointLat);
//^
你需要
一个分号
bool returnDistance (float centerPointLng, float centerPointLat,
float newCenterPointLng, float newCenterPointLat);
^
相关文章:
- 使用std::source_location报告错误的最佳实践
- std::is_base_of表示ctor编译错误
- 多个文件的内存分配错误"在抛出 'std :: bad_alloc' what (): std :: bad_alloc 的实例后终止调用" [C++]
- 程序崩溃并显示"std::out_of_range"错误
- 在c++中尝试对对象数组进行排序时,出现std:bad_alloc错误
- 我收到以下错误:抛出'std::bad_alloc'实例后终止调用
- 尝试使用 std::vector<std::thread时出现静态断言失败错误>
- 错误 C2679:二进制"<<":未找到采用类型 'std::string_view' 的右侧操作数的运算符(或者没有可接受的转换)
- 为什么 std::绑定错误参数可以成功?
- std::cout输出int时出现编译错误
- 使用静态库与 std::jthread (g++-10) 的分段错误
- std::unordered_map 类型对象声明期间出现"field has incomplete type"错误
- 在缺少函数重载时抛出异常,并带有 std::variant 而不是编译时错误
- 使用 memcpy() 复制到 std::chrono::milliseconds 会给出错误 -Werror=clas
- 显式 std::exception_ptr 转换为 bool 不存在.VS2010 错误?
- "random_shuffle":不是"std"错误的成员
- VC++ 2010 "array is not a member of std"错误
- 开发C++ "to_string is not a member of std"错误
- STD未来异常-已检索,STD错误
- 交叉编译c++的树莓派std错误