久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

“找不到架構 x86_64 的符號";在 QtCreator 項目

quot;Symbol(s) not found for architecture x86_64quot; on QtCreator project(“找不到架構 x86_64 的符號;在 QtCreator 項目中)
本文介紹了“找不到架構 x86_64 的符號";在 QtCreator 項目中的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我收到錯誤

Symbol(s) not found for architecture x86_64

嘗試在 QtCreator 上編譯項目.當我嘗試創建用戶定義的類 Layer 的實例時會發生這種情況.該類由標題 layer.h 和實現 layer.cpp 組成.它已經過測試并在另一個程序中工作.在我的項目中,它包含在 qtwidget.h 中,當我嘗試在 qtwidget.cpp 上使用它時會發生錯誤.例如:

Trying to compile a project on QtCreator. It happens when I try to create an instance of an user defined class, Layer. That class consists of a header, layer.h, and a implementation, layer.cpp. It was tested and works in another programs. On my project, it is included in qtwidget.h and the error happens when I try to use it on qtwidget.cpp. For example:

Layer<double> text("pq.txt",0.5,0.5,0.5);

qtwidget.cpp 上添加這一行足以顯示錯誤.

Having this line on qtwidget.cpp is enough for the error to show up.

這是一個非常普遍的錯誤,我對如何進一步隔離它一無所知,但如果有幫助,我已將整個項目包含在 這個git repo.

This is such a generic error that I'm clueless on how to isolate it any further, but if it helps, I've included the whole project on this git repo.

推薦答案

在我看來,Qt Creator 顯示的錯誤信息在你理解之前是相當具有誤導性的,但并不能阻止將模板類拆分為頭文件和實現文件.如果您考慮一下消息:

In my opinion, the error message that Qt Creator displays is quite misleading until you understand it, but does not prevent splitting the template class into a header and implementation file. If you think about the message:

Symbol(s) not found for architecture x86_64

問題,當我看到這個時,我最初認為,是它在問題輸出中自己說明了這個錯誤,并可能導致用戶認為問題是由架構引起的.實際上,它的全部意思是有一個已定義的符號(通常是函數),但找不到匹配的實現.

the problem, I originally thought when I saw this, is that it states this error on its own in the Issues output and can lead the user into thinking that the problem is due to the architecture. Actually, all its saying is that there's a defined symbol (often function) whose matching implementation wasn't found.

如果您從 Issues 切換到 Compile Output 窗口并向上滾動,您將能夠準確地看到哪些符號找不到;我的顯示為紅色.令人討厭的是,問題 視圖中沒有顯示缺失符號的詳細信息.

If you change from Issues to the Compile Output window and scroll up, you'll be able to see exactly what symbols can't be found; mine's displayed in red. It's just annoying that the detail of the missing symbol(s) doesn't show up in the Issues view.

只需將函數定義添加到標頭中即可輕松復制此錯誤,而無需實現該函數,而是從 .cpp 文件中調用它.然后,您將在問題"窗口中看到類似的內容

It's easy to replicate this error by just adding a function definition into a header and without implementing the function, call it from the .cpp file. You'll then see something like this in the Issues window

切換到編譯輸出視圖并向上滾動顯示:-

Switching to the Compile Output view and scrolling up displays this: -

所以現在我們看到實際的問題是調用 PGGui 的類中的函數 DoSomeStuff 是從構造函數 PGGui::PGGui 中調用的,但是缺少 DoSomeStuff 的主體,因為沒有找到它的符號.

So now we see that tthe actual problem is that the function DoSomeStuff in the class called PGGui is being called from the constructor PGGui::PGGui, but the body of DoSomeStuff is missing, as its symbol is not found.

這篇關于“找不到架構 x86_64 的符號";在 QtCreator 項目中的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How can I read and manipulate CSV file data in C++?(如何在 C++ 中讀取和操作 CSV 文件數據?)
In C++ why can#39;t I write a for() loop like this: for( int i = 1, double i2 = 0; (在 C++ 中,為什么我不能像這樣編寫 for() 循環: for( int i = 1, double i2 = 0;)
How does OpenMP handle nested loops?(OpenMP 如何處理嵌套循環?)
Reusing thread in loop c++(在循環 C++ 中重用線程)
Precise thread sleep needed. Max 1ms error(需要精確的線程睡眠.最大 1ms 誤差)
Is there ever a need for a quot;do {...} while ( )quot; loop?(是否需要“do {...} while ()?環形?)
主站蜘蛛池模板: 91麻豆精品国产91久久久久久 | 三级视频国产 | 国产高清免费 | 视频一区在线观看 | 日韩欧美国产精品 | 美女黄色在线观看 | 亚洲精品一区二区三区中文字幕 | 国产综合久久 | 国产精品av久久久久久毛片 | 免费av电影网站 | 精品国偷自产在线 | 男人天堂国产 | 国产乱码精品1区2区3区 | 欧美日韩亚洲视频 | 国产盗摄视频 | 欧美视频免费在线 | 欧美极品在线播放 | 日韩在线播放一区 | 99久久精品国产一区二区三区 | 亚洲视频一区二区三区 | 久久伊人影院 | 羞羞视频在线观看免费观看 | 日本精品视频在线 | 久久在线免费 | 亚洲视频第一页 | 日韩成人精品在线观看 | 欧美日韩在线播放 | 国产精品视频一二三区 | 自拍视频网站 | 999热精品视频 | 日本在线视频不卡 | 免费在线观看毛片 | 一区二区精品 | 97日韩精品 | 国产资源在线观看 | 91精品国产综合久久婷婷香蕉 | 亚洲电影成人 | 草草视频在线免费观看 | 狠狠干五月天 | 国产yw851.c免费观看网站 | 韩国av网站在线观看 |