久久久久久久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 ()?環形?)
主站蜘蛛池模板: 成人小视频在线免费观看 | 人干人人 | 欧美高清视频一区 | 一区二区三区成人 | 国产在线一区二区 | 日韩在线大片 | av播播| 国产精品久久av | 亚洲欧洲色视频 | 国产区精品 | 99久久婷婷国产综合精品电影 | 九九伊人sl水蜜桃色推荐 | 色爱综合网 | 一级毛片免费看 | 嫩草视频在线看 | 97超碰人人 | 人人九九精 | 欧美精品久久久久 | 欧美视频偷拍 | 欧美日韩一区二区三区视频 | 国产精品国产精品 | 情侣av| 国产99视频精品免视看9 | 狠狠久 | 99re在线视频| 日韩插插 | 日韩电影一区 | 日韩成人精品视频 | 男人天堂视频在线观看 | 精品国产乱码久久久久久牛牛 | 日韩免费视频一区二区 | 国产精品自拍av | 日韩av在线播 | 亚洲精品一区二区三区在线 | a视频在线观看 | 九九综合九九 | 欧美一区二区在线视频 | 精久久久| 国产精品国产自产拍高清 | 日本在线中文 | 91精品久久|