[vtkusers] VTK + Qt sqlite link error

Dean Inglis dean.inglis at camris.ca
Mon Jan 17 12:31:49 EST 2011


Hi Jeff,

If I change the method call to vtk_winCurrentTime (line 28935)
and again on line 29039, then everything links statically.  It
is just this one method though, and not all the others defined
in :

static vtk_sqlite3_vfs winVfs = {
1, /* iVersion */
sizeof(winFile), /* szOsFile */
MAX_PATH, /* mxPathname */
0, /* pNext */
"win32", /* zName */
0, /* pAppData */
winOpen, /* xOpen */
winDelete, /* xDelete */
winAccess, /* xAccess */
winFullPathname, /* xFullPathname */
winDlOpen, /* xDlOpen */
winDlError, /* xDlError */
winDlSym, /* xDlSym */
winDlClose, /* xDlClose */
winRandomness, /* xRandomness */
winSleep, /* xSleep */
vtk_winCurrentTime, /* xCurrentTime */
winGetLastError /* xGetLastError */
};

Dean

----- Original Message ----- 
From: Jeff Baumes
To: Dean Inglis
Cc: vtkusers at vtk.org
Sent: Monday, January 17, 2011 12:05 PM
Subject: Re: [vtkusers] VTK + Qt sqlite link error


On Mon, Jan 17, 2011 at 10:59 AM, Dean Inglis <dean.inglis at camris.ca> wrote:

Im trying to build vtk 5.7 and Qt 4.7.1 statically with VS2010 on Win 7, 32
bit.
Qt builds fine but I have run into the following link error:

Linking CXX executable ..\..\..\..\bin\QVTKCxxTests.exe
vtksqlite.lib(vtk_sqlite3.c.obj) : error LNK2005: _winCurrentTime already
define
d in QtSql.lib(sqlite3.obj)
..\..\..\..\bin\QVTKCxxTests.exe : fatal error LNK1169: one or more multiply
def
ined symbols found
LINK failed. with 2

Here are the two locations where this method is defined:

VTK\Utilities\vtksqlite\vtk_sqlite3.c(28935):int
winCurrentTime(vtk_sqlite3_vfs *pVfs, double *prNow){

qt-4.7.1\src\3rdparty\sqlite\sqlite3.c(28987):int winCurrentTime(sqlite3_vfs
*pVfs, double *prNow){

there is an option for configuring the build of Qt to use sqlite from the
operating system.  Is this what I should do?



The VTK version of sqlite is supposed to have mangled symbols with the 
prefix "vtk_" so that this doesn't happen. Could you try replacing all 
occurances of winCurrentTime with vtk_winCurrentTime in the VTK version and 
see if it compiles correctly?


Jeff 




More information about the vtkusers mailing list