Comments (53)
I'm currently installing the latest version of Qt, because my old one doesn't work with VS2019. It'll take a little time as it's over 10Gb (I like to get Qt sources and debug info too just in case) but hopefully I'll get the same problems here and then will be able to fix them.
from zkanji.
Sorry, I should have mentioned that this is done in the command prompt. windows-button+R, enter cmd [path to your Qt\bin]
(replace the path, use quotes around it if it has spaces) This should open the command prompt right in the correct folder. You'll have to type windeployqt and the path to your executable after it on the same line, don't forget quotes if you need them.
I really have to update the explanation about this...
edit: The official deployment page of Qt also says this:
The tool can be found in QTDIR/bin/windeployqt. It needs to be run within the build environment in order to function correctly. When using Qt Installer, the script QTDIR/bin/qtenv2.bat should be used to set it up.
I don't know if this is relevant to you or not, but I leave it here just in case. (edit2: if it is needed, you can start that batch file from the command prompt before using windeployqt.)
from zkanji.
I found the source of the issue. It's a templated class of mine, which is way over the level of a beginner, so don't worry if you couldn't find it. I will try to fix it now but it might take hours, or might be done in 10 seconds.
The const you saw at the reported line is a red herring. I think the error refers to a missing const in my template class' source.
from zkanji.
VS does interesting stuff. I checked my linker settings' additional dependencies, and it's empty beside the default value. But I remember changing it... So it must have shuffled around what I entered randomly... 🗡️ 🗡️ 🗡️
from zkanji.
Great! I'll close this discussion tomorrow evening unless the situation changes. If anything new comes up that's unrelated, please open another issue for it. I might update the instructions on the main page for building zkanji, though I won't do this before the weekend for sure.
from zkanji.
Hm... I'm not sure if this is a feature of zkanji or rather a bug. I made this so long ago. As a workaround, you can copy parts of words by selecting only the letters you need. This works in most word lists, including the dictionary. When you select a part, a popup context menu appears that only applies to what you selected.
I would need more time to consider what to do with the current "copy kanji" option. It's different from the "copy written form" in the clipboard sub-menu as that would copy the kana too, and both seem to be needed, but a separate kanji copy too. I assume I originally thought that selecting a part is for that, but it might not be the best design choice.
from zkanji.
As a workaround, you can copy parts of words by selecting only the letters you need.
oh yeah, I had tried that before, I left click dragged/highlighted 小 in 小説, did a "Copy Kanji" and nothing gets put into the clipboard, same for "Append Kanji" - did I do something wrong or misunderstood your explanation?
I was also downloading the source code and installing VSCommunity and QT just in case the only option was for me to try and fix it, but all I have in the programming department is a year of hobby/self-study of C++ (partially forgotten), therefore it will already be a daunting task (if not impossible) for me to get the code to compile... :)
from zkanji.
nothing gets put into the clipboard
That's clearly a bug then. It works for me so not sure how I will fix this.
The code should compile (if you install the QT add-on in VS Community) unlike other projects, I tried to limit my use of external stuff, so you don't need any special build systems and makes that make it so annoying to compile most other OSS out there. You might have to change some paths in the QT add-on at best. If you decide to go this way I can give pointers where to debug in the code.
from zkanji.
OXvCVa16P5.mp4
I've made a quick video (above) to show how smooth my standard look up method used to be with the old zkanji, maybe by seeying it some good ideas might come to mind.
Also I'm most definitely going that way, so I'll take all the pointers you can give :D
If I manage even only to pinpoint the reason as to why that workaround is not working would already be a huge achievment for me ahah
from zkanji.
Adding a "copy only this kanji" in the context menu would require a redesign. It's already huge. It was a pain to reproduce the old menu in Qt so I gave up on that, that's why it looks more traditional in the re-made zkanji. Or maybe the current "copy kanji" should be renamed to "copy all kanji" and moved into the clipboard sub-menu, and a new "copy kanji" added for only the hovered kanji. Not sure yet.
If you intend to debug zkanji, make sure to get the latest version 5 of Qt, not version 6 which came out not that long ago. They tend to break compatibility with main version changes, and also introduce bugs that only get ironed out with time.
My folder settings in the VS QT add-on options: (You need to change paths and version numbers where you have your installs)
The modules in QT Project Settings (also in the add-on) you will need to check (although this might be already done for the project) :
If you have Qt properly installed this should work right away.
The corresponding line to the word context menu is in zdictionarylistview.cpp, in a function called showPopup. Line 1481 for me. The code executing when the option is selected is only 4 lines below. Check gUI->clipCopy
and gUI->clipAppend
there.
from zkanji.
Is that add-on called "Qt VS Tools" ?
Because that is what I got but the windows where you choose the version looks different, not to mention is not accepting the version I'm providing for some reason, but I suspect I've installed the wrong extension - using VS 2019
from zkanji.
Yes this is how it looks in VS2019 (Just checked. The screenshot was from VS2015 that I used for zkani.) You installed the MinGW version which is for the MinGW compiler. The folder compatible with VS should have msvc in the path.
unnecessary edit: actually the new version of the add-on looks the same in VS2015, I just reverted to an old version because it worked better for me.
from zkanji.
Before I forget, you'll also need to copy the zkanji data folder next to the newly compiled zkanji executable because it can't run without data files. Compile first, check where the executable is placed, then copy it in there.
from zkanji.
You installed the MinGW version which is for the MinGW compiler. The folder compatible with VS should have msvc in the path.
I see
Although even by providing the correct version, when I then go and select, by confirming it I get an unrecoverable error after which the Qt add-on doesn't work anymore unless I restart VS. The clip below shows it:
Go4FcT0pN3.mp4
I suspect the add-on for VS 2019 might be bugged, should I downgrade to VS 2015? (unless I'm doing something else wrong)
from zkanji.
Strange. I can't get that Qt Project Settings window to appear in VS2019. It looks like the old add-on I have in VS2015. The VS2019 one is a page in the normal project settings. Did you install it from within Visual Studio, or downloaded it separately? Mine was installed with the VS interface from the "extensions/manage extensions" menu. The add-on version is 2.7.1.8 there.
from zkanji.
A lot of people seem to have this exact same bug. Look: https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2019&ssr=false#review-details
An advice given there is to install a previous version of the add-on from https://download.qt.io/official_releases/vsaddin/
but it's difficult to say how many versions you'll have to go back. If you go this route, make sure to disable automatic update in the "manage extensions" window. Computers are so complicated...
from zkanji.
Thanks for all the help so far :)
I was trying random things, one of which was clicking "Convert custom build steps to Qt/MSBuild":
As a resoult, if I now click on Qt Project Settings, I get sent here:
this is the normal/expected behaviour, right?
So now I can do "Build Solution", and the build goes all the way through but fails in the end, the errors begin here:
from zkanji.
oh wait, I think I got it, the includes from the project must be wrong, need to check all the paths :)
from zkanji.
Cleaned the solution then attempted to Build, but still the same errors... so I take it back, I don't got this xD
from zkanji.
Too bad, I hoped it would work now.
There's an "Additional Include Directories" on the "C/C++" page that (when edited) has these contents:
It's unrelated, but my "additional dependencies" look like this: qtmain.lib;Qt5Core.lib;Qt5Gui.lib;Qt5Widgets.lib;Qt5Svg.lib;Qt5PrintSupport.lib;%(AdditionalDependencies)
This shouldn't come up until all compilation is done though, and the task is handed over to the linker, so let's keep it the way you have it for now. It might be how it has to look for that Qt version.
It's late here but I'll get back to this tomorrow. I'll try to compile with VS2019 too and write about what I found out.
from zkanji.
Thank you
Is late here too, be back tomorrow :)
from zkanji.
tried some more today, apparently zkanjigridview.cpp, zkanjiwidget.cpp, zlistview.cpp and kanjistroke.cpp where all giving build error because QPainterPath wasn't declared or something, maybe it was being brought in through some other Qt header that doesn't include it anymore in the more recent release? Anyway I solved those by including QPainterPath in those 4 files.
And so I'm left with these errors:
I looked up the first one, this comes up:
https://forum.qt.io/topic/111793/how-to-resolve-error-of-qmutex-h
apparently a person there solved it by downgrading to Qt5.13.2, so I guess I'll try doing the same :)
from zkanji.
ok reversing to Qt5.13.2 with msvc 2017 fixed the first error in the image above, so the 12 errors above are still left.
In searchtree.cpp I've tried to delete a "const" qualifier on line 943 (on the first parameter of the lambda) and that decreased the build errors to 9, so I believe I need to repeat something similar elsewhere until I get 0 errors - now I try
from zkanji.
I don't understand this error, but if it fixes compilation then it's fine. Removing those consts before the QStrings should have no negative effect.
from zkanji.
Found the same bug report about the first one. You shouldn't have downgraded, it's a bug in VS that doesn't affect compilation. It only shows up as error while VS is checking your currently edited source for would-be bugs, and it falsely reports this. The compiler is independent of this editor thing though. I'm still confused about the others.
from zkanji.
well even if it diminished the errors report to 9 is not even the correct way because it generated another error in the process xD
https://en.cppreference.com/w/cpp/algorithm/upper_bound
regarding the Compare Lambda function, the link above says
While the signature does not need to have const &, the function must not modify the objects passed to it and must be able to accept all values of type (possibly const) Type1 and Type2 regardless of value category (thus, Type1 & is not allowed, nor is Type1 unless for Type1 a move is equivalent to a copy (since C++11)).
The "thus, Type1 & is not allowed" is the cause of the new error.
Honestly, I don't know how to get around it :\
from zkanji.
( oh btw, don't know if it matters, but because of VS 2019, the lower my C++ version can go is ISO 14 :\ )
from zkanji.
I got everything installed and getting the same errors as you. Stay tuned!
The C++ version shouldn't matter. The newer the better! ...Unless it broke something, but then it should be fixed.
from zkanji.
Additional note - that line I had identified is not even the one where the problem is at... somehow messing it up decreased the error count to 9, but if I comment out the function completely and then rebuild, the errors are still 12...
from zkanji.
Nice! Looking forward to being able to build the program :D
from zkanji.
I fixed it and pushed the correct code to GitHub. I'll also post the solution here too, but right now it still doesn't finish, as the linker settings are forgotten when you bring a project to a new version of Visual Studio... I'm trying to fix it now.
from zkanji.
My fix was to place a const version of functions in smartvector.h at about line 66.
The extra lines should look like this:
T*& operator*() const { return base.operator*(); }
T*& operator->() const { return base.operator->(); }
T*& operator[](difference_type n) const { return base[n]; }
Almost the exact same code is found there but without the consts.
My other issue was trying to link 64 bit Qt to a 32 bit zkanji. I set this up correctly in VS2015 but when importing to VS2019 it conveniently forgot about this little detail...
Zkanji will only run if you place the data folder next to the executable (edit: with all data files inside), so make sure you do this once you generated a zkanji.exe. Now zkanji starts up... and crashes immediately, with an issue regarding translations... I have no idea how this works within Qt, so another debug session coming up...
from zkanji.
Fixed that error too, and zkanji is now running. You'll have to fetch zcolorcombobox.cpp again, because this fix touches over a hundred lines.
Edit1: There are still errors popping up when I close zkanji, all possibly due to change in compiler (the above error was thanks to this too,) but it seems to work somewhat. I'll be fixing all those issues too with time.
Edit2: Now that I think about it, I will have to update the compiling instructions as well, since others might try a newer version of VS, and they might fall into the trap of a faulty IDE too...
from zkanji.
Fixed this last crash too, or rather worked around it, which was another non-bug, just picky VS. You should fetch anything new with Git or just download the changed files "groups.h" "groups.cpp" and "groupslegacy.cpp" IIRC.
from zkanji.
I'm back :P
So, I've downloaded the source files, I've set up the directory the same way I had them in the images shown above (except is now Qt\5.13.2\msvc2017_64 because I had downgraded the Qt version), and the build step seems to be proceeding correctly until everything explodes like this:
I think this means some library is not getting found... but I can't understand why... x_x
Edit1: this might be an indication as of why:
1>D:\Qt\5.13.2\msvc2017_64\lib\Qt5Widgetsd.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'
Edit2: yes it was that, it compiled successfully now :D I'll try and proceed with the following steps
from zkanji.
ok, I've built the program, copied the data folder and dll files from the zkanji beta release, but I'm getting an error when I try to start zkanji.exe... is this one expected? Is the same error you where mentioning?
Edit: I think this one I solved it :D Apparently the .dll from zkanji beta where no good, maybe they where for 32 bit?
from zkanji.
Fixed this last crash too, or rather worked around it, which was another non-bug, just picky VS. You should fetch anything new with Git or just download the changed files "groups.h" "groups.cpp" and "groupslegacy.cpp" IIRC.
So now I'm missing only zcolorcombobox.cpp fix and those 3 files mentioned above :)
The files I'm using are from here -> https://github.com/z1dev/zkanji/tree/master but now that I notice, last modify was made Sep 5, 2019, so I suspect I am not getting the changed files and that might be the reason for the error I'm getting now :/
Where should I download the updated files from?
from zkanji.
The DLLs you copied are no good. The ones provided with the beta are for the old Qt, and previous version of MS runtime. The way to get the correct DLLs is explained (with very few details) in the main GitHub description, but you can ignore those too. Just delete all the DLLs you copied in, and run zkanji from within VS. It will provide all the necessary DLLs through magic while you debug the program.
(Settings for 64bit and the button to run with debugger right next to it.)
from zkanji.
I fixed the missing updated files on the master branch just now. Since the time I last pushed changes to GitHub they changed the Git add-on in VS, and now there is one extra step in doing everything...
from zkanji.
mine is not genereting the .dll auto-magically that way xD
and even if I copy them from D:\Qt\5.13.2\msvc2017_64\bin (which I assume contains all the correct .dll), when I run zkanji.exe I get:
Computers are indeed complicated x_x sorry
from zkanji.
The Qt add-on in VS must be lost in where to find the DLLs, if it doesn't work right away. If you try to debug zkanji, make sure to copy the debug version of Qt's DLLs, the ones ending with a d
letter. If that's what you did, and still get this error, that means the debugger is trying to make our lives harder! Often, instead of stopping execution and breaking at an erroneous line, VS will throw this window at you. Press "retry" and then "break" in the next one, and it should take you to the error. If it does that, and you end up near the zcolorcombobox code, it's the bug I fixed and uploaded an hour ago (I should have checked that the git add-on is doing what it's supposed to, sorry!) Though it might be a different bug too.
from zkanji.
I manually copied the version without the "d", but I wasn't trying to debug when I got that error, I was running zkanji.exe (built with Debug x64 settings)
I attempted running it after replacing the .dll with the "d" ending version and I get an error complaining that the version without "d" are missing.
If everything build/run properly on your side, I'm willing to start back from square one starting with downloading the same versions you're using of Qt etc... and copying your exact settings (you could show me with 4-5 screenshots I believe, shouldn't be that many stuff that need a change of setting)
Also I had only replaced those 4 .cpp files but this time I'll download the whole thing, .sln included, so to reduce to almost 0 the chance of differences in what we're doing :)
from zkanji.
I compiled zkanji with VS2019 and the latest Qt5 successfully, there was nothing much else to it.
- Installed the add-on from the extensions menu, added the Qt version in the add-on.
- Cloned my zkanji source files to a new folder, because I didn't want my VS2015 settings to be lost. edit: allowed VS to upgrade everything.
- After opening the project in VS2019, I converted to MsBuild like you did to make sure I get the same result.
- Changed project settings also to use the right Qt version.
- Updated the include and library paths in the project settings, because I hardcoded the old Qt paths before. But if you download from git, that should be fixed now.
- Changed the current selected target from Win32 to x86 (which is already done in the original project, but VS forgot this when importing the project.) And that's about it.
I'll post screenshots of my VS2019 project settings just in case. (Note the Active keyword at the top and x64 set. If you compile for Win32 or Release, those have their own separate settings)
from zkanji.
(Reloading the VC++ include directories one as that changed, and the old setting might not work.)
from zkanji.
One thing to note, every time I changed something, I did a "Clean Solution" (found in the build menu) so VS doesn't accidentally use wrong files it compiled before.
from zkanji.
Thanks for all all the screens, I was missing Debugging->Environment path :P
Only the Linker settings are not shown but I know the Additional Dependencies from a previous screen, and the only other thing I'm doing there is under Linker/General/Additional Library Directories, in which I was pointing to D:\Qt\5.13.2\msvc2017_64\lib, which I don't think should cause any problem.
Sorry for all the trouble ^_^
It might take a bit to re-download Qt, but I'll let you know soon, hopefully all will work this time :)
from zkanji.
Someone reported similar issues that Visual Studio didn't use their QT DLLs. They had to delete the .user file of their project (which are extra settings in VS) and then it worked for them.
A way to check if VS is looking in the right folder is to go to for example the C/C++/General tab in project settings, selecting "Additional Include Directories" and clicking on the arrow and selecting "edit". There should be a "Macros>>" button near the bottom.
Click it, and enter "qtdir" in the search field like on my screenshot, and seeing if it's correct.
from zkanji.
Amazing! :D
Good news, I have no idea of what exactly "did it", but now everything work, I can build and debug/run the program!
I have copied exactly the setting you showed me above and I could debug the program!
Also another finding, by adding qtmain.lib;Qt5Core.lib;Qt5Gui.lib;Qt5Widgets.lib;Qt5Svg.lib;Qt5PrintSupport.lib;%(AdditionalDependencies) to the Additional Dependencies of the linker, I get the errors I was getting previously, so those where the root of my previous problem - right now Additional Dependencies only has %(AdditionalDependencies), and everything works fine
Not only that, but the problem zkanji beta 1.0 had where if I selected a single kanji and do a copy/append then the clipboard would be empty, that problem is gone!
I can't tell if that problem was fixed by you after the release of zkanji 1.0 (thus the fix not part of that release) or if it is a problem that "hides" while I am debugging from Visual Studio - to ascertain that, I wanted to launch the program from outside VS, the problem in doing that is that I am still not getting the additional .dll auto-magically created next to zkanji.exe even after deleting the .user file, furthermore if I manually bring the requested .dll from D:\Qt\5.15.2\msvc2019_64\bin next to zkanji.exe and then I try to run zkanji.exe manually, I get this horrible error here:
from zkanji.
Have you seen the paragraph on the main page (if you scroll down to below the source code) about deploying zkanji?
Deployment on Windows
To use the program after compilation, you should copy the C++ runtime DLLs of your compiler next to the executable. zkanji also needs the Qt DLLs. See the page Qt for Windows - Deployment for details.
The easiest way is to run the windeployqt executable from the Qt bin folder with the path to the compiled zkanji executable as a command-line parameter. This will copy some DLLs next to the executable, and also create some extra folders. These extra folders, except the one called platforms (this is important!), must be copied to a subfolder named plugins. The platforms folder should be kept in the root of the executable.
edit: I'm not sure if this will work with the debug build, but if not, you can replace the DLLs in the subfolders with the debug variants.
from zkanji.
err... I doubleclick windeployqt.exe and it appears and disapper immediately (it essentially flashes into and out of existence), I don't even have the time to write anything into it... :(
from zkanji.
Yep, it worked, no problems left :D
That bug preventing to copy/append a single kanji is not there, so it must have been something that was fixed after releasing the 1.0 beta
But I'm glad we went over this so the next time a bug comes up I can poke at it, and maybe other people as well can benefit from this since we essentially went over every possible build problem xD
I think next I'll try to build it for release and I'll use this version instead during my japanese games playtroughs :P
Thank you for all the help! :D
And also for making this awesome tool ;)
from zkanji.
No problems at all, I've managed to compile for release, took only the necessary files and moved them to a "zkanji beta 1.01" folder, everything works as expected :)
As an added bonus, my color scheme was retained (maybe by using the data folder from the beta 1.0 version I was using before?), this issue can be closed
Just a question, there is a place I can use to talk to you if I have more "general questions" about zkanji, zkanji workings etc...?
(possibly somewhere as direct as here on github, don't know why but it feels more like conversation, emails feels slow for some reason)
from zkanji.
Not sure if this is helpful, but I opened the Discussions board for the project. Feel free to write there. I hope GitHub won't slack off notifying me this time though, as it never does regarding bug reports for years now.
from zkanji.
Related Issues (20)
- Feature Request -- GUI setup for dictionary files HOT 2
- Feature Request -- Add kanji to group from dictionary view(s) HOT 6
- Future Feature Request -- Card-printing HOT 1
- Kanji reference numbers broken in the settings and on the Kanji Information Window HOT 1
- Order dictionary result by frequency. HOT 1
- ERROR -- Build Error @ settings.cpp HOT 2
- Examples not shown in word group. HOT 2
- Long-term study statistics issues HOT 1
- Feature Request -- Reset of horizontal scroll bar after word search HOT 1
- OSX build HOT 2
- Kanji are too big inside "kanji boxes": handwriting tool and kanji search HOT 2
- Request: keep the handwriting tool opened HOT 1
- Create data folder automatically if it does not exist HOT 1
- ZKanji hangs when importing examples HOT 1
- Segmentation fault when trying to play Kanji stroke order HOT 4
- Suggestions? HOT 1
- Radical Search bug HOT 3
- Feature Request: improving "Translate From Japanese" responsiveness HOT 4
- How do I filter out words for a kanji by its particular on-reading?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zkanji.