Hi,

I've got a problem building an LCMS project for Win32. I've built several previous projects using LCMS with no problems so I'm surprised to have run into this one.

The program is a very trivial affair that converts and XYZ value into RGB and prints the result. It does this in an endless loop.

Compiled for Linux, (Mandrake 9.2, LCMS 1.14, G++, 3.3.1) with
g++ lcmstest.cpp -llcms
it does indeed loop until killed.

Compiled for Win32, with
i586-mingw32msvc-g++ lcmstest -L. -llcms
it does this:
wine: Unhandled exception (thread 0009), starting debugger...
WineDbg starting on pid 0x8
Unhandled exception: page fault on write access to 0x999999a2 in 32-bit code (0x00401271).
(It's not a WINE bug - it crashes on a real windows box too)

The code itself is as follows:

--

#include <iostream>

#define PACKAGE_NAME "cmstest"
#include <lcms.h>

#include <stdlib.h>

using namespace std;

void GetMeasurement(double *vals)
{
        cout << "Fetching values:"  << endl;
        vals[0]=0.2;
        vals[1]=0.2;
        vals[2]=0.2;
}


int main(int argc,char **argv)
{
        cmsHPROFILE xyz=cmsCreateXYZProfile();
        cmsHPROFILE rgb=cmsCreate_sRGBProfile();
cmsHTRANSFORM trans=cmsCreateTransform(xyz,TYPE_XYZ_DBL,rgb,TYPE_RGB_16,INTENT_ABSOLUTE_COLORIMETRIC,0);

        while(1)
        {
                double src[3];
                unsigned short dst[3];

                GetMeasurement(src);

cout << "X: " << src[0] << ", Y: " << src[1] << ", Z: " << src[2] << " -> ";
                cmsDoTransform(trans,src,dst,1);
                cout << "R: " << dst[0] << ", G: " << dst[1] << ", B: " << dst[2] 
<< endl;
        }
        cmsDeleteTransform(trans);
        cmsCloseProfile(rgb);
        cmsCloseProfile(xyz);

        return(0);
}

--

The code, binary and DLL are at
http://www.blackfiveservices.co.uk/bugtest.zip if anyone has time to take a look.

Am I doing some spectacularly stupid here, or is it a GCC bug, or an LCMS bug?

All the best,
--
Alastair M. Robinson



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to