Qt5 6在vs2013中匯出Dll

2021-08-14 10:01:19 字數 1252 閱讀 4816

新建工程,選擇qt class library,此項可以匯出類也可以匯出函式:

新建之後,在新建乙個test專案用來呼叫dll:

在hellodll的標頭檔案中增加乙個類成員函式和全域性函式

hellodll.h

#pragma once

#include "hellodll_global.h"

class hellodll_export hellodll

;int hellodll_export dllfunc();

hellodll.cpp

#include "hellodll.h"

#include hellodll::hellodll()

void hellodll::dllclass()

int dllfunc()

在test的介面中增加兩個按鈕,分別測試類成員函式和全域性函式

測試專案標頭檔案:

test.h

#pragma once

#include #include "ui_test.h"

class test : public qmainwindow

;

test.cpp

#include "test.h"

#include "../hellodll/hellodll.h"

test::test(qwidget *parent)

: qmainwindow(parent)

void test::testdllclass()

void test::testdllfunc()

測試效果圖

在VS2013中除錯mex檔案

1.有了包含mexfunction的cpp或c還不夠,還需要建立乙個工程,這裡是新建乙個dll vs 新建 win32專案 dll。2.由於是64位機,所以需要把project設定成x64 debug,檢視 屬性管理器 雙擊project 配置管理器 平台 選擇x64 3.由於mex functio...

在vs2013中引用boost庫

關於boost的盛名我就不多費口舌了,它是乙個經過千錘百鍊 可移植 提供源 的c 庫,作為標準庫的後備,是c 標準化程序的發動機之一。boost庫由c 標準委員會庫工作組成員發起,其中有些內容有望成為下一代c 標準庫內容。在c 社群中影響甚大,其成員已經有好幾千人了。boost庫為我們帶來了最新 最...

OPencv在VS2013中的配置

3 提取完成後,即完成了opencv的安裝 二 設定opencv環境變數 1 開啟計算機的屬性頁,高階系統設定 環境變數 計算機名 的使用者變數 新建 1 變數名 opencv 變數值 opencv的資料夾路徑 opencv build 2 變數名 path 一般已經存在 變數值 opencv的資料...