Results 1 to 19 of 19

Thread: after compilingreceiving QtFatalMsg

  1. #1
    Join Date
    Apr 2006
    Posts
    122
    Thanks
    18
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default after compilingreceiving QtFatalMsg

    After doing all modifications , code fixing at compilation i am getting

    Qt Code:
    1. qgis: symbol lookup error: /usr/lib/qgis/libqgis_plugin_va.so: undefined symbol: _ZN12vARubberBandC1EP12QgsMapCanvas
    To copy to clipboard, switch view to plain text mode 
    resulting in QtFatalMsg.
    I couldn't found the reason for this. I had checked my code but it looks normal.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: after compilingreceiving QtFatalMsg

    Does your plugin use classes from the application?

  3. #3
    Join Date
    Apr 2006
    Posts
    122
    Thanks
    18
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: after compilingreceiving QtFatalMsg

    yes, they do through inheritance which is inevitable.
    Here vARubberBand class is defined at same level in heirarchy as plugin ( same placer also ).
    I have a data member pointer to vARubberBand and create a object of it in constructor.
    Qt Code:
    1. //! tool for drawing polygons
    2. class vARubberBand *rubberBand;
    3. //! add point to this list
    4. std::vector<QgsPoint> mPoints;
    5. //!
    To copy to clipboard, switch view to plain text mode 
    Last edited by quickNitin; 31st August 2006 at 11:44.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: after compilingreceiving QtFatalMsg

    Either add -rdynamic to application's linker flags, or move all common classes to separate library and link both the application and the plugin with it. Note that the first solution won't work under windows.

    Another solution is to use only interfaces in the plugin.
    Last edited by jacek; 31st August 2006 at 12:19. Reason: merged two posts

  5. #5
    Join Date
    Apr 2006
    Posts
    122
    Thanks
    18
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: after compilingreceiving QtFatalMsg

    i followed first method but still receiving symbol lookup error. i have also tried declaring vARubberBand class in different namespace, just to avoid chance of redeclaration, but not succeeded.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: after compilingreceiving QtFatalMsg

    How did you implement vARubberBand::vARubberBand(QgsMapCanvas*)?

  7. #7
    Join Date
    Apr 2006
    Posts
    122
    Thanks
    18
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default implementaion of constructor

    Qt Code:
    1. vARubberBand::vARuberBand(QgsMapCanvas *mapCanvas):QgsMapCanvasItem(mapCanvas)
    2. {
    3. mPoints.push_back(QgsPoint());
    4. QColor color=new QColor(Qt::LightGray);
    5. QColor fillColor(color.red(),color.green(),color.blue(),63);
    6. mPen.setColor(QColor(Qt::LightGray));
    7. mBrush.setColor(fillColor);
    8. mBrush.setStyle(Qt::solidPattern);
    9. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by quickNitin; 31st August 2006 at 12:28. Reason: code tags

  8. #8
    Join Date
    Apr 2006
    Posts
    122
    Thanks
    18
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default code attachment

    i am attaching in question code here
    Attached Files Attached Files

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: after compilingreceiving QtFatalMsg

    -rdynamic should go to compiler flags, not linker ones.

  10. #10
    Join Date
    Apr 2006
    Posts
    122
    Thanks
    18
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: after compiling receiving QtFatalMsg

    here i am presenting some part of makefile

    Qt Code:
    1. CC = gcc
    2. CCDEPMODE = depmode=gcc3
    3. CFLAGS = -g -O2 -rdynamic
    4. CPP = gcc -E
    5. CPPFLAGS =
    6. CXX = g++
    7. CXXCPP = g++ -E
    8. CXXDEPMODE = depmode=gcc3
    9. CXXFLAGS = -g -O2 -rdynamic
    10. CYGPATH_W = echo
    11. .
    12. .
    13. .
    14. CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
    15. $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
    16. .
    17. .
    18. .
    19. .cpp.o:
    20. if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
    21. then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
    22. # source='$<' object='$@' libtool=no \
    23. # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
    24. # $(CXXCOMPILE) -c -o $@ $<
    To copy to clipboard, switch view to plain text mode 

  11. #11
    Join Date
    Apr 2006
    Posts
    122
    Thanks
    18
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default found issue in implementaion of constructor

    Quote Originally Posted by quickNitin
    Qt Code:
    1. vARubberBand::[B]vARuberBand[/B](QgsMapCanvas *mapCanvas):QgsMapCanvasItem(mapCanvas)
    2. {
    3. mPoints.push_back(QgsPoint());
    To copy to clipboard, switch view to plain text mode 
    found one typing error . It should had been vARubberBand ( 2 b) but i put vARuberBand(). compiling whole code again.

    Shouldn't compiler detect it and atleast issue a warning

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: found issue in implementaion of constructor

    Quote Originally Posted by quickNitin
    Shouldn't compiler detect it and atleast issue a warning
    Yes, but only if the error was only in implementation.

  13. #13
    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: after compilingreceiving QtFatalMsg

    Quote Originally Posted by jacek
    -rdynamic should go to compiler flags, not linker ones.
    AFAIR it should go to linker flags (it's the same as --export-dynamic).

  14. #14
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: after compilingreceiving QtFatalMsg

    Quote Originally Posted by wysota
    it should go to linker flags (it's the same as --export-dynamic).
    It is a compiler option, which tells it to pass --export-dynamic to the linker.

  15. #15
    Join Date
    Apr 2006
    Posts
    122
    Thanks
    18
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: after compilingreceiving QtFatalMsg

    back to square one, after doing all these corrections again same error appears

    .

  16. #16
    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: after compilingreceiving QtFatalMsg

    Did you try with exporting the symbols used in the plugin into a separate library?

  17. #17
    Join Date
    Apr 2006
    Posts
    122
    Thanks
    18
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: after compilingreceiving QtFatalMsg

    no i hadnot. i don't know how to do that.

  18. #18
    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: after compilingreceiving QtFatalMsg

    Create a subproject with lib template and put all the classes and functions you want to use in plugins (and remove them from the main project). Then tell the main project to link with the library (for example using LIBS+=-L pathtosubproject -lnameoflib). Do the same with all the plugins (I mean link them against the newly created library). Remember that this library has to be found by the dynamic loader when you start your main app (you can use LD_LIBRARY_PATH env variable to do that).

  19. #19
    Join Date
    Apr 2006
    Posts
    122
    Thanks
    18
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: after compilingreceiving QtFatalMsg

    i will try to follow the steps.

Similar Threads

  1. strange error in compilation
    By quickNitin in forum Newbie
    Replies: 9
    Last Post: 30th August 2006, 12:21

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.