jerous86 / nimqt

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

Nimble 'install' doesn't seem to work #1

Closed matkuki closed 1 year ago

matkuki commented 1 year ago

Hi,

Thank you for this library ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰

I have followed the instructions to install it with: nimble install https://github.com/jerous86/nimqt but it only installs the ห™nimqt.nimbleห™ file into .nimble/pgks/nimqt-0.1/ directory: image

When trying to use the library after that, I get: image

matkuki commented 1 year ago

Specs:

jerous86 commented 1 year ago

This library has not been tested yet on windows, so there might be many issues :) This might be due to /src/ symlinking to /qt/6.4.1_minimal/. I updated the nimble file to directly link to the latter. Can you try again with the latest commit?

matkuki commented 1 year ago

This library has not been tested yet on windows, so there might be many issues :)

No worries, I will test it as much as I can. Hopefully you won't be too annoyed if I open a lot of issues as I find them.

Can you try again with the latest commit?

Yes, now it starts compiling, thanks ๐Ÿ‘ But now I get an error while compiling the minimal example:

# First, we import the nimqt.nim module that will allow us to use the Qt system
import nimqt

# nimqt.init() should be called at the start of your program.
# It will initialize verdigris, and import some common modules.
nimqt.init()

let app = newQApplication() # Create your application.

import nimqt/qlabel

let w=newQLabel(Q"Hello world!")
w.show()

discard app.exec() # Run Qt's main loop

... with this message:

C:\Users\matic\.nimble\pkgs\nimqt-0.1\nimqt\qtcore\qbytearray.nim(170, 1) Error: redefinition of 'setNum'; previous declaration here: C:\Users\matic\.nimble\pkgs\nimqt-0.1\nimqt\qtcore\qbytearray.nim(164, 6)
jerous86 commented 1 year ago

[...] Hopefully you won't be too annoyed if I open a lot of issues as I find them. Not at all :)

C:\Users\matic.nimble\pkgs\nimqt-0.1\nimqt\qtcore\qbytearray.nim(170, 1) Error: redefinition of 'setNum'; previous declaration here: C:\Users\matic.nimble\pkgs\nimqt-0.1\nimqt\qtcore\qbytearray.nim(164, 6)

I see what's going on:

I have no idea yet on how to resolve this simple and automatically. Any suggestions? :)

matkuki commented 1 year ago

Confirming that adding a when not defined(windows): for the clong and culong setNum overloads in qtcore/qbytearray.nim and qtcore/qstring.nim fixes this error. Then I get a similar error as the #2 issue.

No idea for an automatic solution currently, sorry. Only a conditional when comes to mind.

jerous86 commented 1 year ago

The automated fix was not too difficult, luckily, so it should be fixed now.

matkuki commented 1 year ago

Yes, it works ๐Ÿ‘๐Ÿ‘๐Ÿ‘