Compile CharLS

Dec 23, 2010 at 10:44 AM
Edited Dec 23, 2010 at 11:15 AM



I'am using CharLS to decompress data in a dng raw file. I have a problem to compile CharLS. The error is in the scan.h file. The compiler says on several places something like this:

In member function `LONG JlsCodec<TRAITS, STRATEGY>::DecodeRIError(CContextRunMode&)':|
D:\Azer\ETF\Hash\dads\scan.h|431|error: `J' was not declared in this scope|


The other files have been properly compiled.


Dec 24, 2010 at 6:16 PM

Which compiler (mention version), and which version of CharLS? Do you build using CMAKE, devstudio, or other means?  

For my curiosity, what is dng?

Dec 24, 2010 at 8:34 PM

I'm using CharLS-source-1.0 and the gnu gcc 3.4.5 compiler. It won't compile even this simple code:!download|24cg|439100766|main.cpp|0

First, I was building in qt creator, but this sample code was build on code blocks 8.02.


And dng, thats just a raw image format created by adobe:


Dec 25, 2010 at 2:22 PM

Thanks for the info!

As for the file you posted, that won't compile. There are some implicit dependencies between scan.h and other files, requiring some definitions to be present, and a fixed order. I can imagine two things going wrong: Either there is a bug in GCC, causing the lookup to fail, or you might have inadvertidly modified the sources. 

scan.h should be included from  JpegLS.cpp only, and the definition for J is a few lines before scan.h is included.

Could you move the definition for J inside scan.h? It should work the some, but maybe we'll learn something.