Bug 261208 - k3b 2.0.0 fails to build: redefinition of "QString createNonExistingFilesString(const QList<K3b::AudioFile*>&, int)"
Summary: k3b 2.0.0 fails to build: redefinition of "QString createNonExistingFilesStri...
Status: RESOLVED NOT A BUG
Alias: None
Product: k3b
Classification: Applications
Component: Mixed Mode Project (show other bugs)
Version: 2.0.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Michał Małek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-25 09:06 UTC by esigra
Modified: 2014-09-27 21:53 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
fix for the reported build error and some more (others remain) (8.93 KB, patch)
2010-12-26 21:13 UTC, esigra
Details

Note You need to log in before you can comment on or make changes to this bug.
Description esigra 2010-12-25 09:06:49 UTC
Version:           2.0.0 (using KDE 4.5.4) 
OS:                Linux

k3b 2.0.0 fails to build

Reproducible: Always

Steps to Reproduce:
1. tar jxvf /usr/portage/distfiles/k3b-2.0.0.tar.bz2
2. cd k3b-2.0.0
3. mkdir build
4. cd build
5. cmake -DKDE4_ENABLE_FINAL=ON ..
6. make

Actual Results:  
In file included from /home/work/programmering/k3b-2.0.0/build/libk3b/k3b_final_cpp.cpp:118:
/home/work/programmering/k3b-2.0.0/libk3b/projects/mixedcd/k3bmixedjob.cpp: In function "QString createNonExistingFilesString(const QList<K3b::AudioFile*>&, int)":
/home/work/programmering/k3b-2.0.0/libk3b/projects/mixedcd/k3bmixedjob.cpp:57: fel: redefinition of "QString createNonExistingFilesString(const QList<K3b::AudioFile*>&, int)"
/home/work/programmering/k3b-2.0.0/libk3b/projects/audiocd/k3baudiojob.cpp:50: fel: "QString createNonExistingFilesString(const QList<K3b::AudioFile*>&, int)" definierades tidigare här
Comment 1 esigra 2010-12-26 21:13:27 UTC
Created attachment 55267 [details]
fix for the reported build error and some more (others remain)
Comment 2 esigra 2011-01-19 20:28:44 UTC
Still fails with k3b 2.0.1.
Comment 3 Chao Feng 2014-08-09 09:38:20 UTC
Which compiler are you using? They are static functions so there should not show error here. The code duplication should be eliminated though.
Comment 4 esigra 2014-08-09 12:30:25 UTC
Still fails with k3b 2.0.2. Compiler is g++ (Gentoo 4.7.3-r1 p1.4, pie-0.5.5) 4.7.3. Not that it matters though. Redefinition is forbidden by the language.
Comment 5 Chao Feng 2014-08-13 13:27:50 UTC
They are static functions, only exist in one cpp file. Am I leaving coding too long:)
http://stackoverflow.com/questions/5319361/static-function-in-c
Comment 6 esigra 2014-08-13 20:16:12 UTC
Problem is that they are in 2 cpp source files, which are both included in the autogenerated file build/src/k3b_bin_final_cpp.cpp.
Comment 7 Johannes Obermayr 2014-08-21 22:14:42 UTC
Is the patch also required on master branch?
I can compile for various openSUSE versions without any issues: https://pmbs.links2linux.de/package/show/Essentials/k3b
Comment 8 Albert Astals Cid 2014-09-27 21:53:47 UTC
Simply don't compile with enable final, it's a gimnick to get 0.000000000001% speedup that breaks things.