KDB C++ Windows Project

154 views
Skip to first unread message

Daniel

unread,
Aug 21, 2011, 11:08:14 AM8/21/11
to Kdb+ Personal Developers
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.

Charles Skelton

unread,
Aug 21, 2011, 5:48:04 PM8/21/11
to personal...@googlegroups.com
you've probably already found

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

but maybe not this


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.


--
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...@googlegroups.com.
To unsubscribe from this group, send email to personal-kdbpl...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/personal-kdbplus?hl=en.


Daniel

unread,
Aug 21, 2011, 6:10:45 PM8/21/11
to Kdb+ Personal Developers
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#Windowsandtheloadlibraryapi

Thanks,
Daniel

On Aug 22, 7:48 am, Charles Skelton <char...@kx.com> wrote:
> you've probably already found
>
> https://code.kx.com/trac/wiki/Cookbook/InterfacingWithChttps://code.kx.com/trac/wiki/Cookbook/ExtendingWithC

Charles Skelton

unread,
Aug 22, 2011, 2:11:02 AM8/22/11
to personal...@googlegroups.com
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

Daniel

unread,
Aug 22, 2011, 7:00:16 AM8/22/11
to Kdb+ Personal Developers
Thanks Charles that makes sense

On Aug 22, 4:11 pm, Charles Skelton <char...@kx.com> 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...@gmail.com> 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...
>
> > Thanks,
> > Daniel
>
> > On Aug 22, 7:48 am, Charles Skelton <char...@kx.com> wrote:
> > > you've probably already found
>
> >https://code.kx.com/trac/wiki/Cookbook/InterfacingWithChttps://code.k...
Reply all
Reply to author
Forward
0 new messages