【QtCreator】QtCretor多個專案管理,動態庫,靜態庫。
阿新 • • 發佈:2018-11-08
參考連結:
1、https://blog.csdn.net/libaineu2004/article/details/23625441
2、https://www.cnblogs.com/codingmengmeng/p/7456539.html
(注:本人測試在Ubuntu18.04 LST系統下面)
本人測試原始碼連結:https://github.com/XiaoGongWei/Ubuntu16.04-llaptop-Code/tree/master/C_C++_Code
需要下載MultiyPro.zip,解壓出來用QtCreator開啟.pro
如何建立多個專案
如何使用QtCretor建立多個專案可以參考連結1.
首先看完流程,然後使用連結1最後一部分建立方法比較方便。
如何在QtCreator下面Debug
在QtCreator下面編譯是沒有問題,但是在UBuntu下面除錯的動態庫目錄是/lib或者/usr/lib。因此需要將生成的bin下面的".so .so.1.0.0"拷貝到/lib或者/usr/lib
或者按照連結2將/usr/local/lib加入動態庫目錄,然後sudo ldconfig
。就可以在QtCreator下面Debug啦。
#c++ ifndef _WIN32 #define SHARELIBSHARED_EXPORT __attribute__((visibility("default"))) #define SHARELIBSHARED_IMPORT __attribute__((visibility("default"))) #define SHARELIBSHARED_HIDDEN __attribute__((visibility("hidden"))) #elif #define SHARELIBSHARED_EXPORT __declspec(dllexport) #define SHARELIBSHARED_IMPORT __declspec(dllimport) #endif