Fail to link promoted custom widget in .ui file.

dukju ahn dukjuahn at gmail.com
Sat Jul 7 17:57:10 UTC 2007


2007/7/7, dukju ahn <dukjuahn at gmail.com>:
> Hi. I happen to write custom widget. That new custom widget has
> its own .ui, .h and .cpp files. And this widget is contained by other
> widget using QtDesigner. I used "promote" feature in designer,
> because custom widget are not displayed in designer unless I
> write separate plugin (which is difficult).
>
> New XXXWidget is part of "util.so" library. When I build
> the shared "util.so" library, it was successfully built.
> After that, I tried to use this new widget by linking util.so with
> kcm plugin("kcm_yyy"). But kcm_yyy.so emits linking error
> "undefined reference to XXXWidget" Of course, cmakelist.txt
> was modified to link "util.so"
>
> I can't understand why undefined reference error happens.
> If util.so contains symbols of new widget, then linking util.so
> is sufficient to use new widget right? Is this due to buildsystem
> or qtdesigner?
> --------------------------------------
> Buildfile snippet for the kcm_yyy.so
>
> set( makebuilder_cfg_SRCS
>     makebuilderpreferences.cpp
> )
>
> set( makebuilder_cfg_UI
>     makeconfig.ui
> )
>
> kde4_automoc(${makebuilder_cfg_SRCS})
> kde4_add_ui_files( makebuilder_cfg_SRCS ${makebuilder_cfg_UI} )
> kde4_add_kcfg_files( makebuilder_cfg_SRCS makebuilderconfig.kcfgc )
> kde4_add_plugin( kcm_kdev_makebuilder ${makebuilder_cfg_SRCS} )
> target_link_libraries( kcm_kdev_makebuilder
> ${KDEVPLATFORM_UTIL_LIBRARY} ${KDE4_KUTILS_LIBS}
> ${KDEVPLATFORM_INTERFACES_LIBRARY} ${KDEVPLATFORM_PROJECT_LIBRARY} )
>
> -----------------------------------
> Buildfile snippet for util.so
>
> set(kdevplatformutil_LIB_SRCS
>     processlinemaker.cpp
>     commandexecutor.cpp
>     environmentvariableswidget.cpp
> )
>
> set( kdevplatformutil_LIB_UI
>     envvariableswidget.ui
> )
>
> kde4_automoc(${kdevplatformutil_LIB_SRCS})
> kde4_add_ui_files( kdevplatformutil_LIB_SRCS ${kdevplatformutil_LIB_UI} )
> kde4_add_library(kdevplatformutil SHARED ${kdevplatformutil_LIB_SRCS})
> target_link_libraries(kdevplatformutil ${KDE4_KDEUI_LIBS}
> kdevplatforminterfaces)
> set_target_properties(kdevplatformutil PROPERTIES VERSION 4.0.0 SOVERSION 4)
> install(TARGETS kdevplatformutil DESTINATION ${LIB_INSTALL_DIR} )

Forward to kdevelop-devel because it will be used in kdevplatform.
The custom widget I referred is environment variable widget.
I'm trying to link this widget to kcm_kdev_makebuilder.




More information about the KDevelop-devel mailing list