Dear KDB Users,I cannot load DLL in q console on windows. I suspect that I buildexample dll (a.dll) using MS VC8.0 and it may not be compatible withKDB+. Please advise.My KDB version is:KDB+ 2.4 2008.03.31 Copyright (C) 1993-2008 Kx Systemsw32/ 4()core 2047MB XYZ abcd 10.27.137.157 TIMEOUT 2009.04.01And the example program is:// a.c// w32>cl /LD ..\c\a.c a.def q.lib// l32>/usr/local/gcc-3.3.2/bin/gcc -shared ../c/a.c -o a.so// s32>/usr/local/gcc-3.3.2/bin/gcc -G ../c/a.c -o a.so#include"k.h"K f(K x){return ki(x->i+1);} // q calls cK g(K x){return k(0,“1+”,r1(x),0);} // c calls q/*f:a 2:(
f;1)g:a 2:(
g;1)f 2g 3*/a.def file is:EXPORTS fEXPORTS gThe build command is:cl -IC:\q\w32\src -I"C:\msft VS8\VC\include" /LD a.c a.def C:\q\w32\sdk\q.lib /link “C:\msft VS8\VC\lib\LIBCMT.lib” “C:\msft VS8\VC\lib\OLDNAMES.lib” "C:\msft VS8\VC\lib\kernel32.lib"When I loaded a.dll in KDB console, I got error:q)f:a 2:(
f;1)'The specified module could not be found.dbtouch
If you look at the page https://code.kx.com/trac/wiki/Cookbook/ExtendingWithCyou will see the phrase:"The resulting binary should be placed in the same directory as the qexecutable."If my memory serves my correct, Q will look for the library to load inthe QHOME directory (which is where the q binary is located).H?kan
X-Mailer: Apple Mail (2.929.2)well, there are few places where q is looking to load a dll:1. working directory2. $QHOME/ (win32 is $QHOME/w32 and in most cases QHOME is c:\q)3. if the dll has an absolute path, q will load it straight in.felixOn 24 Sep 2008, at 23:13, Lindqvist wrote:>> If you look at the page https://code.kx.com/trac/wiki/Cookbook/ExtendingWithC> you will see the phrase:>> “The resulting binary should be placed in the same directory as the q> executable.”>> If my memory serves my correct, Q will look for the library to load in> the QHOME directory (which is where the q binary is located).>>> H?kan> >
It turned out my guess is correct: KDB+ does not support VC 8.0.dbtouchOn Sep 24, 11:49?am, dbtouch <dbto…> wrote:> Dear KDB Users,>> I cannot load DLL in q console on windows. I suspect that I build> example dll (a.dll) using MS VC8.0 and it may not be compatible with> KDB+. Please advise.>> My KDB version is:>> KDB+ 2.4 2008.03.31 Copyright (C) 1993-2008 Kx Systems> w32/ 4()core 2047MB XYZ abcd 10.27.137.157 TIMEOUT 2009.04.01>> And the example program is:>> // a.c> // w32>cl /LD ..\c\a.c a.def q.lib> // l32>/usr/local/gcc-3.3.2/bin/gcc -shared ../c/a.c -o a.so> // s32>/usr/local/gcc-3.3.2/bin/gcc -G ? ? ?../c/a.c -o a.so>> #include"k.h"> K f(K x){return ki(x->i+1);} ?// q calls c> K g(K x){return k(0,“1+”,r1(x),0);} // c calls q>> /*> f:a 2:(
f;1)> g:a 2:(
g;1)> f 2> g 3> */>> a.def file is:> EXPORTS f> EXPORTS g>> The build command is:> cl -IC:\q\w32\src -I"C:\msft VS8\VC\include" /LD a.c a.def C:\q\w32\sdk> \q.lib > /link “C:\msft VS8\VC\lib\LIBCMT.lib” “C:\msft VS8\VC\lib> \OLDNAMES.lib” “C:\msft VS8\VC\lib\kernel32.lib”>> When I loaded a.dll in KDB console, I got error:>> q)f:a 2:(
f;1)> 'The specified module could not be found.>> dbtouch</dbto…>
X-Mailer: Apple Mail (2.929.2)not the 32bit one.you can configure vc8 to use msvcrt6.dll instead of the default one.felixOn 26 Sep 2008, at 05:08, dbtouch wrote:>> It turned out my guess is correct: KDB+ does not support VC 8.0.>> dbtouch>> On Sep 24, 11:49 am, dbtouch <dbto…> wrote:>> Dear KDB Users,>>>> I cannot load DLL in q console on windows. I suspect that I build>> example dll (a.dll) using MS VC8.0 and it may not be compatible with>> KDB+. Please advise.>>>> My KDB version is:>>>> KDB+ 2.4 2008.03.31 Copyright (C) 1993-2008 Kx Systems>> w32/ 4()core 2047MB XYZ abcd 10.27.137.157 TIMEOUT 2009.04.01>>>> And the example program is:>>>> // a.c>> // w32>cl /LD ..\c\a.c a.def q.lib>> // l32>/usr/local/gcc-3.3.2/bin/gcc -shared ../c/a.c -o a.so>> // s32>/usr/local/gcc-3.3.2/bin/gcc -G ../c/a.c -o a.so>>>> #include"k.h">> K f(K x){return ki(x->i+1);} // q calls c>> K g(K x){return k(0,“1+”,r1(x),0);} // c calls q>>>> /*>> f:a 2:(
f;1)>> g:a 2:(
g;1)>> f 2>> g 3>> */>>>> a.def file is:>> EXPORTS f>> EXPORTS g>>>> The build command is:>> cl -IC:\q\w32\src -I"C:\msft VS8\VC\include" /LD a.c a.def C:\q >> \w32\sdk>> \q.lib >> /link “C:\msft VS8\VC\lib\LIBCMT.lib” “C:\msft VS8\VC\lib>> \OLDNAMES.lib” “C:\msft VS8\VC\lib\kernel32.lib”>>>> When I loaded a.dll in KDB console, I got error:>>>> q)f:a 2:(
f;1)>> 'The specified module could not be found.>>>> dbtouch> ></dbto…>