[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Fail to link promoted custom widget in .ui file.
From:       "dukju ahn" <dukjuahn () gmail ! com>
Date:       2007-07-07 17:51:54
Message-ID: 9119cdb30707071051r4999cb0ax289352de5d224115 () mail ! gmail ! com
[Download RAW message or body]

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} )
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic