Hi guys

This is a question about C++ setting you dont even need to know about the library I am trying to use.

I am coding C++ in VS2010 right now and I am trying to use 'icclib' which was downloaded from http://www.argyllcms.com/icclibsrc.html
I made a new project, added an aditional dependency folder and included a right header file (#include "icc.h")
And I tried to run a sample code which is:

    char *file_name = "C:\\icc\\sample.icm";
    icmFile *wr_fp;

    /* Open up the file for writing */
    if ((wr_fp = new_icmFileStd_name(file_name,"w")) == NULL)
            printf("Write: Can't open file '%s'",file_name);

But I couldnt compile and the error message is:
error LNK2001: unresolved external symbol _new_icmFileStd_name

The library package doesn't even have any lib and dll files in it.

I actually have been facing this kind of errors so much everytime I try to use open source libraries and I don't know how to fix it.. Would you guys please give me some advices?

Recommended Answers

All 5 Replies

It looks like you're not linking to icclib. If you downloaded it from the link you provided, you only have source code, so you'll have to either build it as well, or find a lib file someone has already built.

It looks like all you get is the library's source code. You will have to compile the library yourself to generate the *.lib or *.dll

Did you add the icc.c file to the project? This is a header and c file library so you need to include the c file in the project.

How can I build lib file with the souce code?

Create a new library project containing icc.c. This file depends on icc.h, iccstd.c and iccV42.h, so make sure they still exist (the other C files are for tools and test programs). MSDN has some articles about creating and linking to libraries.

If you don't care about having a separate library, you can add icc.c to your project directly; that should work as well.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.