jerous86 / nimqt

Qt bindings for nim
GNU General Public License v2.0
92 stars 6 forks source link

Compile Error #45

Open MelonCodeUK opened 1 week ago

MelonCodeUK commented 1 week ago

I get a compilation error when compiling examples from the examples folder: `C:\Users\user\nimqt\examples>nim cpp -r hello.nim Hint: used config file 'D:\nim-2.0.2\config\nim.cfg' [Conf] Hint: used config file 'D:\nim-2.0.2\config\config.nims' [Conf] ......................................................................................................................................... C:\Users\user.nimble\pkgs2\nimqt-0.2.1-42bba9ecc8116885df92ab959cd32493da332f07\nimqt.nim(377, 9) Hint: 'cpp_param_types0' is declared but not used [XDeclaredButNotUsed] ................................................................... C:\Users\user.nimble\pkgs2\nimqt-0.2.1-42bba9ecc8116885df92ab959cd32493da332f07\nimqt\qtgui\qimage.nim(135, 20) Hint: duplicate import of 'qstring'; previous import here: C:\Users\user.nimble\pkgs2\nimqt-0.2.1-42bba9ecc8116885df92ab959cd32493da332f07\nimqt\qtgui\qimage.nim(17, 20) [DuplicateModuleImport] ............................................. C:\Users\user.nimble\pkgs2\nimqt-0.2.1-42bba9ecc8116885df92ab959cd32493da332f07\nimqt.nim(43, 11) Hint: 'QtInstallLibs' is declared but not used [XDeclaredButNotUsed] .................... CC: D:/nim-2.0.2/lib/system/exceptions.nim CC: D:/nim-2.0.2/lib/std/private/digitsutils.nim CC: D:/nim-2.0.2/lib/std/assertions.nim CC: D:/nim-2.0.2/lib/system/dollars.nim g++.exe: error: unrecognized command-line option '-permissive'; did you mean '-fpermissive'? g++.exe: error: unrecognized command-line option '-permissive'; did you mean '-fpermissive'? g++.exe: error: unrecognized command-line option '-permissive'; did you mean '-fpermissive'? g++.exe: error: unrecognized command-line option '-Zc=__cplusplus' g++.exe: error: unrecognized command-line option '-permissive'; did you mean '-fpermissive'? Error: execution of an external compiler program 'g++.exe -c -std=gnu++17 -funsigned-char -w -fmax-errors=3 -fpermissive -mno-ms-bitfields -DWIN32_LEAN_AND_MEAN -std=c++17 -IC:\Users\user.nimble\pkgs2\nimqt-0.2.1-4 bba9eg++.exe:c 8116 885df92aerror: b 59cd3249unrecognized command-line option '3da 32f07-Zc=cplusplus -permi' ssive -Zc=cplusplus -std=c++17 -ID:/Qt/Tools/QtDesignStudio/qt6_design_studi _reduced_verg++.exe:si n/i ncl de -ID:/Qt/Tools/QtDesignStudio/qt6_design_studio_reducedversion/include\QtWidgets -ID:/Qt/Tools/QtDesignStudio/ terror: 6 esign_studio_reduced_version/include\QtGui -ID:/Qt/Tools/QtDesignStudio/qt6_design_studio_reduced_version/include\QtCore -ID:/Qt/Tools/QtDesignStudio/qt6_design_studio_reduced_version/include..\mkspecs\win32-msvc /Zc:strictStrings- shell32.libunrecognized command-line option 'g++.exe: -ID:\n-Zc=__cplusplus m 2.0.2\lib -IC:\Users\user\nimqt\examples -o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@ssystem@sexceptions.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@ssystem@sexceptions.nim.cpp' failed with exit code: 1

error: ' unrecognized command-line option ' -Zc=__cplusplus'`

nim-lang version: C:\Users\user\nimqt\examples>nim -v Nim Compiler Version 2.0.2 [Windows: amd64] Compiled at 2023-12-15 Copyright (c) 2006-2023 by Andreas Rumpf qmake version: C:\Users\user\nimqt\examples>qmake -v QMake version 3.1 Using Qt version 6.7.1 in D:/Qt/Tools/QtDesignStudio/qt6_design_studio_reduced_version/lib

g++ version: C:\Users\user\nimqt\examples>g++ --version g++ (MinGW-W64 x86_64-posix-seh, built by Brecht Sanders) 11.1.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

jerous86 commented 1 week ago

Hi MelonCodeUK,

thank you for reporting this.

I've never tested nimqt with MinGW. I barely touch windows systems these days at home.

To get it to compile, I would suggest removing the offending parameters from C:\Users\user.nimble\pkgs2\nimqt-0.2.1-42bba9ecc8116885df92ab959cd32493da332f07\nimqt.nim on line 44. If you send me back what works for you, I can update the code. (it would also be nice then if you had some code to detect if MinGW is being used)

MelonCodeUK commented 1 week ago

After an hour and deleting a couple of lines I got the result. I installed msys and installed mingw through it. it didn't change anything, then I decided to delete that 44 lines. oh yes! it worked! but then I got errors about not finding that file.h I solved it with --passC:“-I pathToHfile”. and it worked! the final command looks like this:

nim cpp -r --passC:"-ID:\Qt\Tools\QtDesignStudio\qt6_design_studio_reduced_version\include" --passL:"-LD:\Qt\Tools\QtDesignStudio\qt6_design_studio_reduced_version\lib" --passC:"-ID:\Qt\Tools\QtDesignStudio\qt6_design_studio_reduced_version\include\QtCore" hello.nim

here's the final error:

C:\Users\user\nimqt\examples>nim cpp -r --passC:"-ID:\Qt\Tools\QtDesignStudio\qt6_design_studio_reduced_version\include" --passL:"-LD:\Qt\Tools\QtDesignStudio\qt6_design_studio_reduced_version\lib" --passC:"-ID:\Qt\Tools\QtDesignStudio\qt6_design_studio_reduced_version\include\QtCore" hello.nim
Hint: used config file 'D:\nim-2.0.2\config\nim.cfg' [Conf]
Hint: used config file 'D:\nim-2.0.2\config\config.nims' [Conf]
.........................................................................................................................................
C:\Users\user\.nimble\pkgs2\nimqt-0.2.1-42bba9ecc8116885df92ab959cd32493da332f07\nimqt.nim(376, 9) Hint: 'cpp_param_types0' is declared but not used [XDeclaredButNotUsed]
...................................................................
C:\Users\user\.nimble\pkgs2\nimqt-0.2.1-42bba9ecc8116885df92ab959cd32493da332f07\nimqt\qtgui\qimage.nim(135, 20) Hint: duplicate import of 'qstring'; previous import here: C:\Users\user\.nimble\pkgs2\nimqt-0.2.1-42bba9ecc8116885df92ab959cd32493da332f07\nimqt\qtgui\qimage.nim(17, 20) [DuplicateModuleImport]
.............................................
C:\Users\user\.nimble\pkgs2\nimqt-0.2.1-42bba9ecc8116885df92ab959cd32493da332f07\nimqt.nim(42, 11) Hint: 'QtInstallHeaders' is declared but not used [XDeclaredButNotUsed]
C:\Users\user\.nimble\pkgs2\nimqt-0.2.1-42bba9ecc8116885df92ab959cd32493da332f07\nimqt.nim(43, 11) Hint: 'QtInstallLibs' is declared but not used [XDeclaredButNotUsed]
....................
CC: D:/nim-2.0.2/lib/system/exceptions.nim
CC: D:/nim-2.0.2/lib/std/private/digitsutils.nim
CC: D:/nim-2.0.2/lib/std/assertions.nim
CC: D:/nim-2.0.2/lib/system/dollars.nim
CC: D:/nim-2.0.2/lib/std/widestrs.nim
CC: D:/nim-2.0.2/lib/std/exitprocs.nim
CC: D:/nim-2.0.2/lib/std/syncio.nim
CC: D:/nim-2.0.2/lib/system.nim
CC: D:/nim-2.0.2/lib/pure/parseutils.nim
CC: D:/nim-2.0.2/lib/pure/math.nim
CC: D:/nim-2.0.2/lib/pure/unicode.nim
CC: D:/nim-2.0.2/lib/pure/strutils.nim
CC: D:/nim-2.0.2/lib/std/private/ntpath.nim
CC: D:/nim-2.0.2/lib/pure/pathnorm.nim
CC: D:/nim-2.0.2/lib/pure/dynlib.nim
CC: D:/nim-2.0.2/lib/windows/winlean.nim
CC: D:/nim-2.0.2/lib/pure/times.nim
CC: D:/nim-2.0.2/lib/std/private/oscommon.nim
CC: D:/nim-2.0.2/lib/std/private/ospaths2.nim
CC: D:/nim-2.0.2/lib/std/private/win_setenv.nim
CC: D:/nim-2.0.2/lib/std/envvars.nim
CC: D:/nim-2.0.2/lib/std/cmdline.nim
CC: D:/nim-2.0.2/lib/pure/os.nim
CC: D:/nim-2.0.2/lib/pure/strformat.nim
CC: D:/nim-2.0.2/lib/pure/collections/tables.nim
CC: ../../.nimble/pkgs2/nimqt-0.2.1-42bba9ecc8116885df92ab959cd32493da332f07/nimqt/nimqt_paths.nim
CC: ../../.nimble/pkgs2/nimqt-0.2.1-42bba9ecc8116885df92ab959cd32493da332f07/nimqt/qtcore/qstring.nim
CC: ../../.nimble/pkgs2/nimqt-0.2.1-42bba9ecc8116885df92ab959cd32493da332f07/nimqt/qtcore/qobject.nim
CC: ../../.nimble/pkgs2/nimqt-0.2.1-42bba9ecc8116885df92ab959cd32493da332f07/nimqt/tools/layout.nim
CC: hello.nim
Hint:  [Link]
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find /link: No such file or directory
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find /SUBSYSTEM:WINDOWS: No such file or directory
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find shell32.lib: No such file or directory
collect2.exe: error: ld returned 1 exit status
Error: execution of an external program failed: 'g++.exe   -o C:\Users\user\nimqt\examples\hello.exe  C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@ssystem@sexceptions.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@sstd@sprivate@sdigitsutils.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@sstd@sassertions.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@ssystem@sdollars.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@sstd@swidestrs.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@sstd@sexitprocs.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@sstd@ssyncio.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@ssystem.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@spure@sparseutils.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@spure@smath.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@spure@sunicode.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@spure@sstrutils.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@sstd@sprivate@sntpath.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@spure@spathnorm.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@spure@sdynlib.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@swindows@swinlean.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@spure@stimes.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@sstd@sprivate@soscommon.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@sstd@sprivate@sospaths2.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@sstd@sprivate@swin_setenv.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@sstd@senvvars.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@sstd@scmdline.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@spure@sos.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@spure@sstrformat.nim.cpp.o C:\Users\user\nimcache\hello_d\@mD@c@snim-2.0.2@slib@spure@scollections@stables.nim.cpp.o C:\Users\user\nimcache\hello_d\@m..@s..@s.nimble@spkgs2@snimqt-0.2.1-42bba9ecc8116885df92ab959cd32493da332f07@snimqt@snimqt_paths.nim.cpp.o C:\Users\user\nimcache\hello_d\@m..@s..@s.nimble@spkgs2@snimqt-0.2.1-42bba9ecc8116885df92ab959cd32493da332f07@snimqt@sqtcore@sqstring.nim.cpp.o C:\Users\user\nimcache\hello_d\@m..@s..@s.nimble@spkgs2@snimqt-0.2.1-42bba9ecc8116885df92ab959cd32493da332f07@snimqt@sqtcore@sqobject.nim.cpp.o C:\Users\user\nimcache\hello_d\@m..@s..@s.nimble@spkgs2@snimqt-0.2.1-42bba9ecc8116885df92ab959cd32493da332f07@snimqt@stools@slayout.nim.cpp.o C:\Users\user\nimcache\hello_d\@mhello.nim.cpp.o  /link /SUBSYSTEM:WINDOWS shell32.lib  -LD:\Qt\Tools\QtDesignStudio\qt6_design_studio_reduced_version\lib  '

I tried to fix the error but couldn't find the shell32.lib file. I think there is only shell32.dll, but it would take a long time to find it.