Compile cximage in Linux

Source: Internet
Author: User

There is a cximage source package that is said to be able to be compiled in Linux on the Internet, but there are several problems encountered during compilation:

1. All eight subdirectories must be compiled.
Cximage j2k Jasper jbig jpeg png tiff zlib
Generate eight static databases. Indispensable.
The original makefile only generates five lib
Convert subdirs = zlib JPEG tiff PNG cximage of the original makefile
To:
Subdirs = zlib JPEG tiff PNG cximage j2k Jasper JBIG
Alternatively, you can manually enter a separate make file under the subdirectory. Equivalent Effect.

2. An error occurred while compiling the file jpc_cs.c when libjasper. A was generated, prompting undefined ulong.
Very strange. Manually add the Definition Statement to the file jpc_cs.h:
# Ifndef ulong
Typedef unsigned long ulong;
# Endif

3. Wrote a simple test.ProgramDemo: add all eight lib libraries. The command is as follows:
Gcc-O demo. O-l ../build-Linux-l cximage-l j2k-l JPEG-l JBIG-l Tiff-l PNG-l zlib-l Jasper
A large number of errors are prompted (the error messages are all garbled, unreadable, and dizzy .. I guess I cannot find anything used in Lib), and so on:
.. /Build-Linux/libcximage. A (ximapcx. o): ximapcx. CPP :(. text + 0xa25) when there are too many errors _ cxa_allocate_exception when there are too many errors
I used a bunch of garbled code to go to Google and found something. Find the one that says you want to add-lstdc ++
I tried it. It is feasible.
(Google stuff: Glibc and stdc ++ are not included in GCC. If C or C ++ is used,
When linking, we need to add the corresponding library glibc or stdc ++. If not, compile it by yourself .)

4. Make the example complex and add read conversion. Connection error:

../Build-Linux/libjasper. A (jpg_enc.o)
../Build-Linux/libjasper. A (jpg_dec.o)
The specific error is not clear, garbled, and only the connection error is known. Very strange.
Copy the O files of the two files to the demo directory and manually add them when generating the files:
Gcc-O demo. O jpg_enc.o jpg_dec.o-l .. /build-Linux-l cximage-l j2k-l JPEG-l JBIG-l Tiff-l PNG-l zlib-l Jasper-lstdc ++
Compiled. The operation is correct.

Too many are unclear. Linux is too difficult. Adapt slowly ~~~

recent connections to automatically generate makefile:
easily generate makefile
http://bbs.chinaunix.net/viewthread.php? Tid = 52375 & extra = Page % 3d13% 26amp % 3 bfilter % 3 ddigest
learn to use autotools
http://bbs.chinaunix.net/viewthread.php? Tid = 727270 & extra = Page % 3d2% 26amp % 3 bfilter % 3 ddigest
Autoconf/automake Tool Group Overview
http://book.51cto.com/art/200811/97013.htm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.