简体   繁体   中英

Using the C Cluster library in Visual C++

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM