Qt5使用第三方庫(GSL2.5) ~ QT5_Use_GSL

Qt5使用第三方庫(GSL2.5) ~ QT5_Use_GSL

Qt5使用第三方庫(GSL2.5) ~ QT5_Use_GSL


資料來源:https://blog.csdn.net/ouening/article/details/100102331

https://www.youtube.com/watch?v=AoEb6QRn8QY


WINDOWS下的LIMUX命令工具列(包含ldd 可偵測X64):

https://blog.miniasp.com/post/2015/09/27/Useful-tool-Cmder
https://cmder.net/


GITHUB: https://github.com/jash-git/QT5_Use_GSL


★將第三方函示庫(函數庫/函式庫)引用(整合)到QT專案之中


Code:

#gsl.pri
#相關檔案來源:C:\Qt\Qt5.12.11\Tools\mingw730_64\msys\local
# 宏定义项,指明采用GSL
DEFINES += GSL_DLL

# 指明GSL库所对应的头文件所在目录
INCLUDEPATH += $$PWD/include

# 指明依赖库关系
LIBS += -L$$PWD/lib -lgsl
LIBS += -L$$PWD/lib -lgslcblas

#QT5_Use_GSL.pro

QT -= gui

include($$PWD/gsl/gsl.pri)

CONFIG += c++11 console
CONFIG -= app_bundle

# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

SOURCES += \
        main.cpp

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

//main.cpp
#include <QCoreApplication>
#include <QDebug>
#include <gsl/gsl_sf_bessel.h>
#include <stdio.h>

void Pause()
{
    printf("Press Enter key to continue ...");
    fgetc(stdin);
}
int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    double x = 5.0;
    double y = gsl_sf_bessel_J0 (x);
    printf ("J0(%g) = %.18e\n", x, y);
    //qDebug()<< "J0(%g) = %.18e\n", x, y;
    Pause();
    return 0;//return a.exec();
}


結果圖:

2 thoughts on “Qt5使用第三方庫(GSL2.5) ~ QT5_Use_GSL

  1. WINDOWS下的LIMUX命令工具列(包含ldd 可偵測X64) ~ 實際應用[ 查詢EasyPODx64.dll 相依 ]

    C:\Users\jashliao\Desktop\cmder_mini
    λ cd C:\Users\jashliao\Desktop\x64

    C:\Users\jashliao\Desktop\x64
    λ ldd EasyPODx64.dll
    ntdll.dll => /c/WINDOWS/SYSTEM32/ntdll.dll (0x7ff999cd0000)
    KERNEL32.DLL => /c/WINDOWS/System32/KERNEL32.DLL (0x7ff9991b0000)
    KERNELBASE.dll => /c/WINDOWS/System32/KERNELBASE.dll (0x7ff997580000)
    ConEmuHk64.dll => /c/Users/jashliao/Desktop/cmder_mini/vendor/conemu-maximus5/ConEmu/ConEmuHk64.dll (0x7e1100000000)
    USER32.dll => /c/WINDOWS/System32/USER32.dll (0x7ff998a80000)
    win32u.dll => /c/WINDOWS/System32/win32u.dll (0x7ff997550000)
    GDI32.dll => /c/WINDOWS/System32/GDI32.dll (0x7ff999700000)
    gdi32full.dll => /c/WINDOWS/System32/gdi32full.dll (0x7ff997bc0000)
    msvcp_win.dll => /c/WINDOWS/System32/msvcp_win.dll (0x7ff997850000)
    ucrtbase.dll => /c/WINDOWS/System32/ucrtbase.dll (0x7ff997400000)
    IMM32.DLL => /c/WINDOWS/System32/IMM32.DLL (0x7ff9995a0000)
    ADVAPI32.dll => /c/WINDOWS/System32/ADVAPI32.dll (0x7ff9994f0000)
    msvcrt.dll => /c/WINDOWS/System32/msvcrt.dll (0x7ff999ac0000)
    sechost.dll => /c/WINDOWS/System32/sechost.dll (0x7ff998c20000)
    RPCRT4.dll => /c/WINDOWS/System32/RPCRT4.dll (0x7ff9995d0000)
    SETUPAPI.dll => /c/WINDOWS/System32/SETUPAPI.dll (0x7ff997d30000)
    MSVCR100.dll => /c/WINDOWS/SYSTEM32/MSVCR100.dll (0x51b20000)
    cfgmgr32.dll => /c/WINDOWS/System32/cfgmgr32.dll (0x610000)
    cfgmgr32.dll => /c/WINDOWS/System32/cfgmgr32.dll (0x610000)
    bcrypt.dll => /c/WINDOWS/System32/bcrypt.dll (0x7ff997a30000)
    HID.DLL => /c/WINDOWS/SYSTEM32/HID.DLL (0x7ff995ca0000)
    mfc100.dll => /c/WINDOWS/SYSTEM32/mfc100.dll (0x515c0000)
    SHLWAPI.dll => /c/WINDOWS/System32/SHLWAPI.dll (0x7ff9981b0000)
    MSIMG32.dll => /c/WINDOWS/SYSTEM32/MSIMG32.dll (0x7ff98c160000)
    COMCTL32.dll => /c/WINDOWS/WinSxS/amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.19041.1110_none_792d1c772443f647/COMCTL32.dll (0x7ff98c350000)
    cfgmgr32.dll => /c/WINDOWS/System32/cfgmgr32.dll (0x610000)
    UxTheme.dll => /c/WINDOWS/SYSTEM32/UxTheme.dll (0x7ff994b10000)
    combase.dll => /c/WINDOWS/System32/combase.dll (0x7ff999730000)
    dwmapi.dll => /c/WINDOWS/system32/dwmapi.dll (0x7ff995010000)
    MFC100CHT.DLL => /c/WINDOWS/SYSTEM32/MFC100CHT.DLL (0x5d360000)

    C:\Users\jashliao\Desktop\x64
    λ

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *