It runs fine if compiled with vc7.1

I bet that crash is because you are mixing DLL compiled with
MSVC and using StdCall convention with mingw port, which
expects cdecl convention.
Solution:

Just compile the shared object using the standard way ./configure make
make install

And then use that DLL instead of the DLL I provide in the site. This works to me.

Else, if you have a complete windows clone, try to add
-DLCMS_DLL in the command line options. But just recompiling the DLL should do the trick.

Marti.


----- Original Message ----- From: "Alastair M. Robinson" <[EMAIL PROTECTED]>
To: <lcms-user@lists.sourceforge.net>
Sent: Friday, July 29, 2005 4:07 PM
Subject: [Lcms-user] Problem with LCMS and mingw32


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



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.9.4/57 - Release Date: 22/07/2005




--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.9.4/57 - Release Date: 22/07/2005



-------------------------------------------------------
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