login about faq

I can not compile on linux or windows with NetBeans C++ or CodeBlock C++.......

main.cpp:7: undefined reference to CkSocket_Create()'
main.cpp:9: undefined reference toCkSocket_Dispose(void*)'

g++ -m32 -o main.o -L/chilkat-9.4.0-mingw -lchilkat-9.4.0 -Wl,--enable-auto-import

Tested with NetBeans and Code::Blocks..... Help......

asked Apr 15 '13 at 09:29

chilkat's gravatar image

chilkat ♦♦

(I'm not sure why one would choose to use the Chilkat "C" API within a C++ program because it would be more natural to use the Chilkat C++ classes instead.)

To include the Chilkat "C" API headers within a C++ source file, make sure to wrap it in extern "C", such as the following:

extern "C" {

// Include Chilkat "C" headers here...

If your application source is compiled as a C++ source, then the names are mangled according to the C++ compiler's name decoration rules. See http://en.wikipedia.org/wiki/Name_mangling A "C" compiler does not mangle names. Therefore, if you compile "C" declarations as a C++ source, you'll get undefined references and/or unresolved externals.

answered Apr 15 '13 at 09:35

chilkat's gravatar image

chilkat ♦♦

edited Apr 15 '13 at 09:38

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Apr 15 '13 at 09:29

Seen: 3,837 times

Last updated: Apr 15 '13 at 09:38

powered by OSQA