日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

(已解决)报错:collect2 error ld returned 1 exit status

發布時間:2023/12/18 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 (已解决)报错:collect2 error ld returned 1 exit status 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

最近在VSCode上跑C++代碼,當編譯的時候出現了題目中的問題,在CSDN上搜到的解決方案可謂是“天下一大抄”,這抄那里,那抄這里,全都一樣,而且沒有解釋明白這個報錯是什么意思,光說了一些出現該提醒可能的原因(且提到的原因我感覺驢唇不對馬嘴)。所以逼得我去科學上網,用Google搜索了一下,結果第一個回答就解決了疑惑。下面分享給沒法科學上網的朋友們。

簡單來說,collect2 error ld returned 1 exit status提示出現之前,一般在上面幾行都會有其他報錯,而collect2 error ld returned 1 exit status所反映的只是其之前一共出現了多少個錯誤,真正的錯誤是在其上面出現的那些報錯。比如,沒有錯誤,會提示collect2 error ld returned 0 exit status;有兩個報錯,會提示collect2 error ld returned 2 exit status。所以,真正要解決的是在collect2 error ld returned 1 exit status提示出現之前的那些報錯提醒。

以下是Google回答的原文:

The?ld returned 1 exit status?error is the consequence of your previous errors as in your example there is an earlier error - undefined reference to 'clrscr'?- and this is the real one. The exit status error just signals that the linking step in the build process encountered some errors. Normally?exit status 0?means success, and?exit status?> 0?means errors. Various tools may be running while creating a program as separate steps to create the final executable. In your case one of those tools is ld, which first reports the error it found (clrscr reference missing), and then it returns the exit status. Since the exit status is?> 0, it means an error and is reported.

In many cases tools return as the exit status the number of errors they encountered. So if the old tool finds two errors, its exit status would be 2.

原回答的鏈接:(需科學上網)What does collect2 error ld returned 1 exit status mean | Edureka Community

總結

以上是生活随笔為你收集整理的(已解决)报错:collect2 error ld returned 1 exit status的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。