Results 1 to 10 of 10

Thread: Q_init_resource

  1. #1
    Join Date
    Oct 2007
    Posts
    201
    Thanks
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Q_init_resource

    Hi all.
    I created a folder and saved a qrc file there. in another folder i ve a main() and inside that main I ve added Q_INIT_RESOURCE(stylesheet);

    While building the whole solution Im getting error like

    Linking...
    : error LNK2019: unresolved external symbol "int __cdecl qInitResources_stylesheet(void)" (?qInitResources_stylesheet@@YAHXZ) referenced in function _main
    so i need all of ur kind help.

    Thanx.
    Last edited by jpn; 11th March 2008 at 07:32. Reason: removed colors, added [quote] tags
    Cheers,
    Phillip



    --- Please post the solution you got to solve your problem. It may help others.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Q_init_resource

    How does this problem differ from the problem in this another thread of yours: Q_init_resource?
    J-P Nurmi

  3. #3
    Join Date
    Oct 2007
    Posts
    201
    Thanks
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Q_init_resource

    Quote Originally Posted by jpn View Post
    How does this problem differ from the problem in this another thread of yours: Q_init_resource?
    This is because i was only trying to execute that example alone.
    But I'm trying to add it in my project as a DLL. so im getting so much error. I ve a small doubt. Can i add Ui files in dll.?

    Plz do a reply.
    Cheers,
    Phillip



    --- Please post the solution you got to solve your problem. It may help others.

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Q_init_resource

    Wait, your first post states nothing about DLL, but main(). Could you clearly state
    - where do you have Q_INIT_RESOURCES()
    - in which .pro file you have the corresponding resource file
    J-P Nurmi

  5. #5
    Join Date
    Oct 2007
    Posts
    201
    Thanks
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Q_init_resource

    Quote Originally Posted by jpn View Post
    Wait, your first post states nothing about DLL, but main(). Could you clearly state
    - where do you have Q_INIT_RESOURCES()
    - in which .pro file you have the corresponding resource file
    K. In my project some 15 modules are there. one module is a exe. But my module is a dll. i ve include the Q_INIT_RESOURCES in the main() of that exe module. and created a pointer of stylesheet there. while trying to allocate memory its showing
    error LNK2019: unresolved external symbol "public: __thiscall StyleSheet::StyleSheetEditor::StyleSheetEditor(cla ss QWidget *)"

    and error LNK2019: unresolved external symbol "int __cdecl qInitResources_stylesheet(void)" (?qInitResources_stylesheet@@YAHXZ) referenced in function _main for Q_INIT_RESOURCES. I'm doing all these through cmake.i cannt understand what to do. Can u help me?
    Cheers,
    Phillip



    --- Please post the solution you got to solve your problem. It may help others.

  6. #6
    Join Date
    Oct 2007
    Posts
    201
    Thanks
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Q_init_resource

    Quote Originally Posted by phillip_Qt View Post
    K. In my project some 15 modules are there. one module is a exe. But my module is a dll. i ve include the Q_INIT_RESOURCES in the main() of that exe module. and created a pointer of stylesheet there. while trying to allocate memory its showing
    error LNK2019: unresolved external symbol "public: __thiscall StyleSheet::StyleSheetEditor::StyleSheetEditor(cla ss QWidget *)"

    and error LNK2019: unresolved external symbol "int __cdecl qInitResources_stylesheet(void)" (?qInitResources_stylesheet@@YAHXZ) referenced in function _main for Q_INIT_RESOURCES. I'm doing all these through cmake.i cannt understand what to do. Can u help me?


    I'm building the solution by using CMake.
    Cheers,
    Phillip



    --- Please post the solution you got to solve your problem. It may help others.

  7. #7
    Join Date
    Oct 2007
    Posts
    201
    Thanks
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Initialising resource

    Hi all. Ive posted this msg befor some day. But did not get replies to solve. so posting it again. I've one solution having a qrc file and its a Dll. and in another solution having main() and its a exe. I added Q_INIT_RESOURCES there. I'm creating the solution by using cmake. but if im compiling whole project I'm geeting error error LNK2001: unresolved external symbol for Q_INIT_RESOURCES. If im commenting it out then everything is ok. I cannt understand what to do.
    so i need ur kind help.

    Thanx.
    Cheers,
    Phillip



    --- Please post the solution you got to solve your problem. It may help others.

  8. #8
    Join Date
    Feb 2008
    Posts
    47
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Initialising resource

    Where r u adding ur Q_INIT_RESOURCE??

  9. #9
    Join Date
    Oct 2007
    Posts
    201
    Thanks
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Initialising resource

    Quote Originally Posted by sonuani View Post
    Where r u adding ur Q_INIT_RESOURCE??
    The structure is like this.

    Projece
    |----|-.cpp file
    | |-.qrc file, qss files
    | |-.h file (This module is dll)
    |
    |
    |----|-.cpp file. here ive put Q_INIT_RESOURCE inside main() . and this module is exe.
    | |-.h file

    Am i right?
    Cheers,
    Phillip



    --- Please post the solution you got to solve your problem. It may help others.

  10. #10
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Q_init_resource

    { Two threads merged }

    Please, do not start new threads on the same problem.

    Move the Q_INIT_RESOURCE() to somewhere in the DLL project.
    J-P Nurmi

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.