opendcp icon indicating copy to clipboard operation
opendcp copied to clipboard

Building error on Ubuntu 16.04

Open liloneum opened this issue 7 years ago • 2 comments

At the make step, I have this error:

[ 46%] Building C object libopendcp/CMakeFiles/opendcp-lib.dir/opendcp_image.c.o $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c: In function ‘opendcp_image_float_create’: $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c:105:44: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] image->component[x].float_data = (int *)malloc((w * h) * sizeof(int)); ^ $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c: In function ‘opendcp_image_readline_float’: $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c:257:49: error: expected ‘;’ before ‘)’ token dbuffer[d + 1] = (pixel0_b & 0x0f) << 4 ) | ((pixel0_g >> 8) & 0x0f); ^ $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c:257:49: error: expected statement before ‘)’ token $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c:257:51: error: expected expression before ‘|’ token dbuffer[d + 1] = (pixel0_b & 0x0f) << 4 ) | ((pixel0_g >> 8) & 0x0f); ^ $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c:260:49: error: expected ‘;’ before ‘)’ token dbuffer[d + 4] = (pixel0_r & 0x0f) << 4 ) | ((pixel1_b >> 8) & 0x0f); ^ $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c:260:49: error: expected statement before ‘)’ token $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c:260:51: error: expected expression before ‘|’ token dbuffer[d + 4] = (pixel0_r & 0x0f) << 4 ) | ((pixel1_b >> 8) & 0x0f); ^ $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c:263:61: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses] dbuffer[d + 7] = (pixel1_g << 4 ) | (pixel1_r >> 8) & 0x0f); ^ $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c:263:67: error: expected ‘;’ before ‘)’ token dbuffer[d + 7] = (pixel1_g << 4 ) | (pixel1_r >> 8) & 0x0f); ^ $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c:263:67: error: expected statement before ‘)’ token $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c: At top level: $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c:387:7: error: conflicting types for ‘dci_transfer’ float dci_transfer(float p) { ^ $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c:376:5: note: previous definition of ‘dci_transfer’ was here int dci_transfer(float p) { ^ $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c:405:7: error: conflicting types for ‘dci_transfer_inverse’ float dci_transfer_inverse(float p) { ^ $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c:398:5: note: previous definition of ‘dci_transfer_inverse’ was here int dci_transfer_inverse(float p) { ^ $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c: In function ‘rgb_to_xyz_float’: $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c:431:14: warning: implicit declaration of function ‘rgb_to_xyz_calculate_float’ [-Wimplicit-function-declaration] result = rgb_to_xyz_calculate_float(image, index); ^ $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c: In function ‘rgb_to_xyz_calculate_float’: $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c:516:45: warning: implicit declaration of function ‘dci_transfer_float’ [-Wimplicit-function-declaration] image->component[0].float_data[i] = dci_transfer_float(d.x); ^ $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c: In function ‘resize_float’: $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c:772:32: warning: implicit declaration of function ‘opendcp_image_create_float’ [-Wimplicit-function-declaration] opendcp_image_t *d_image = opendcp_image_create_float(num_components, w, h); ^ $/OpenDCP/opendcp-master/libopendcp/opendcp_image.c:772:32: warning: initialization makes pointer from integer without a cast [-Wint-conversion] libopendcp/CMakeFiles/opendcp-lib.dir/build.make:206 : la recette pour la cible « libopendcp/CMakeFiles/opendcp-lib.dir/opendcp_image.c.o » a échouée make[2]: *** [libopendcp/CMakeFiles/opendcp-lib.dir/opendcp_image.c.o] Erreur 1 CMakeFiles/Makefile2:251 : la recette pour la cible « libopendcp/CMakeFiles/opendcp-lib.dir/all » a échouée make[1]: *** [libopendcp/CMakeFiles/opendcp-lib.dir/all] Erreur 2 Makefile:149 : la recette pour la cible « all » a échouée make: *** [all] Erreur 2

Did I make anything wrong?

liloneum avatar Apr 11 '17 07:04 liloneum

No, you aren't doing anything wrong. It looks like this library has not been building for a while. I've got a version that I think is fixed over at https://github.com/matthewharvey/opendcp

I run on a Debian system, so that should be pretty close to Ubuntu. For my system, because of a newer version of OpenSSL, I also had to make some additional changes, which are in the openssl1.10 branch of that same repository.

matthewharvey avatar Apr 30 '17 19:04 matthewharvey

There is also a version here: https://github.com/SieuDoTia/opendcp

Which looks like it's a better fix than mine. I had to rebase off of this repository to be able to apply my openssl1.10 branch "fixes". As long as you aren't using OpenEXR files it should be fine to use either one.

matthewharvey avatar Apr 30 '17 20:04 matthewharvey