EXTERNAL: Re: [odb-users] Question on Using ODB within a DLL

Szumowski, Thomas thomas.szumowski at lmco.com
Fri Jun 24 12:03:06 EDT 2011


Boris,

My debugger output looks similar on loading, but it is missing sqlite3.dll. (See the snippet below). Also, I put a breakpoint in dll.cxx. The code under "case DLL_PROCESS_ATTACH" executes successfully and the function returns a 1.

Also I noticed it works on my end fine when I implicitly link to the DLL rather than explicitly. So I suppose it is in fact what you suspected, a DLL (sqlite3) is not being loaded. I'll look into why sqlite3 is not being pulled in while everything else is.

Debugger Output:
'dbtest.exe': Loaded 'C:\tszumows\projects\O2\code\testdb\bin\dbtest.exe', Symbols loaded.
'dbtest.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', Cannot find or open the PDB file
'dbtest.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', Cannot find or open the PDB file
'dbtest.exe': Loaded 'C:\WINDOWS\system32\msvcr100d.dll', Symbols loaded.
'dbtest.exe': Loaded 'C:\tszumows\projects\O2\code\testdb\bin\DatabaseDLL.dll', Symbols loaded.
'dbtest.exe': Loaded 'C:\util\libodb-sqlite\bin\odb-sqlite-d-1.4-vc10.dll', Symbols loaded.
'dbtest.exe': Loaded 'C:\util\libodb\bin\odb-d-1.4-vc10.dll', Symbols loaded.
'dbtest.exe': Loaded 'C:\WINDOWS\system32\msvcp100d.dll', Symbols loaded.

-Tom

-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com] 
Sent: Friday, June 24, 2011 11:36 AM
To: Szumowski, Thomas
Cc: odb-users at codesynthesis.com
Subject: Re: EXTERNAL: Re: [odb-users] Question on Using ODB within a DLL

Hi Thomas,

Szumowski, Thomas <thomas.szumowski at lmco.com> writes:

> I attached a MSVC++ 2010 project that results in the described error. 
> The test() call fails upon create_database.

I just tried your test under the VC++ 2010 debugger and it works fine
for me. I even examined the output file (a.sql) and it contains the
expected data. My only guess would be that some of the DLLs are not
loaded. Here are the entries in the Output windows in the debugger
that I see after executing the LoadLibrary() function:

'dbtest.exe': Loaded 'C:\projects\testdb\bin\dbtest.exe', Symbols loaded.
'dbtest.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'dbtest.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'dbtest.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'dbtest.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
'dbtest.exe': Loaded 'C:\projects\testdb\bin\DatabaseDLL.dll', Symbols loaded.
'dbtest.exe': Loaded 'C:\projects\odb\libodb-sqlite\bin\odb-sqlite-d-1.4-vc10.dll', Symbols loaded.
'dbtest.exe': Loaded 'C:\projects\odb\libodb\bin\odb-d-1.4-vc10.dll', Symbols loaded.
'dbtest.exe': Loaded 'C:\Windows\SysWOW64\msvcp100d.dll', Symbols loaded.
'dbtest.exe': Loaded 'C:\projects\sqlite\bin\sqlite3.dll', Symbols loaded.
'dbtest.exe': Loaded 'C:\Windows\SysWOW64\msvcr100.dll', Symbols loaded.
'dbtest.exe': Unloaded 'C:\projects\testdb\bin\DatabaseDLL.dll'
'dbtest.exe': Unloaded 'C:\projects\odb\libodb-sqlite\bin\odb-sqlite-d-1.4-vc10.dll'
'dbtest.exe': Unloaded 'C:\projects\sqlite\bin\sqlite3.dll'
'dbtest.exe': Unloaded 'C:\Windows\SysWOW64\msvcr100.dll'
'dbtest.exe': Unloaded 'C:\projects\odb\libodb\bin\odb-d-1.4-vc10.dll'
'dbtest.exe': Unloaded 'C:\Windows\SysWOW64\msvcp100d.dll'

Can you check if you get something similar. The DLLs of interest are
odb-sqlite-d-1.4-vc10.dll, sqlite3.dll, and odb-d-1.4-vc10.dll.

If all this looks similar, can you set a breakpoint (before the call
to LoadLibrary()) in libodb/odb/details/win32/dll.cxx at the beginning
of DllMain() and see if it is called?

Boris



More information about the odb-users mailing list