views:

75

answers:

2

Right so i'm trying to use a C library in C++, never actually done this before i thought it would be a case of declaring the header includes under a extern "C" and setting the compile as flag to "default" but i'm still getting linker errors and think that the header file might have to be complied as a DLL. I have no idea really.

Is it the library that's the problem or is it me? There are some make files in the cluster-1.47\src, but i don't know how or if they relate to "cluster.h". I've uploaded a visual studio 2008 project for anyone to take a gander, any help would be appreciated as i've been hitting my head against the wall for time now.

thanks

Stefan

Link to Visual Studio 2008 Project

A: 

You probably need to add the library file (.lib) to the project. One way is to add it to the Additional Dependencies value under the Linker settings in the Input section.

I looked a bit more at that project and see that there is a folder/directory under it that has the source code with the function you are referencing. I did not look to see if it is complete nor am I familiar with that library. But maybe you can simply add those files to your project.

Mark Wilkins
ah but there is no static library file only header files.i get an stating that it can't find the function referenced in _winmain. yet intellisense picks up the signature.
Stefan K.
@Stefan: Is there an existing DLL that contains that function?
Mark Wilkins
A: 

A header file only contains function declarations. You also need the implementation of those functions, which will be contained in the .c files, if the library is distributed as source, or in the .LIB and/or .DLL file if the library is a binary distribution. In either case. the .h files alone are not sufficient.

anon