相关疑难解决方法(0)

链接上的未定义符号___gxx_personality_v0

我用这个命令行得到了这个未定义的符号构建:

$ gcc test.cpp
Undefined symbols:
  "___gxx_personality_v0", referenced from:
  etc...
Run Code Online (Sandbox Code Playgroud)

test.cpp很简单,应该很好.这笔交易是什么?

c c++ gcc g++

51
推荐指数
2
解决办法
3万
查看次数

对std :: ios_base :: Init :: Init()的未定义引用

我正在研究用C++学习OOP并遇到问题.我确定它是一个内存分配问题,但似乎无法理解它.任何帮助将不胜感激.

我的客户代码

    #include <iostream>
    #include "Box.cpp"

    using namespace std;

    int main(){
        Box *box = new Box;
        return 0;
    }
Run Code Online (Sandbox Code Playgroud)

我的盒子类......

    #include <iostream>

    using namespace std;

    class Box{

        private:
            double width;
            double height;
            double perimeter;
            double area;


        public:
            Box(){
                cout << "Box created" << endl;
            }

            ~Box(){
                cout << "Box Destroyed" << endl;
            }

            double getWidth(){
                //
                return this->width;
            }

            double getHeight(){
                //
                return this->height;
            }

            double getArea(){
                //
                return this->area;
            }

            double getPerimeter(){
                //
                return this->perimeter;
            }

            void setWidth(double w){ …
Run Code Online (Sandbox Code Playgroud)

c++ linker-errors

6
推荐指数
1
解决办法
1万
查看次数

如何解决错误java.io.IOException:串行通信的nativeavailable输入/输出错误?

我有Arm处理器,它是AllWinner A13,RAM-512mb和OS-Linaro 13.01 Ubuntu(意思是debian).现在我正在为/ dev/ttyS0制作串行通信程序.我使用netbeans在java中为双向串行通信制作了简单的程序.在我的处理器中,我将ttyS0的rx-tx缩短为环回连接检查.意味着我通过串口发送的东西,我回来了.但我得到错误.我在我的处理器上安装了openjdk-7,librxtx-java.我的代码和错误如下.如果有任何想法或解决方案,请告诉我.

package serialcomm_linaro;


import gnu.io.CommPort;
import gnu.io.CommPortIdentifier;
import gnu.io.SerialPort;

import java.io.FileDescriptor;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class TwoWaySerialComm
{
    public TwoWaySerialComm()
    {
        super();
    }

    void connect ( String portName ) throws Exception
    {
        CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName);
        if ( portIdentifier.isCurrentlyOwned() )
        {
            System.out.println("Error: Port is currently in use");
        }
        else
        {
            CommPort commPort = portIdentifier.open(this.getClass().getName(),2000);

            if ( commPort instanceof SerialPort )
            {
                SerialPort serialPort = (SerialPort) commPort;
                serialPort.setSerialPortParams(115200,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);

                InputStream in = serialPort.getInputStream();
                OutputStream out …
Run Code Online (Sandbox Code Playgroud)

java rxtx serial-communication

4
推荐指数
1
解决办法
2万
查看次数

空指针对象问题

嗨,有人可以告诉为什么在Linux和Windows中出现同样的问题:

#include <iostream>
using namespace std;

class A
{
private:
   int _dmember;

public:
   void func()
   {
     cout<<"Inside A!! "<<endl;
     cout<<_dmember; // crash when reach here.
   }
};

int main ()

{

    A* a= NULL;

    a->func(); // prints "Inside A!!!" 

    return 1;
}
Run Code Online (Sandbox Code Playgroud)

有人能说出为什么会发生这种奇怪的事情吗?我的意思是,a-> func()不应该进入func(),...?这是不了解的行为,

为什么上面的behivor会发生?

编辑:当然,*= null是故意的!! 所以对于所有回答"这是未定义的行为"或"你永远不应该尝试在NULL指针上调用函数!!"的人来说,来吧....这就是重点.有些人正确解释了这种行为.

c++

1
推荐指数
2
解决办法
2096
查看次数

标签 统计

c++ ×3

c ×1

g++ ×1

gcc ×1

java ×1

linker-errors ×1

rxtx ×1

serial-communication ×1