第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

編譯一直通不過...

#include?<iostream>
#include?"Coordinate.h"
using?namespace?std;
class?Line
{
public:
Line();
~Line();
private:
Coordinate?*m_coorA;
Coordinate?*m_coorB;
};


Line::Line()
{
m_coorA?=?new?Coordinate(1,2);
m_coorB?=?new?Coordinate(3,4);
}??
Line::~Line()
{
}
int?main(void)
{
Line?*p;
p?=?new?Line();
delete?p;
p=NULL;
}

Coordinate那2個(gè)文件是一樣的,可以直接通過編譯的.但是,在編譯Line.cpp的時(shí)候報(bào)錯(cuò).

系統(tǒng)1:

Undefined symbols for architecture x86_64:

"Coordinate::Coordinate(int, int)", referenced from:

? ? ? Line::Line() in Line-6b7c1a.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

[Finished in 0.4s with exit code 1]


系統(tǒng)2:

/tmp/cc2zKqau.o: In function `Line::Line()':

Line.cpp:(.text+0x2a): undefined reference to `Coordinate::Coordinate(int, int)'

Line.cpp:(.text+0x50): undefined reference to `Coordinate::Coordinate(int, int)'

collect2: error: ld returned 1 exit status




正在回答

1 回答

原來是編譯器沒配置好.只能編譯單文件.忽略.

1 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
C++遠(yuǎn)征之封裝篇(下)
  • 參與學(xué)習(xí)       70903    人
  • 解答問題       531    個(gè)

封裝--面向?qū)ο笕筇卣髦?,通過案例讓C++所學(xué)知識(shí)融會(huì)貫通

進(jìn)入課程

編譯一直通不過...

我要回答 關(guān)注問題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)