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

Compile error: unresolved external: "extern QSettings *settings;" #13

Open
romgen opened this issue Sep 9, 2013 · 9 comments
Open

Compile error: unresolved external: "extern QSettings *settings;" #13

romgen opened this issue Sep 9, 2013 · 9 comments

Comments

@romgen
Copy link

romgen commented Sep 9, 2013

Line 31 in fvupdater.cpp:
I get a compile error: "unresolved external" - "extern QSettings* settings;".

This is no wonder. I couldn't find any place in the code where "settings" is actually defined.

Using Qt 5.1, VC 2012 x64.

Loosely translated compile message:
fvupdater.obj : error LNK2019: Link to unresolved external Symbol ""class QSettings * settings" (?settings@@3PEAVQSettings@@ea)" in function ""private: void __cdecl FvUpdater::decideWhatToDoWithCurrentUpdateProposal(void)" (?decideWhatToDoWithCurrentUpdateProposal@FvUpdater@@AEAAXXZ)".

@me21
Copy link

me21 commented Sep 10, 2013

Yes, it is supposed that main program provides these QSettings. You should create and fill QSettings variable by yourself.
It is made that way because if the main program uses QSettings class for other activities, the usage of QSettings in main program and in Fervor library might not coincide (for example, one stores settings in ini-file, another one in registry on Windows - this isn't easy to understand and to maintain).

@romgen
Copy link
Author

romgen commented Sep 10, 2013

Is there any documentation what settings are required to be filled into QSettings?

@romgen
Copy link
Author

romgen commented Sep 10, 2013

Ok, after browsing through the code i ofund something like "FV_NEW_VERSION_POLICY_KEY" which determines on how to handle updates.

But I wonder why the UI is disabled for QT5 in the .pri file? I enabled the UI manually in the .pri file and it works nicely.
Why would you hide a feature like that?

@me21
Copy link

me21 commented Sep 12, 2013

I used QT4 and forgot to enable UI for QT5 too. My apologies :( Perhaps you could make a pull request with the fix? I'm only beginning to move to QT5 for my projects.

@romgen
Copy link
Author

romgen commented Sep 12, 2013

Pull requests are way too complicated.

Here's a patch for 3 things:
http://www.pasteall.org/45539/diff

@me21
Copy link

me21 commented Sep 12, 2013

As far as I can see, you've removed the conditional setting of variable (the line "fervor_gui {"). That way UI would be always enabled. I believe the user of Fervor library should have an option to disable GUI if it is used in console program, for example. In addition, the program should not depend on QtGui.dll or Qt5Gui.dll in that case.

@romgen
Copy link
Author

romgen commented Sep 12, 2013

Feel free to add this ufnctionality again.

I didn't know how to enable this, so i just removed the braces ;-)

@me21
Copy link

me21 commented Sep 12, 2013

OK, I'll use your patch as a base. I'm moving to Qt5 my projects now, so eventually I'll update Fervor with new patch. Thanks! :-)

@me21
Copy link

me21 commented Sep 13, 2013

Done, you can now test the conditional GUI enabling and disabling by adding or removing "CONFIG += fervor_gui" to your project file and recompile. You can use my fork of Fervor while my pull request is not integrated into main repository.

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