簡體   English   中英

調用qdecimal庫函數

[英]Calling qdecimal Library function

我正在嘗試使用qdecimal庫 ,但無法調用任何公開的方法。 我已經成功構建了庫文件(libdecnumber.a),並將其及其包含文件添加到我項目的.pro文件中,並包含了自述文檔中示例1中概述的相關標頭。 我可以從庫中使用#defines和其他類型,但是對於任何函數調用,我總是會得到“未定義的引用”。

例如,

//these compile
#include "decNumber.h" // base number library 
decNumber a, b; // working numbers
decContext set; // working context

//this does not
decNumberFromString(&b, "test", &set); 

這是否表明庫未正確添加到項目中?還是其他?

如果您使用的是QtCreator,請在其中打開.pro文件並添加行

LIBS += -ldecnumber

您可以根據需要使用-L“ ...此處路徑...”來指定路徑

當前,您尚未將項目與庫鏈接。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM