The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

richardmcatlin (2) [Avatar] Offline
#1
These projects do not compile. Thanks for the help. Great book by the way. Richard Catlin


Ch2 program_build
Richard-Catlins-MacBook-Pro:platform_ext_test richardcatlin$ cd ../program_build/
Richard-Catlins-MacBook-Pro:program_build richardcatlin$ make
gcc -std=c99 -Wall -DUNIX -g -DDEBUG -DMAC -arch i386 -o program_build program_build.c -framework OpenCL
program_build.c: In function ‘main’:
program_build.c:69: warning: implicit declaration of function ‘Fseek’
Undefined symbols:
"_Fseek", referenced from:
_main in cc8sfvOo.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [program_build] Error 1


Ch3 buffer_check
Richard-Catlins-MacBook-Pro:buffer_check richardcatlin$ pwd
/Users/richardcatlin/ErlangProjects/openCLInAction_gnu/Ch3/buffer_check
Richard-Catlins-MacBook-Pro:buffer_check richardcatlin$ make
gcc -std=c99 -Wall -DUNIX -g -DDEBUG -DMAC -arch i386 -o buffer_check buffer_check.c -framework OpenCL
buffer_check.c: In function ‘main’:
buffer_check.c:50: error: ‘cl_buffer_region’ undeclared (first use in this function)
buffer_check.c:50: error: (Each undeclared identifier is reported only once
buffer_check.c:50: error: for each function it appears in.)
buffer_check.c:50: error: expected ‘;’ before ‘region’
buffer_check.c:69: error: ‘region’ undeclared (first use in this function)
buffer_check.c:71: warning: implicit declaration of function ‘clCreateSubBuffer’
buffer_check.c:72: error: ‘CL_BUFFER_CREATE_TYPE_REGION’ undeclared (first use in this function)
buffer_check.c:72: warning: assignment makes pointer from integer without a cast
make: *** [buffer_check] Error 1

Ch3 buffer_test

Richard-Catlins-MacBook-Pro:Ch3 richardcatlin$ cd buffer_test/
Richard-Catlins-MacBook-Pro:buffer_test richardcatlin$ make
gcc -std=c99 -Wall -DUNIX -g -DDEBUG -DMAC -arch i386 -o buffer_test buffer_test.c -framework OpenCL
buffer_test.c: In function ‘main’:
buffer_test.c:170: warning: implicit declaration of function ‘clEnqueueReadBufferRect’
Undefined symbols:
"_clEnqueueReadBufferRect", referenced from:
_main in cc8NrHBC.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [buffer_test] Error 1


Ch6 interp

Richard-Catlins-MacBook-Pro:Ch6 richardcatlin$ cd interp/
Richard-Catlins-MacBook-Pro:interp richardcatlin$ make
gcc -std=c99 -Wall -DUNIX -g -DDEBUG -DMAC -arch i386 -o interp interp.c -lpng -framework OpenCL
interp.c:8:17: error: png.h: No such file or directory
interp.c:101: error: expected declaration specifiers or ‘...’ before ‘png_bytep’
interp.c:101: error: expected declaration specifiers or ‘...’ before ‘png_bytep’
interp.c: In function ‘read_image_data’:
interp.c:113: error: ‘png_structp’ undeclared (first use in this function)
interp.c:113: error: (Each undeclared identifier is reported only once
interp.c:113: error: for each function it appears in.)
interp.c:113: error: expected ‘;’ before ‘png_ptr’
interp.c:114: error: ‘png_infop’ undeclared (first use in this function)
interp.c:114: error: expected ‘;’ before ‘info_ptr’
interp.c:115: warning: implicit declaration of function ‘png_init_io’
interp.c:115: error: ‘png_ptr’ undeclared (first use in this function)
interp.c:116: warning: implicit declaration of function ‘png_read_info’
interp.c:116: error: ‘info_ptr’ undeclared (first use in this function)
interp.c:117: warning: implicit declaration of function ‘png_get_image_width’
interp.c:118: warning: implicit declaration of function ‘png_get_image_height’
interp.c:121: error: ‘input’ undeclared (first use in this function)
interp.c:121: warning: implicit declaration of function ‘png_get_rowbytes’
interp.c:122: error: ‘output’ undeclared (first use in this function)
interp.c:124: warning: implicit declaration of function ‘png_read_row’
interp.c:128: warning: implicit declaration of function ‘png_read_end’
interp.c:129: warning: implicit declaration of function ‘png_destroy_read_struct’
interp.c:129: error: ‘png_infopp’ undeclared (first use in this function)
interp.c: At top level:
interp.c:133: error: expected declaration specifiers or ‘...’ before ‘png_bytep’
interp.c: In function ‘write_image_data’:
interp.c:145: error: ‘png_structp’ undeclared (first use in this function)
interp.c:145: error: expected ‘;’ before ‘png_ptr’
interp.c:146: error: ‘png_infop’ undeclared (first use in this function)
interp.c:146: error: expected ‘;’ before ‘info_ptr’
interp.c:147: error: ‘png_ptr’ undeclared (first use in this function)
interp.c:148: warning: implicit declaration of function ‘png_set_IHDR’
interp.c:148: error: ‘info_ptr’ undeclared (first use in this function)
interp.c:149: error: ‘PNG_COLOR_TYPE_GRAY’ undeclared (first use in this function)
interp.c:149: error: ‘PNG_INTERLACE_NONE’ undeclared (first use in this function)
interp.c:150: error: ‘PNG_COMPRESSION_TYPE_BASE’ undeclared (first use in this function)
interp.c:150: error: ‘PNG_FILTER_TYPE_BASE’ undeclared (first use in this function)
interp.c:151: warning: implicit declaration of function ‘png_write_info’
interp.c:153: warning: implicit declaration of function ‘png_write_row’
interp.c:153: error: ‘data’ undeclared (first use in this function)
interp.c:157: warning: implicit declaration of function ‘png_write_end’
interp.c:158: warning: implicit declaration of function ‘png_destroy_write_struct’
interp.c: In function ‘main’:
interp.c:174: error: ‘png_bytep’ undeclared (first use in this function)
interp.c:174: error: expected ‘;’ before ‘input_pixels’
interp.c:181: error: ‘input_pixels’ undeclared (first use in this function)
interp.c:181: error: ‘output_pixels’ undeclared (first use in this function)
interp.c:181: error: too many arguments to function ‘read_image_data’
interp.c:260: error: too many arguments to function ‘write_image_data’
make: *** [interp] Error 1


Ch6 simple_image

Richard-Catlins-MacBook-Pro:simple_image richardcatlin$ make
gcc -std=c99 -Wall -DUNIX -g -DDEBUG -DMAC -arch i386 -o simple_image simple_image.c -lpng -framework OpenCL
simple_image.c:6:17: error: png.h: No such file or directory
simple_image.c:99: error: expected declaration specifiers or ‘...’ before ‘png_bytep’
simple_image.c: In function ‘read_image_data’:
simple_image.c:111: error: ‘png_structp’ undeclared (first use in this function)
simple_image.c:111: error: (Each undeclared identifier is reported only once
simple_image.c:111: error: for each function it appears in.)
simple_image.c:111: error: expected ‘;’ before ‘png_ptr’
simple_image.c:112: error: ‘png_infop’ undeclared (first use in this function)
simple_image.c:112: error: expected ‘;’ before ‘info_ptr’
simple_image.c:113: warning: implicit declaration of function ‘png_init_io’
simple_image.c:113: error: ‘png_ptr’ undeclared (first use in this function)
simple_image.c:114: warning: implicit declaration of function ‘png_read_info’
simple_image.c:114: error: ‘info_ptr’ undeclared (first use in this function)
simple_image.c:115: warning: implicit declaration of function ‘png_get_image_width’
simple_image.c:116: warning: implicit declaration of function ‘png_get_image_height’
simple_image.c:119: error: ‘data’ undeclared (first use in this function)
simple_image.c:119: warning: implicit declaration of function ‘png_get_rowbytes’
simple_image.c:121: warning: implicit declaration of function ‘png_read_row’
simple_image.c:125: warning: implicit declaration of function ‘png_read_end’
simple_image.c:126: warning: implicit declaration of function ‘png_destroy_read_struct’
simple_image.c:126: error: ‘png_infopp’ undeclared (first use in this function)
simple_image.c: At top level:
simple_image.c:130: error: expected declaration specifiers or ‘...’ before ‘png_bytep’
simple_image.c: In function ‘write_image_data’:
simple_image.c:142: error: ‘png_structp’ undeclared (first use in this function)
simple_image.c:142: error: expected ‘;’ before ‘png_ptr’
simple_image.c:143: error: ‘png_infop’ undeclared (first use in this function)
simple_image.c:143: error: expected ‘;’ before ‘info_ptr’
simple_image.c:144: error: ‘png_ptr’ undeclared (first use in this function)
simple_image.c:145: warning: implicit declaration of function ‘png_set_IHDR’
simple_image.c:145: error: ‘info_ptr’ undeclared (first use in this function)
simple_image.c:146: error: ‘PNG_COLOR_TYPE_GRAY’ undeclared (first use in this function)
simple_image.c:146: error: ‘PNG_INTERLACE_NONE’ undeclared (first use in this function)
simple_image.c:147: error: ‘PNG_COMPRESSION_TYPE_BASE’ undeclared (first use in this function)
simple_image.c:147: error: ‘PNG_FILTER_TYPE_BASE’ undeclared (first use in this function)
simple_image.c:148: warning: implicit declaration of function ‘png_write_info’
simple_image.c:150: warning: implicit declaration of function ‘png_write_row’
simple_image.c:150: error: ‘data’ undeclared (first use in this function)
simple_image.c:154: warning: implicit declaration of function ‘png_write_end’
simple_image.c:155: warning: implicit declaration of function ‘png_destroy_write_struct’
simple_image.c: In function ‘main’:
simple_image.c:171: error: ‘png_bytep’ undeclared (first use in this function)
simple_image.c:171: error: expected ‘;’ before ‘pixels’
simple_image.c:178: error: ‘pixels’ undeclared (first use in this function)
simple_image.c:178: error: too many arguments to function ‘read_image_data’
simple_image.c:244: error: too many arguments to function ‘write_image_data’
make: *** [simple_image] Error 1