Bug 407734 - Compilation error for Python plugin
Summary: Compilation error for Python plugin
Status: RESOLVED FIXED
Alias: None
Product: Falkon
Classification: Applications
Component: general (show other bugs)
Version: 3.1.0
Platform: unspecified Linux
: LO minor
Target Milestone: ---
Assignee: David Rosca
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-19 16:59 UTC by Chris Hills
Modified: 2019-05-20 15:53 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 3.2.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Hills 2019-05-19 16:59:39 UTC
SUMMARY
Build fails with Python plugin: 'pyfalkon_load_plugin' has C-linkage specified, but returns user-defined type 'Plugins::Plugin' which is incompatible with C

STEPS TO REPRODUCE
1. Clone the repository https://github.com/KDE/Falkon
2. Run cmake
3. make

OBSERVED RESULT
```
[ 65%] Automatic MOC for target PyFalkon
[ 65%] Built target PyFalkon_autogen
[ 65%] Building CXX object src/plugins/PyFalkon/CMakeFiles/PyFalkon.dir/pythonplugin.cpp.o
In file included from /home/chaz/git/github.com_KDE_falkon/src/plugins/PyFalkon/pythonplugin.cpp:18:
/home/chaz/git/github.com_KDE_falkon/src/plugins/PyFalkon/pythonplugin.h:24:42: error: 'pyfalkon_load_plugin' has C-linkage specified, but returns
      user-defined type 'Plugins::Plugin' which is incompatible with C [-Werror,-Wreturn-type-c-linkage]
extern "C" Q_DECL_EXPORT Plugins::Plugin pyfalkon_load_plugin(const QString &name);
                                         ^
1 error generated.
make[2]: *** [src/plugins/PyFalkon/CMakeFiles/PyFalkon.dir/pythonplugin.cpp.o] Error 1
make[1]: *** [src/plugins/PyFalkon/CMakeFiles/PyFalkon.dir/all] Error 2
make: *** [all] Error 2
```

EXPECTED RESULT
Compilation should finish without errors.

SOFTWARE/OS VERSIONS
Build environment is as follows:-
Centos 7.6 64bit
llvm-toolset-7 from scl
Qt 5.12.3 from downloads.qt.io
PySide2/Shiboken2 from https://code.qt.io/pyside/pyside-setup

ADDITIONAL INFORMATION
KDE Frameworks/Plasma are not installed. This is a standalone build of Falkon with minimum required libraries, plus Python.

master branch is at commit fbf7f956fffeef054e1e67095fd6abb929ad2e56 (SVN_SILENT made messages (.desktop file) - always resolve ours)
Comment 1 David Rosca 2019-05-20 13:10:32 UTC
Builds fine with gcc 8.3.0
You are using clang?
Comment 2 David Rosca 2019-05-20 13:22:23 UTC
Git commit 2098d69ad1e0c58ae1b62e6b88090a636a9bb421 by David Rosca.
Committed on 20/05/2019 at 13:21.
Pushed by drosca into branch 'master'.

PyFalkon: Fix build with clang
FIXED-IN: 3.2.0

M  +12   -4    src/lib/plugins/plugins.cpp
M  +7    -7    src/plugins/PyFalkon/pythonplugin.cpp
M  +1    -1    src/plugins/PyFalkon/pythonplugin.h

https://commits.kde.org/falkon/2098d69ad1e0c58ae1b62e6b88090a636a9bb421
Comment 3 Chris Hills 2019-05-20 15:44:41 UTC
Yes, I am using clang because the gcc included with centos (rhel) 7 is too old and will not compile. Thanks for the fix!
Comment 4 Chris Hills 2019-05-20 15:53:00 UTC
For reference, if I try to compile using the stock gcc 4.8.5, this is the error:-

/home/chaz/git/github.com_KDE_falkon/src/lib/sidebar/sidebar.cpp:172:10: error: no matching function for call to ‘SideBarManager::connect(QPointer<SideBar>&, void (QObject::*)(QObject*), SideBarManager* const, SideBarManager::showSideBar(const QString&, bool)::__lambda0)’
make[2]: *** [src/lib/CMakeFiles/FalkonPrivate.dir/sidebar/sidebar.cpp.o] Error 1
make[1]: *** [src/lib/CMakeFiles/FalkonPrivate.dir/all] Error 2