jurplel / install-qt-action

Install Qt on your Github Actions workflows with just one simple action
MIT License
461 stars 79 forks source link

Windows build issue "redeclared without dllimport attribute: previous dllimport ignored" and "undefined reference to '__imp___argc'" #253

Open AlbrechtL opened 2 weeks ago

AlbrechtL commented 2 weeks ago

Hi,

Thanks for this great action! Currently I'm porting the project welle.io to GitHub Actions and I ran into an issue where I have no clue about it.

During the build I'm getting tons of redeclared without dllimport attribute: previous dllimport ignored warnings and than the linker fails with undefined reference to "__imp___argc". All my other builds e.g. GitHub Actions Linux as well as my local build Linux and Windows runs fine. I'm using Qt 6.7.2 and qmake. and mingw32-make

Did I miss something?

Build warning

D:/a/welle.io/Qt/6.7.2/mingw_64/include/QtGui/qpen.h:87:38: warning: 'QDataStream& operator<<(QDataStream&, const QPen&)' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
   87 |     friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPen &);
      |                                      ^~~~~~~~

Linker error

C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/a/welle.io/Qt/6.7.2/mingw_64/lib/libQt6EntryPoint.a(qtentrypoint_win.cpp.obj):qtentrypoint_win.cpp:(.rdata$.refptr.__imp___argc[.refptr.__imp___argc]+0x0): undefined reference to `__imp___argc'
collect2.exe: error: ld returned 1 exit status

GitHub Actions file https://github.com/AlbrechtL/welle.io/blob/a4a7e8b0fc3f911ed85904904f3de7b7bee81c54/.github/workflows/windows.yml

      - name: Install Qt
        uses: jurplel/install-qt-action@v4
        with:
          version: '6.7.2'
          modules: 'qtcharts qtmultimedia qt5compat'
          arch: 'win64_mingw'

Environment variables

ACTIONS_RUNNER_ACTION_ARCHIVE… C:\actionarchivecache\
ALLUSERSPROFILE                C:\ProgramData
ANDROID_HOME                   C:\Android\android-sdk
ANDROID_NDK                    C:\Android\android-sdk\ndk\27.0.12077973
ANDROID_NDK_HOME               C:\Android\android-sdk\ndk\27.0.12077973
ANDROID_NDK_LATEST_HOME        C:\Android\android-sdk\ndk\27.0.12077973
ANDROID_NDK_ROOT               C:\Android\android-sdk\ndk\27.0.12077973
ANDROID_SDK_ROOT               C:\Android\android-sdk
ANT_HOME                       C:\ProgramData\chocolatey\lib\ant\tools\apache-ant-1.10.14
APPDATA                        C:\Users\runneradmin\AppData\Roaming
AZ_DEVOPS_GLOBAL_CONFIG_DIR    C:\azureDevOpsCli
AZURE_CONFIG_DIR               C:\azureCli
AZURE_DEVOPS_CACHE_DIR         C:\azureDevOpsCli\cache
AZURE_EXTENSION_DIR            C:\Program Files\Common Files\AzureCliExtensionDirectory
CABAL_DIR                      C:\cabal
ChocolateyInstall              C:\ProgramData\chocolatey
ChromeWebDriver                C:\SeleniumWebDrivers\ChromeDriver
CI                             true
COBERTURA_HOME                 C:\cobertura-2.1.1
CommonProgramFiles             C:\Program Files\Common Files
CommonProgramFiles(x86)        C:\Program Files (x86)\Common Files
CommonProgramW6432             C:\Program Files\Common Files
COMPUTERNAME                   fv-az521-583
ComSpec                        C:\Windows\system32\cmd.exe
CONDA                          C:\Miniconda
current_date                   20240831
DEPLOYMENT_BASEPATH            C:\actions
DOTNET_MULTILEVEL_LOOKUP       0
DOTNET_NOLOGO                  1
DOTNET_SKIP_FIRST_TIME_EXPERI… 1
DriverData                     C:\Windows\System32\Drivers\DriverData
EdgeWebDriver                  C:\SeleniumWebDrivers\EdgeDriver
file_version                   20240831_a4a7e8b0
GCM_INTERACTIVE                Never
GeckoWebDriver                 C:\SeleniumWebDrivers\GeckoDriver
GHCUP_INSTALL_BASE_PREFIX      C:\
GHCUP_MSYS2                    C:\msys64
git_hash                       a4a7e8b0
GITHUB_ACTION                  __run_3
GITHUB_ACTION_REF              
GITHUB_ACTION_REPOSITORY       
GITHUB_ACTIONS                 true
GITHUB_ACTOR                   AlbrechtL
GITHUB_ACTOR_ID                11171787
GITHUB_API_URL                 https://api.github.com/
GITHUB_BASE_REF                
GITHUB_ENV                     D:\a\_temp\_runner_file_commands\set_env_ea799f74-9fc7-446b-a1dd-ddea2ea01f4c
GITHUB_EVENT_NAME              push
GITHUB_EVENT_PATH              D:\a\_temp\_github_workflow\event.json
GITHUB_GRAPHQL_URL             https://api.github.com/graphql
GITHUB_HEAD_REF                
GITHUB_JOB                     qtbuild
GITHUB_OUTPUT                  D:\a\_temp\_runner_file_commands\set_output_ea799f74-9fc7-446b-a1dd-ddea2ea01f4c
GITHUB_PATH                    D:\a\_temp\_runner_file_commands\add_path_ea799f74-9fc7-446b-a1dd-ddea2ea01f4c
GITHUB_REF                     refs/heads/next
GITHUB_REF_NAME                next
GITHUB_REF_PROTECTED           true
GITHUB_REF_TYPE                branch
GITHUB_REPOSITORY              AlbrechtL/welle.io
GITHUB_REPOSITORY_ID           49383207
GITHUB_REPOSITORY_OWNER        AlbrechtL
GITHUB_REPOSITORY_OWNER_ID     11171787
GITHUB_RETENTION_DAYS          90
GITHUB_RUN_ATTEMPT             1
GITHUB_RUN_ID                  10648541738
GITHUB_RUN_NUMBER              21
GITHUB_SERVER_URL              https://github.com/
GITHUB_SHA                     a4a7e8b0fc3f911ed85904904f3de7b7bee81c54
GITHUB_STATE                   D:\a\_temp\_runner_file_commands\save_state_ea799f74-9fc7-446b-a1dd-ddea2ea01f4c
GITHUB_STEP_SUMMARY            D:\a\_temp\_runner_file_commands\step_summary_ea799f74-9fc7-446b-a1dd-ddea2ea01f4c
GITHUB_TRIGGERING_ACTOR        AlbrechtL
GITHUB_WORKFLOW                Windows build
GITHUB_WORKFLOW_REF            AlbrechtL/welle.io/.github/workflows/windows.yml@refs/heads/next
GITHUB_WORKFLOW_SHA            a4a7e8b0fc3f911ed85904904f3de7b7bee81c54
GITHUB_WORKSPACE               D:\a\welle.io\welle.io
GOROOT_1_20_X64                C:\hostedtoolcache\windows\go\1.20.14\x64
GOROOT_1_21_X64                C:\hostedtoolcache\windows\go\1.21.13\x64
GOROOT_1_22_X64                C:\hostedtoolcache\windows\go\1.22.6\x64
GRADLE_HOME                    C:\ProgramData\chocolatey\lib\gradle\tools\gradle-8.10
HOMEDRIVE                      C:
HOMEPATH                       \Users\runneradmin
IEWebDriver                    C:\SeleniumWebDrivers\IEDriver
ImageOS                        win22
ImageVersion                   20240825.1.0
JAVA_HOME                      C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.422-5\x64
JAVA_HOME_11_X64               C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\11.0.24-8\x64
JAVA_HOME_17_X64               C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\17.0.12-7\x64
JAVA_HOME_21_X64               C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\21.0.4-7.0\x64
JAVA_HOME_8_X64                C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.422-5\x64
LOCALAPPDATA                   C:\Users\runneradmin\AppData\Local
LOGONSERVER                    \\fv-az521-583
M2                             C:\ProgramData\chocolatey\lib\maven\apache-maven-3.8.7\bin
M2_REPO                        C:\ProgramData\m2
MAVEN_OPTS                     -Xms256m
MonAgentClientLocation         C:\Packages\Plugins\Microsoft.Azure.Geneva.GenevaMonitoring\2.44.0.5\Monitoring\Agent
npm_config_prefix              C:\npm\prefix
NUMBER_OF_PROCESSORS           4
OS                             Windows_NT
Path                           C:\Program Files\PowerShell\7;D:\a\welle.io\Qt\6.7.2\mingw_64\bin;C:\Users\runneradmin\…
PATHEXT                        .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL
PERFLOG_LOCATION_SETTING       RUNNER_PERFLOG
PGBIN                          C:\Program Files\PostgreSQL\14\bin
PGDATA                         C:\Program Files\PostgreSQL\14\data
PGPASSWORD                     root
PGROOT                         C:\Program Files\PostgreSQL\14
PGUSER                         postgres
PHPROOT                        c:\tools\php
PIPX_BIN_DIR                   C:\Program Files (x86)\pipx_bin
PIPX_HOME                      C:\Program Files (x86)\pipx
PKG_CONFIG_PATH                C:\hostedtoolcache\windows\Python\3.11.9\x64/lib/pkgconfig
POWERSHELL_DISTRIBUTION_CHANN… GitHub-Actions-win22
POWERSHELL_UPDATECHECK         Off
PROCESSOR_ARCHITECTURE         AMD64
PROCESSOR_IDENTIFIER           AMD64 Family 25 Model 1 Stepping 1, AuthenticAMD
PROCESSOR_LEVEL                25
PROCESSOR_REVISION             0101
ProgramData                    C:\ProgramData
ProgramFiles                   C:\Program Files
ProgramFiles(x86)              C:\Program Files (x86)
ProgramW6432                   C:\Program Files
PSModuleAnalysisCachePath      C:\PSModuleAnalysisCachePath\ModuleAnalysisCache
PSModulePath                   C:\Users\runneradmin\Documents\PowerShell\Modules;C:\Program Files\PowerShell\Modules;c…
PUBLIC                         C:\Users\Public
Python_ROOT_DIR                C:\hostedtoolcache\windows\Python\3.11.9\x64
Python2_ROOT_DIR               C:\hostedtoolcache\windows\Python\3.11.9\x64
Python3_ROOT_DIR               C:\hostedtoolcache\windows\Python\3.11.9\x64
pythonLocation                 C:\hostedtoolcache\windows\Python\3.11.9\x64
QML2_IMPORT_PATH               D:\a\welle.io\Qt\6.7.2\mingw_64\qml
QT_PLUGIN_PATH                 D:\a\welle.io\Qt\6.7.2\mingw_64\plugins
QT_ROOT_DIR                    D:\a\welle.io\Qt\6.7.2\mingw_64
RTOOLS44_HOME                  C:\rtools44
RUNNER_ARCH                    X64
RUNNER_ENVIRONMENT             github-hosted
RUNNER_NAME                    GitHub Actions 5
RUNNER_OS                      Windows
RUNNER_PERFLOG                 C:\actions\perflog
RUNNER_TEMP                    D:\a\_temp
RUNNER_TOOL_CACHE              C:\hostedtoolcache\windows
RUNNER_TRACKING_ID             github_5f5d02ba-b1fe-42ae-8201-128bed001a64
RUNNER_WORKSPACE               D:\a\welle.io
SBT_HOME                       C:\Program Files (x86)\sbt\
SELENIUM_JAR_PATH              C:\selenium\selenium-server.jar
STATS_BLT                      true
STATS_D                        true
STATS_D_D                      true
STATS_EXT                      true
STATS_EXTP                     [https://provjobdsettingscdn.blob.core.windows.net/settings/provjobdsettings-0.5.181+6/p…](https://provjobdsettingscdn.blob.core.windows.net/settings/provjobdsettings-0.5.181+6/p%E2%80%A6)
STATS_RDCL                     true
STATS_TRP                      true
STATS_UE                       true
STATS_V3PS                     true
STATS_VMD                      true
STATS_VMFE                     true
SystemDrive                    C:
SystemRoot                     C:\Windows
TEMP                           C:\Users\RUNNER~1\AppData\Local\Temp
TMP                            C:\Users\RUNNER~1\AppData\Local\Temp
USERDOMAIN                     fv-az521-583
USERDOMAIN_ROAMINGPROFILE      fv-az521-583
USERNAME                       runneradmin
USERPROFILE                    C:\Users\runneradmin
VCPKG_INSTALLATION_ROOT        C:\vcpkg
windir                         C:\Windows
WIX                            C:\Program Files (x86)\WiX Toolset v3.14\
pzhlkj6612 commented 2 weeks ago

Hi.

I didn't dig into this issue but would like to throw out some guesses.

All my other builds e.g. GitHub Actions Linux as well as my local build Linux and Windows runs fine. I'm using Qt 6.7.2 and qmake. and mingw32-make

  • name: Install Qt uses: jurplel/install-qt-action@v4 with: version: '6.7.2' modules: 'qtcharts qtmultimedia qt5compat' arch: 'win64_mingw'

Were you using the GitHub-shipped compiler and linker, right? Please install the Qt-provided toolchain by the tools option and try building the program again. Don't forget check if the compiler and linker are the ones you installed.

All my other builds e.g. GitHub Actions Linux as well as my local build Linux and Windows runs fine.

Interesting. Please paste a screenshot of the "Select Components" dialog in the "Qt Maintenance Tool". Like this: https://forum.qt.io/topic/102029/cannot-find-missing-dependency-using-qt-maintenance-tool-on-macos-10-13

.

AlbrechtL commented 2 weeks ago

Were you using the GitHub-shipped compiler and linker, right?

Right.

Please install the Qt-provided toolchain by the tools option and try building the program again. Don't forget check if the compiler and linker are the ones you installed.

Which tools do you mean? There are multiple tools existing.

Interesting. Please paste a screenshot of the "Select Components" dialog in the "Qt Maintenance Tool".

grafik

AlbrechtL commented 2 weeks ago

Update: After adding tools: 'tools_mingw90' to the yml file the build is working.

The corresponding section is looking as follows.

      - name: Install Qt
        uses: jurplel/install-qt-action@v4
        with:
          version: '6.7.2'
          modules: 'qtcharts qtmultimedia qt5compat'
          arch: 'win64_mingw'
          tools: 'tools_mingw90'

@pzhlkj6612: Thanks for putting me on the right track! It is possible automatically add the correct MinGW tool set to the installation? The Qt Maintenance Tool is doing that.

pzhlkj6612 commented 1 week ago

Thanks for putting me on the right track!

You're welcome!

It is possible automatically add the correct MinGW tool set to the installation? The Qt Maintenance Tool is doing that.

I've created a feature request in aqtinstall since this action is a caller to that program. See https://github.com/miurahr/aqtinstall/issues/819.