我正在做一个使用 ELF 文件的项目。现在我使用以下作为示例输入 -
class C {
public:
C();
C(int x, int y);
int getX();
private:
int x;
int y;
};
class SubC : public C {
int z;
};
int f() {return 0;}
C c;
SubC subC;
int i;
double d;
然后我跑
gcc test.cpp -g -c -o test.o
我得到了 test.o 的预期。然后我将 test.o 输入我发现的一个名为peter-dwarf的库中。我的问题是库说“在 test.o 中没有找到 .debug_str 部分”
我在编译过程中做错了吗?还是图书馆不工作?
编辑:应该是 -g 在那里