I am having error while building skia by macos

1,276 views
Skip to first unread message

miniwika

unread,
Oct 15, 2017, 7:15:18 PM10/15/17
to skia-discuss
Hi, 

I am following the instruction of how to build skia, but i am getting this error 

../../src/codec/SkJpegCodec.cpp:301:58: error: use of undeclared identifier 'JCS_RGB565'; did you mean 'JCS_RGB'?

    const size_t colorBytes = (dinfo->out_color_space == JCS_RGB565) ? 2 :

                                                         ^~~~~~~~~~

                                                         JCS_RGB

/usr/local/include/jpeglib.h:218:2: note: 'JCS_RGB' declared here

        JCS_RGB,                /* red/green/blue */

        ^

../../src/codec/SkJpegCodec.cpp:394:53: error: use of undeclared identifier 'JCS_EXT_RGBA'

            fDecoderMgr->dinfo()->out_color_space = JCS_EXT_RGBA;

                                                    ^

../../src/codec/SkJpegCodec.cpp:400:57: error: use of undeclared identifier 'JCS_EXT_RGBA'

                fDecoderMgr->dinfo()->out_color_space = JCS_EXT_RGBA;

                                                        ^

../../src/codec/SkJpegCodec.cpp:402:57: error: use of undeclared identifier 'JCS_EXT_BGRA'

                fDecoderMgr->dinfo()->out_color_space = JCS_EXT_BGRA;

                                                        ^

../../src/codec/SkJpegCodec.cpp:407:57: error: use of undeclared identifier 'JCS_EXT_RGBA'

                fDecoderMgr->dinfo()->out_color_space = JCS_EXT_RGBA;

                                                        ^

../../src/codec/SkJpegCodec.cpp:410:57: error: use of undeclared identifier 'JCS_RGB565'; did you mean 'JCS_RGB'?

                fDecoderMgr->dinfo()->out_color_space = JCS_RGB565;

                                                        ^~~~~~~~~~

                                                        JCS_RGB

/usr/local/include/jpeglib.h:218:2: note: 'JCS_RGB' declared here

        JCS_RGB,                /* red/green/blue */

        ^

../../src/codec/SkJpegCodec.cpp:427:53: error: use of undeclared identifier 'JCS_EXT_RGBA'

            fDecoderMgr->dinfo()->out_color_space = JCS_EXT_RGBA;

                                                    ^

../../src/codec/SkJpegCodec.cpp:703:9: error: use of undeclared identifier 'jpeg_crop_scanline'

        jpeg_crop_scanline(fDecoderMgr->dinfo(), &startX, &width);

        ^

../../src/codec/SkJpegCodec.cpp:757:32: error: use of undeclared identifier 'jpeg_skip_scanlines'

    return (uint32_t) count == jpeg_skip_scanlines(fDecoderMgr->dinfo(), count);

Hal Canary

unread,
Oct 15, 2017, 7:42:15 PM10/15/17
to skia-discuss
Which version of jpeglib do you have installed?

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.

miniwika

unread,
Oct 15, 2017, 7:50:26 PM10/15/17
to skia-discuss

libjpeg.8.dylib

libjpeg.a

libjpeg.dylib

To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.

miniwika

unread,
Oct 15, 2017, 8:04:48 PM10/15/17
to skia-discuss
I have just upgrade to jpeg 9b and I check the jpeglib.h i for JCS prefix and it show

JCS_UNKNOWN, /* error/unspecified */

JCS_GRAYSCALE, /* monochrome */

JCS_RGB, /* red/green/blue, standard RGB (sRGB) */

JCS_YCbCr, /* Y/Cb/Cr (also known as YUV), standard YCC */

JCS_CMYK, /* C/M/Y/K */

JCS_YCCK, /* Y/Cb/Cr/K */

JCS_BG_RGB, /* big gamut red/green/blue, bg-sRGB */

JCS_BG_YCC /* big gamut Y/Cb/Cr, bg-sYCC */

miniwika

unread,
Oct 16, 2017, 8:26:28 AM10/16/17
to skia-discuss
I've fixed it by setting 

is_official_build=false

Mike Klein

unread,
Oct 16, 2017, 9:23:00 AM10/16/17
to skia-discuss
Skia requires libjpeg-turbo, not libjpeg.  What you're seeing missing are the APIs that Skia uses from libjpeg-turbo that were not originally present in libjpeg.

Here's a recent thread with a little more about this: https://groups.google.com/forum/#!topic/skia-discuss/8QCDED4S_Zo

miniwika

unread,
Oct 17, 2017, 1:48:18 AM10/17/17
to skia-discuss
HI Mike,

It is working with official build now after install libjpeg-turbo.

Thanks,

Julien

unread,
Aug 17, 2021, 5:09:30 AM8/17/21
to skia-discuss
Running into a similar issue when compiling OsmAnd-core-legacy which depends on skia.  (Xcode 9.2 on Mac OS Sierra 10.12 make 3.81)
I have installed libjpeg-turbo with brew but it does not help. 

How do I force `make` to use libjpeg-turbo instead of libjpeg ?

------------------------------------------------------------------------------------------
Consolidate compiler generated dependencies of target skia_osmand
[ 22%] Building CXX object skia/CMakeFiles/skia_osmand.dir/Users/julien/Documents/WORKSPACE/OSMAND/OsmAnd-core-legacy/externals/skia/upstream.patched/src/images/SkJpegEncoder.cpp.o
[ 22%] Building CXX object skia/CMakeFiles/skia_osmand.dir/Users/julien/Documents/WORKSPACE/OSMAND/OsmAnd-core-legacy/externals/skia/upstream.patched/src/pathops/SkOpAngle.cpp.o
[ 22%] Building CXX object skia/CMakeFiles/skia_osmand.dir/Users/julien/Documents/WORKSPACE/OSMAND/OsmAnd-core-legacy/externals/skia/upstream.patched/src/pathops/SkIntersections.cpp.o
[ 22%] Building CXX object skia/CMakeFiles/skia_osmand.dir/Users/julien/Documents/WORKSPACE/OSMAND/OsmAnd-core-legacy/externals/skia/upstream.patched/src/pathops/SkDQuadLineIntersection.cpp.o
/Users/julien/Documents/WORKSPACE/OSMAND/OsmAnd-core-legacy/externals/skia/upstream.patched/src/images/SkJpegEncoder.cpp:79:35: error: use of undeclared identifier 'JCS_EXT_RGBA'
    J_COLOR_SPACE jpegColorType = JCS_EXT_RGBA;
                                  ^
/Users/julien/Documents/WORKSPACE/OSMAND/OsmAnd-core-legacy/externals/skia/upstream.patched/src/images/SkJpegEncoder.cpp:84:29: error: use of undeclared identifier 'JCS_EXT_RGBA'
            jpegColorType = JCS_EXT_RGBA;
                            ^
/Users/julien/Documents/WORKSPACE/OSMAND/OsmAnd-core-legacy/externals/skia/upstream.patched/src/images/SkJpegEncoder.cpp:89:29: error: use of undeclared identifier 'JCS_EXT_BGRA'
            jpegColorType = JCS_EXT_BGRA;
                            ^
/Users/julien/Documents/WORKSPACE/OSMAND/OsmAnd-core-legacy/externals/skia/upstream.patched/src/images/SkJpegEncoder.cpp:118:29: error: use of undeclared identifier 'JCS_EXT_RGBA'
            jpegColorType = JCS_EXT_RGBA;
                            ^
4 errors generated.
make[2]: *** [skia/CMakeFiles/skia_osmand.dir/Users/julien/Documents/WORKSPACE/OSMAND/OsmAnd-core-legacy/externals/skia/upstream.patched/src/images/SkJpegEncoder.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [skia/CMakeFiles/skia_osmand.dir/all] Error 2
make: *** [all] Error 2
Reply all
Reply to author
Forward
0 new messages