我尝试在Ubuntu 10.04上使用kdevelop 3.5.4编译应用程序,但它失败并出现以下错误:
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking whether the C++ compiler works... no
configure: error: in `/home/nts/wktools4':
configure: error: C++ compiler cannot create executables
See `config.log' for more details.
*** Exited with status: 77 ***
Run Code Online (Sandbox Code Playgroud)
的config.log:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.65. Invocation command line was
$ /home/nts/wktools4/configure …Run Code Online (Sandbox Code Playgroud) 我想使用kdevelop4进行c ++编程,但是当我尝试运行应用程序时,kdevelop4需要cmake二进制文件!我怎么解决这个问题?
我正在使用QT Creator调试器.当我尝试调试一个大型数组(即1000,000个元素)时,它会尝试检索整个数组的值,但我只想查看前几个元素.在KDevelop中,调试器仅显示前5个元素,然后按下单击以显示另外5个元素,依此类推.
是否有可能在QT Creator中做同样的事情?
我是 C++ 初学者。我写了以下内容:
// GradeBook.h
#include <iostream>
#include <string>
using namespace std;
class GradeBook {
public:
GradeBook(string); // constructor that initializes courseName
void setCourseName(string); // function that sets the course name
string getCourseName(); // function that gets the course name
void displayMessage(); // function that displays a welcome message
private:
string courseName; // course name for this GradeBook
};
// GradeBook.cpp
#include <iostream>
#include "GradeBook.h"
using namespace std;
GradeBook::GradeBook(string name)
{
setCourseName(name);
}
void GradeBook::setCourseName(string name)
{
courseName = name; …Run Code Online (Sandbox Code Playgroud) 我正在编写我的第一个大c ++项目,但在运行程序时遇到了分段错误.我已经尝试使用valgrind调试它,但到目前为止还没有成功.由于程序非常大,我只会显示发生错误的相关函数:
void RigidBody::RotateAroundAxis( dReal Angle,
dRealVector3 Axis,
dRealVector3 Anchor)
{
std::cout<<"RotateAroundAxis BodyID: " << this->GetBodyId()<<std::endl;
dRealMatrix3 RotationMatrix=HelperFunctions::RotateAroundAxis(Angle, Axis);
dRealMatrix3 CurrentRotation=this->GetRotation();
dRealVector3 Position=this->GetPosition();
dRealMatrix3 newRotationMatrix=boost::numeric::ublas::prod(RotationMatrix,CurrentRotation);
std::cout<<"RotateAroundAxis (Debug0) BodyID: " << this->GetBodyId()<<std::endl;
SetRotation(newRotationMatrix);
std::cout<<"RotateAroundAxis Debug"<<std::endl;// This is the last line that is processed without an error.
std::cout<<"RotateAroundAxis (Debug1) BodyID: " << this->GetBodyId()<<std::endl; // This line probably causes the error.
// object is now rotated but needs to be translated
boost::numeric::ublas::bounded_vector<dReal,3> PosRelToAnchor;
std::cout<<"RotateAroundAxis (Debug2) BodyID: " << this->GetBodyId()<<std::endl;
for(unsigned int i=0;i<3;i++){PosRelToAnchor[i]=Position[i]-Anchor[i];};
PosRelToAnchor=boost::numeric::ublas::prod(RotationMatrix,PosRelToAnchor); …Run Code Online (Sandbox Code Playgroud)