Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need some help for building on Windows #217

Open
charlescanato opened this issue Nov 16, 2023 · 5 comments
Open

Need some help for building on Windows #217

charlescanato opened this issue Nov 16, 2023 · 5 comments

Comments

@charlescanato
Copy link

charlescanato commented Nov 16, 2023

Hello, everybody!

I'm humbly asking for some help, hints, directions... any new info will do. I'm sorry if my issues sound very basic - they probably are. I just have started trying to build C++ projects and I see I have a loooong way to go - but I swear I'm usually a fast learner.

I've already spent lots of hours during the last month trying to solve and find solutions for the issues I'm facing, but it seems I'm in a wild guesses phase now.

I'm on Win7-64, Cygwin64, and followed Windows build directions on README:

  • downloaded and installed Qt 5.5 (with Mingw32 v4.92)
  • slightly different from the instructions, I git cloned nixnote2, cd'd into it and then cloned boo-yee/winlib.
  • ran qtenv2, and then went for the build commands

At this point, I'm on robert7/master. I've tried debug and release configs, also tried robert7/develop branch... after some time having run mingw32-make, I always have, on moc_types.cpp, warnings followed by errors similar to these:

qmake-build-debug/moc_types.cpp:11894:74: warning: 'qevercloud::ManageNoteSharesResult::staticMetaObject' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
 QT_INIT_METAOBJECT const QMetaObject qevercloud::ManageNoteSharesResult::staticMetaObject = { {
                                                                          ^~~~~~~~~~~~~~~~
qmake-build-debug/moc_types.cpp: In function '(static initializers for qmake-build-debug/moc_types.cpp)':
qmake-build-debug/moc_types.cpp:131:38: error: definition of static data member 'qevercloud::EverCloudLocalData::staticMetaObject' of dllimport'd class
 QT_INIT_METAOBJECT const QMetaObject qevercloud::EverCloudLocalData::staticMetaObject = { {
                                      ^~~~~~~~~~

It's a long list of same warnings and errors, on different members. On Cygwin (Qt v5.9), it doesn't show the QT_INIT_METAOBJECT on the line, but same it's pretty much the same result.

After lots of tries, trying other branches, Qt versions, Mingw versions... I did get to a complete build on a specific branch.

So, more or less like this:

  • Qt v5.5, Mingw 4.92, tag v2.1.9 (or boo-yee/master): this is the only combo on which I can get a successfully built version - I can use it beautifully, except that it seems to "interrupt" MS Teams and Zoom calls for 2 to 3 secs about each 15 secs. The side effect is bad enough that I have to close NixNote2 while having a work call. Maybe this might need more details, but I can open an issue for that if it makes sense (I understand Windows might not be a priority).
  • any other combo results in similar errors as above, usually always on moc_Types.cpp - I've tried master and develop branchs, boo-yee/develop, no commit above tag v2.1.9 seems to build under Win. Tried Qt 5.15.2 and 5.14.1, tried Mingw32 4.92 and 8.10 (I've tried different combinations between them). Tried Qt 5.9 and all needed dependencies under Cygwin (yeah, I was that desperate). All of them resulting the same errors.
  • of course, my only try to build under Linux worked beautifully
  • don't know if this makes a difference, but despite errors being always on QEverCloud "section", I am able to build QEvercloud with Mingw32 successfully, right from the very first try - I know it's a different project, environment and so - just wanted to add this, in case this info can help in any way

I totally value your time, guys. I know that maybe just @boo-yee uses to build under Windows, but maybe some of you might have good questions or different suggestions.

I'll keep on using v2.1.9 as it is, because when not on calls, it works great, just the way I need. :-) But, of course, I'd like to have newer versions, maybe even build them by myself, and maybe get rid of the calls interrupting bug.

@boo-yee
Copy link

boo-yee commented Nov 20, 2023

In src/qevercloud/QEverCloud/headers/export.h, you could change Q_DECL_IMPORT to Q_DECL_EXPORT. When I tried to build for the first time, I just did that too. There was an upgrade of qevercloud earlier, and I forgot to test the building under windows, sorry about that.

@boo-yee
Copy link

boo-yee commented Nov 20, 2023

except that it seems to "interrupt" MS Teams and Zoom calls for 2 to 3 secs about each 15 secs

You could try to disable the thumbnailing and auto sync, and see if that still happens.

@charlescanato
Copy link
Author

@boo-yee , thanks a lot! I found that the hard way, and it was exactly that! As I was able to build QEverCloud, I went to find what the differences were, and bingo! Thanks for confirming, and now I'm able to build master branch with Qt 5.5. :-)

Were you able to build it with any later Qt version? Of course this is just a wild guess of mine, I thought about giving those versions a try to see if the interrupts were specifically related to Qt v5.5.

However, both for Qt 5.14.2 and 5.15.2, I now have a problem during final linking complaining about undefined reference on Hunspell. I just started this investigation, don't know if it's related to Hunspell version - don't think so since build runs ok under v5.5.

@charlescanato
Copy link
Author

You could try to disable the thumbnailing and auto sync, and see if that still happens.

Thumbnailing was already disabled. Anyway, I've turned it on and back off. Auto Sync doesn't make any difference. Will keep playing with the options to see if any changes arise.

Also started it on Linux with trace level, to see if something was happening each 15 secs, but so far, I didn't locate any internally scheduled action like that. Will keep studying the code to see if I find something like that.

@boo-yee
Copy link

boo-yee commented Nov 22, 2023

In src/qevercloud/QEverCloud/headers/export.h, you could change Q_DECL_IMPORT to Q_DECL_EXPORT. When I tried to build for the first time, I just did that too. There was an upgrade of qevercloud earlier, and I forgot to test the building under windows, sorry about that.

In case this reply misleads other people, I have to say changing qevercloud code is not an advisable way. The right way should be adding the macro in the commands of building the files about qevercloud.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants