KF5_ADD_KDEINIT_EXECUTABLE linker errors
David Faure
faure at kde.org
Sat Jan 2 16:51:36 GMT 2016
On Friday 01 January 2016 15:45:45 Martin Koller wrote:
> Trying to port cervisia to KF5, I struggle with above.
>
> Having
> kf5_add_kdeinit_executable(cvsaskpass cvsaskpass.cpp)
>
> always gives linker errors:
> CMakeFiles/cvsaskpass.dir/cvsaskpass_dummy.cpp.o: In function `kdeinitmain':
> cvsaskpass_dummy.cpp:(.text+0x1c): undefined reference to `kdemain'
> CMakeFiles/cvsaskpass.dir/cvsaskpass_dummy.cpp.o: In function `main':
> cvsaskpass_dummy.cpp:(.text+0x3e): undefined reference to `kdemain'
>
> checking the cmake macro in /usr/lib64/cmake/KF5Init/KF5InitMacros.cmake, I wonder why
> is this even there:
> add_executable(${_target_NAME} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp ${_resourcefile})
>
> and if it's needed, then why does it not add ${_SRCS} directly, since by default
> the visbility of symbols is set to hidden, so this
> target_link_libraries(${_target_NAME} kdeinit_${_target_NAME})
> can't work.
> cvsaskpass.cpp contains:
> extern "C" int kdemain(int argc, char** argv)...
>
> What am I missing ?
Q_DECL_EXPORT before int kdemain.
--
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5
More information about the kde-core-devel
mailing list