Hello,
I would like to use the CxImage library in DevC++. (convert bmp to jpg)
I added the .lib to Project -> Project Options -> Parameters -> Linker: CxImage.lib, jpeg.lib
My Code is:
#include <windows.h>
#include "ximage.h"
#include "stdafx.h"
#pragma comment(lib,"CxImage.lib")
#pragma comment(lib,"jpeg.lib")
int main()
{
CxImage image;
image.Load("d:\\image.bmp", CXIMAGE_FORMAT_BMP);
if (image.IsValid())
{
if(!image.IsGrayScale()) image.IncreaseBpp(24);
image.SetJpegQuality(70);
image.Save("d:\\image.jpg",CXIMAGE_FORMAT_JPG);
}
image.Load("d:\\image.jpg", CXIMAGE_FORMAT_JPG);
if (image.IsValid())
{
if(!image.IsGrayScale()) image.IncreaseBpp(24);
image.Save("d:\\image2.bmp",CXIMAGE_FORMAT_BMP);
}
}
image.Load("d:\\image.bmp", CXIMAGE_FORMAT_BMP);
if (image.IsValid())
{
image.Resample(1024/2,768/2,1,0);
image.Save("d:\\imagesize.jpg",CXIMAGE_FORMAT_JPG);
}
return 1;
}
I got errores like these:
[Linker error] undefined reference to `CxImage::CxImage(unsigned long)'
[Linker error] undefined reference to `CxImage::Load(char const*, unsigned long)'
[Linker error] undefined reference to `CxImage::~CxImage()'
[Linker error] undefined reference to `CxImage::~CxImage()'
Also, if I delete the .lib in my proyect, and compile, gives the same error. It looks like the linker doesn't found the functions into the lib, or the lib is corrupted.
I found a code in:
http://codes-sources.commentcamarche.net/source/22754-conversion-bmp-jpeg-avec-librairie-cximage where is the code with the .lib and the .exe (working okay).
Anyone could solve this problem? Thanks a lot guys