MySQL library initialization failed (on "init")

Thomas Klausner wiz at NetBSD.org
Sat Oct 3 15:09:26 UTC 2009


On Sat, Oct 03, 2009 at 08:59:30AM -0400, Jeff Mitchell wrote:
> If you want to test it and let me know how it goes, that would be great.
> Change the lines from
> 
> if( NOT WIN32 AND NOT APPLE )
>     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--as-needed")
> endif( NOT WIN32 AND NOT APPLE )
> 
> to
> 
> if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
>     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--as-needed")
> endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
> 
> You'll need a full rebuild (from a clean build dir) afterwards. Let me
> know how it goes!

Thanks, Jeff.

I've used the attached patch.
Now amarok complains much earlier, during startup I get a messagebox:

KLibLoader could not load the plugin:
amarok_collection-mysqlecollection
Error message:
Cannot load library /usr/pkg/lib/kde4/amarok_collection-mysqlecollection.so: (Shared object "libmysqlclient.so.16" not found)

This looks like I need a "-Wl,-R/usr/pkg/mysqld/lib/mysql" (that's
where I installed the libmysqlclient.so) when linking this object. Can
someone tell me how/where to add that?

I run cmake with:
-DMYSQL_LIBRARIES:PATH=/usr/pkg/mysqld/lib/mysql/libmysqlclient.so

Thanks,
 Thomas
-------------- next part --------------
--- CMakeLists.txt.orig	2009-09-28 17:41:44.000000000 +0000
+++ CMakeLists.txt
@@ -55,9 +55,9 @@ endif(CMAKE_BUILD_TYPE MATCHES debugfull
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0")
 if (CMAKE_COMPILER_IS_GNUCXX)
     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
-    if( NOT WIN32 AND NOT APPLE )
+    if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
         SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--as-needed")
-    endif( NOT WIN32 AND NOT APPLE )
+    endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
 endif (CMAKE_COMPILER_IS_GNUCXX)
 
 include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/shared )


More information about the Amarok mailing list