KDB C++ Windows Project

Hi,I am trying to access a q process with a c++ program on my windowsmachine.I have added q.lib to the linker settings and I have c.obj in theproject directory. (also tried the debug directory)I still recieve the error “The application was unable to startcorrectly (0xc0000005). Click OK to close the application”.Anyone got any ideas?Thanks.

you’ve probably already found

https://code.kx.com/trac/wiki/Cookbook/InterfacingWithC

https://code.kx.com/trac/wiki/Cookbook/ExtendingWithC

but maybe not this

http://kx.com/q/c/c/readme.txt

the key point being which case you want

1. c dynamic load called by q, e.g. analytics2. c dynamic load callbacks into q, e.g. feedhandlers3. c clients talking to q servers. e.g. feedhandlers and clients(link with c.o)

I’m guessing you are #3, as you are linking to c.obj - in which case you don’t need q.lib!

You would link with q.lib when using #1 or #2.

You would link with c.lib when using #3 and c.dll.

Remember for #3, you should initialize memory before creating any k objects.

Hi Charles,Thanks that seems to have worked for me.I had been using an old topic on here so they must have been doing 1or 2.For 3 can you tell me how this section applies to me?https://code.kx.com/trac/wiki/Cookbook/InterfacingWithC#WindowsandtheloadlibraryapiThanks,DanielOn Aug 22, 7:48?am, Charles Skelton <char…> wrote:> you’ve probably already found>> https://code.kx.com/trac/wiki/Cookbook/InterfacingWithChttps://code.kx.com/trac/wiki/Cookbook/ExtendingWithC&gt;&gt; but maybe not this>> http://kx.com/q/c/c/readme.txt&gt;&gt; the key point being which case you want>> 1. c dynamic load called by q, e.g. analytics> 2. c dynamic load callbacks into q, e.g. feedhandlers> 3. c clients talking to q servers. e.g. feedhandlers and clients(link with c.o)>> I’m guessing you are #3, as you are linking to c.obj - in which case you> don’t need q.lib!>> You would link with q.lib when using #1 or #2.> You would link with c.lib when using #3 and c.dll.>> Remember for #3, you should initialize memory before creating any k objects.>>>>>>>> On Sun, Aug 21, 2011 at 5:08 PM, Daniel <cas…> wrote:> > Hi,>> > I am trying to access a q process with a c++ program on my windows> > machine.>> > I have added q.lib to the linker settings and I have c.obj in the> > project directory. (also tried the debug directory)> > I still recieve the error “The application was unable to start> > correctly (0xc0000005). Click OK to close the application”.>> > Anyone got any ideas?>> > Thanks.>> > –> >

Submitted via Google Groups</cas…></char…>

For #3, that link is relevant for writing a shared library (dll), not a standalone executable; and even then, a dll that is loaded explicitly via loadlibrary rather than binding with c.lib. If you are using loadlibrary, then you can use the single threaded version of c.dll.


thanks

Thanks Charles that makes senseOn Aug 22, 4:11?pm, Charles Skelton <char…> wrote:> For #3, that link is relevant for writing a shared library (dll), not a> standalone executable; and even then, a dll that is loaded explicitly> via loadlibrary rather> than binding with c.lib. If you are using loadlibrary, then you can use the> single threaded version of c.dll.>> thanks>>>>>>>> On Mon, Aug 22, 2011 at 12:10 AM, Daniel <cas…> wrote:> > Hi Charles,>> > Thanks that seems to have worked for me.> > I had been using an old topic on here so they must have been doing 1> > or 2.>> > For 3 can you tell me how this section applies to me?>> >https://code.kx.com/trac/wiki/Cookbook/InterfacingWithC#Windowsandthe...&gt;&gt; > Thanks,> > Daniel>> > On Aug 22, 7:48 am, Charles Skelton <char…> wrote:> > > you’ve probably already found>> >https://code.kx.com/trac/wiki/Cookbook/InterfacingWithChttps://code.k...&gt;&gt; > > but maybe not this>> > >http://kx.com/q/c/c/readme.txt&gt;&gt; > > the key point being which case you want>> > > 1. c dynamic load called by q, e.g. analytics> > > 2. c dynamic load callbacks into q, e.g. feedhandlers> > > 3. c clients talking to q servers. e.g. feedhandlers and clients(link> > with c.o)>> > > I’m guessing you are #3, as you are linking to c.obj - in which case you> > > don’t need q.lib!>> > > You would link with q.lib when using #1 or #2.> > > You would link with c.lib when using #3 and c.dll.>> > > Remember for #3, you should initialize memory before creating any k> > objects.>> > > On Sun, Aug 21, 2011 at 5:08 PM, Daniel <cas…> wrote:> > > > Hi,>> > > > I am trying to access a q process with a c++ program on my windows> > > > machine.>> > > > I have added q.lib to the linker settings and I have c.obj in the> > > > project directory. (also tried the debug directory)> > > > I still recieve the error “The application was unable to start> > > > correctly (0xc0000005). Click OK to close the application”.>> > > > Anyone got any ideas?>> > > > Thanks.>> > > > –> > > > You received this message because you are subscribed to the Google> > Groups> > > > “Kdb+ Personal Developers” group.> > > > To post to this group, send email to personal-kdbplus@googlegroups.com> > .> > > > To unsubscribe from this group, send email to> > > > personal-kdbplus+unsubscribe@googlegroups.com.> > > > For more options, visit this group at> > > >http://groups.google.com/group/personal-kdbplus?hl=en.&gt;&gt; > –> >

Submitted via Google Groups</cas…></char…></cas…></char…>