[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: Getting full path to a dynamic library?
From: Sebastian Trueg <trueg () kde ! org>
Date: 2008-12-03 19:52:57
Message-ID: 4936E399.7000605 () kde ! org
[Download RAW message or body]
Thiago Macieira wrote:
> On Wednesday 03 December 2008 16:42:57 Sebastian Trueg wrote:
>> Thiago Macieira wrote:
>>> On Wednesday 03 December 2008 13:37:10 Sebastian Trueg wrote:
>>>> As far as I can tell QLibrary only gives us the filename of a
>>>> dynamically loaded library. However, I need to determine the full path
>>>> for usage in ODBC. Does anyone know how to determine that in a platform
>>>> independent manner?
>>> Sorry, what?
>>>
>>> Are you talking about QLibrary::fileName() ?
>>>
>> :)
>>
>> well, an example. I need the full path "/usr/local/lib64/virtodbc.so"
>> and all I know is the name of the lib, ie. "virtodbc". Now QLibrary can
>> find the lib AFAIK using the dynmic linker:
>>
>> QLibrary lib( "virtodbc" );
>> lib.load();
>>
>> now the lib can be used. Thus, the path to the lib file has to be
>> available somewhere. However, the documentation of QLibrary states that
>> fileName will only return "virtodbc.so" without the dir path.
>
> It returns whatever succeeded in dlopen().
>
> Since the full path was found by libdl itself, not QLibrary, it has no way of
> knowing the path either.
>
> Why do you need the full path? dlopen("virtodbc.so") works just fine.
>
like I said: ODBC driver. but it works now. At least on Linux. Win and
Mac are another question.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic