Bug 263202

Summary: [PATCH] lokalize 4.5.4 fails to build using 'default' symbol visibility
Product: [Applications] lokalize Reporter: esigra
Component: generalAssignee: Nick Shaforostoff <shafff>
Status: RESOLVED FIXED    
Severity: normal CC: esigra
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: patch that fixes the build

Description esigra 2011-01-15 08:51:38 UTC
Created attachment 56038 [details]
patch that fixes the build

Version:           unspecified (using KDE 4.5.5) 
OS:                Linux

lokalize 4.5.4 fails to build

Reproducible: Always

Steps to Reproduce:
1. tar jxvf kdesdk-4.5.5.tar.bz2
2. cd kdesdk-4.5.5
3. mkdir build
4. cd build
5. cmake -DKDE4_ENABLE_FINAL=ON ..
6. make lokalize

Actual Results:  
In file included from kdesdk-4.5.5/build/lokalize/src/lokalize_final_cpp.cpp:38:
kdesdk-4.5.5/lokalize/src/tm/jobs.cpp: In function "void initDb(QSqlDatabase&)":
kdesdk-4.5.5/lokalize/src/tm/jobs.cpp:647: fel: redefinition of "void initDb(QSqlDatabase&)"
kdesdk-4.5.4/lokalize/src/project/projectmodel.cpp:1236: fel: "void initDb(QSqlDatabase&)" definierades tidigare här
Comment 1 Nick Shaforostoff 2011-02-03 14:04:13 UTC
i wonder what is your distro (environment).

the problem is that it uses 'default' symbol visibility by default
Comment 2 esigra 2011-02-03 18:38:43 UTC
(In reply to comment #1)
> i wonder what is your distro (environment).
> 
> the problem is that it uses 'default' symbol visibility by default

This has nothing to do with linking (and therefore nothing to do with symbol visibility). It fails already at compilation because a function is defined with the same signature as one that was already defined.

The previously attached patch fixes it by manually inlining one of them (since it was used only in that one place). It might also work to put the functions in different namespaces.
Comment 3 Andreas K. Huettel 2011-03-05 12:00:00 UTC
This bug only refers to -DKDE4_ENABLE_FINAL=ON build mode, where all source files of one directory are concatenated and built in one compiler run. So, in this case Eric is right and it is not a linker or visibility but compilation problem.
Comment 4 Nick Shaforostoff 2012-02-23 18:40:53 UTC
latest version of Lokalize doesn't contain several static initDb functions anymore