Results 1 to 14 of 14

Thread: Linker error with QtGui module, method doesn't exist in CE?

  1. #1
    Join Date
    Oct 2010
    Posts
    12
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Linker error with QtGui module, method doesn't exist in CE?

    I wasn't sure whether this problem should go in the Qt for embedded sub forum, but I'm at least pretty sure this is a more general issue. If anyone tells me differently, I'll move the thread.

    I'm working on an application, based on the Hello GL ES example for windows CE. After some pain stacking work and debugging, I have the application working brilliantly on my windows desktop, but when I try compiling in visual studio for deployment, I get the following linker error.

    Error 1 error LNK2019: unresolved external symbol getenv referenced in function jinit_memory_mgr QtGui.lib PlotPlanPlayerV3
    "getenv()" is a function which isn't defined for windows CE (and is apparently, outdated). Is there some alternative to this I can use? Can I just place in an empty class to satisfy the extern, or will that upset the systems operation?

    For reference, this is Qt 4.7.0, with a static build using the following options (in case this is relevant in the slightest!)

    configure -platform win32-msvc2008 -xplatform wince50standard-armv4i-msvc2008 -nomake examples -nomake demos -no-qt3support -no-declarative -no-webkit -no-phonon -no-phonon-backend -opengl-es-cm -opensource -release -graphicssystem opengl -static
    Thanks in advance, any help is really appreciated!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Linker error with QtGui module, method doesn't exist in CE?

    getenv() is a standard C function for retrieving environment variables so it should exist for any platform supporting ANSI C (and it's not outdated). You might try qgetenv() instead but it probably calls getenv() anyway.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Oct 2010
    Posts
    12
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Linker error with QtGui module, method doesn't exist in CE?

    From looking through the windows CE documentation, it isn't available for that platform. Sorry for calling it outdated, thats just the impression I got from a quick google search.

    The problem is, this isn't a problem caused by my code. It looks like the QtGui object has a call to something not compatable with windows CE, and I don't want to change the Qt code unless completely necessary.

    I'm trying to put through an alternative (hopefully) compatable implementation using registry values to satisfy the linker error in the mean time, but if there is something else I should be doing, I'll be happy to do it.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Linker error with QtGui module, method doesn't exist in CE?

    What is "PlotPlanPlayer" anyway? It's not part of Qt.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Oct 2010
    Posts
    12
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Linker error with QtGui module, method doesn't exist in CE?

    Its the name of the application I'm making.

  6. #6
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Linker error with QtGui module, method doesn't exist in CE?

    Qt should solve this for you.

    Where do you call getenv()?

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Linker error with QtGui module, method doesn't exist in CE?

    Quote Originally Posted by Willybood View Post
    Its the name of the application I'm making.
    So replace your call to getenv() with a call to qgetenv() and you should be fine.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #8
    Join Date
    Oct 2010
    Posts
    12
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Linker error with QtGui module, method doesn't exist in CE?

    Quote Originally Posted by wysota View Post
    So replace your call to getenv() with a call to qgetenv() and you should be fine.
    Quote Originally Posted by tbscope
    Where do you call getenv()?
    Thats the thing, theres no call to getenv() in any of the code I've written. Judging by the error, it must be in some third party piece of code, and considering how the error references "QtGui.lib", possibly in Qt!

    It's more likely I haven't set something up correctly, I'm just not sure what. If I get time tonight, I'll try to do the same operation with the original openGL ES example, see if that works. If not, I'll experiment with creating a new shadow build with some altered configuration settings.
    Is there any chance I could be using something which isn't compatable with windows CE?

    Thanks for the help by the way, If theres anything you need to know about my setup, let me know!
    Last edited by Willybood; 28th October 2010 at 14:00.

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Linker error with QtGui module, method doesn't exist in CE?

    Quote Originally Posted by Willybood View Post
    Thats the thing, theres no call to getenv() in any of the code I've written. Judging by the error, it must be in some third party piece of code, and considering how the error references "QtGui.lib", possibly in Qt!
    No, it's not in Qt. Qt builds fine on WinCE, many people use it.

    Is there any chance I could be using something which isn't compatable with windows CE?
    If some library uses getenv() then yes. But you can always redefine getenv as qgetenv().
    Qt Code:
    1. char *getenv(const char *name) {
    2. static QByteArray ba;
    3. ba = qgetenv(name);
    4. return ba.data();
    5. }
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  10. #10
    Join Date
    Oct 2010
    Posts
    12
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Linker error with QtGui module, method doesn't exist in CE?

    That looks like a good solution!

    I am having some problems implementing it though, but the problem is more with my C++ skills. I've placed the method in as a global function, but I'm still getting the "unresolved external" error. Is there something that I'm missing to get this recognised by an external library?

    In the mean time, I'm experimenting with a new build of Qt, and early next week when I get some time, I'll do a dry run with the hello es example.

    Thanks for all your help so far!

  11. #11
    Join Date
    Oct 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Linker error with QtGui module, method doesn't exist in CE?

    Hi,

    currently I'm facing the same problem. The unresolved external symbol message appears even while trying to compile this program, that doing nothing:

    Qt Code:
    1. #include <QtGui/QApplication>
    2.  
    3. int main(int argc, char *argv[])
    4. {
    5. QApplication a(argc, argv);
    6. return a.exec();
    7. }
    To copy to clipboard, switch view to plain text mode 

    I must say, that the problem appears only in the static build. Before this, I used the standard version of Qt WinCE and there was no problem with linking. Now when I try to compile my app, about 8 unresolved externals are displayed (see the log). Unfortunately non-static version is unacceptable for me because of huge size of DLLs.

    Qt was configured with these params:

    configure -static -release -platform win32-msvc2008 -xplatform wincewm65professional-msvc2008 -nomake examples -nomake demos -no-qt3support -no-phonon -no-phonon-backend -opensource

  12. #12
    Join Date
    Oct 2010
    Posts
    12
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Linker error with QtGui module, method doesn't exist in CE?

    Hey Audio, glad to hear its not just me!

    I just tried with only the original hello GL-ES example, and I'm getting the same issue.

    For me though, I don't necessarily need a static build. I'll recompile it later with a dynamic build, see if I have any more luck.

    Sorry I cant help you, but thanks for helping me!

  13. #13
    Join Date
    Oct 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Linker error with QtGui module, method doesn't exist in CE?

    Hi Willybood,

    you're welcome. A few minutes ago I've recompiled Qt with the same parameters I noticed in my first post except the static parameter, and it's working fine.

    Also, I maybe found the solution how to change the size of libraries - qconfig tool. I'll test it when I finish my app, because at this time I don't know exactly what libraries the application will require. Anyway, it's step forward and I hope I won't need to use static libs.

  14. #14
    Join Date
    Oct 2010
    Posts
    12
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Linker error with QtGui module, method doesn't exist in CE?

    Final update to this issue, it turns out it was a problem with the file 'jmemmgr.c'. There was a preprocessor #ifdef in there, which when 'NO_GETENV' is defined stops getenv() being referenced in the function. And for whatever reason, the Qt installer didn't set it.

    After modifying the source to add it, it ran fine. I've placed a report on the Qt bug tracker, hopefully in the next version it will be fine.

Similar Threads

  1. Qt Creator: File Makefile doesn't exist
    By earthling in forum Qt Tools
    Replies: 6
    Last Post: 4th November 2016, 04:44
  2. OS X: linker not finding QtGui in framework...
    By rickbsgu in forum Qt Programming
    Replies: 4
    Last Post: 28th September 2010, 18:36
  3. QDomDocumen save method doesn't work!
    By xiongxiongchuan in forum Qt Programming
    Replies: 2
    Last Post: 1st June 2010, 12:44
  4. Qt Creator: File Makefile doesn't exist
    By earthling in forum Qt Programming
    Replies: 0
    Last Post: 9th December 2009, 18:46
  5. qtdemo doesn't exist...
    By xyzt in forum Newbie
    Replies: 2
    Last Post: 24th March 2008, 06:37

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.