<div dir="ltr"><div><div><div><div><div><div><div> Hi Mr. Gilbert,<br><br></div><b>1. This is the contents of mHeader.m:</b><br><br>function [methodinfo,structs,enuminfo,ThunkLibName]=mHeader<br>%MHEADER Create structures to define interfaces found in 'openslide'.<br>
<br>%This function was generated by loadlibrary.m parser version 1.1.6.37 on Thu Jun 26 10:15:12 2014<br>%perl options:'openslide.i -outfile=mHeader.m -thunkfile=libopenslide0x2D0_thunk_glnxa64.c -header=openslide.h'<br>
ival={cell(1,0)}; % change 0 to the actual number of functions to preallocate the data.<br>structs=[];enuminfo=[];fcnNum=1;<br>fcns=struct('name',ival,'calltype',ival,'LHS',ival,'RHS',ival,'alias',ival,'thunkname', ival);<br>
MfilePath=fileparts(mfilename('fullpath'));<br>ThunkLibName=fullfile(MfilePath,'libopenslide0x2D0_thunk_glnxa64');<br>% __attribute__ (( visibility (" default "))) _Bool openslide_can_open ( const char * filename ); <br>
fcns.thunkname{fcnNum}='(visibility("default")))_Boolopenslide_can_open(char*filenameThunk';<a href="http://fcns.name" target="_blank">fcns.name</a>{fcnNum}='__attribute__'; fcns.alias{fcnNum}='attribute__'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='error'; fcns.RHS{fcnNum}={'error'};fcnNum=fcnNum+1;<br>
% __attribute__ (( visibility (" default "))) openslide_t * openslide_open ( const char * filename ); <br>fcns.thunkname{fcnNum}='(visibility("default")))openslide_t*openslide_open(char*filenameThunk';<a href="http://fcns.name" target="_blank">fcns.name</a>{fcnNum}='__attribute__'; fcns.alias{fcnNum}='attribute__'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='error'; fcns.RHS{fcnNum}={'error'};fcnNum=fcnNum+1;<br>
% __attribute__ (( visibility (" default "))) int32_t openslide_get_level_count ( openslide_t * osr ); <br>fcns.thunkname{fcnNum}='(visibility("default")))int32_topenslide_get_level_count(openslide_t*osrThunk';<a href="http://fcns.name" target="_blank">fcns.name</a>{fcnNum}='__attribute__'; fcns.alias{fcnNum}='attribute__'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='error'; fcns.RHS{fcnNum}={'error'};fcnNum=fcnNum+1;<br>
% __attribute__ (( visibility (" default "))) void openslide_close ( openslide_t * osr ); <br>fcns.thunkname{fcnNum}='(visibility("default")))voidopenslide_close(openslide_t*osrThunk';<a href="http://fcns.name" target="_blank">fcns.name</a>{fcnNum}='__attribute__'; fcns.alias{fcnNum}='attribute__'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='error'; fcns.RHS{fcnNum}={'error'};fcnNum=fcnNum+1;<br>
% __attribute__ (( visibility (" default "))) const char * openslide_get_error ( openslide_t * osr ); <br>fcns.thunkname{fcnNum}='(visibility("default")))char*openslide_get_error(openslide_t*osrThunk';<a href="http://fcns.name" target="_blank">fcns.name</a>{fcnNum}='__attribute__'; fcns.alias{fcnNum}='attribute__'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='error'; fcns.RHS{fcnNum}={'error'};fcnNum=fcnNum+1;<br>
% __attribute__ (( visibility (" default "))) const char * const * openslide_get_property_names ( openslide_t * osr ); <br>fcns.thunkname{fcnNum}='(visibility("default")))char*const*openslide_get_property_names(openslide_t*osrThunk';<a href="http://fcns.name" target="_blank">fcns.name</a>{fcnNum}='__attribute__'; fcns.alias{fcnNum}='attribute__'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='error'; fcns.RHS{fcnNum}={'error'};fcnNum=fcnNum+1;<br>
% __attribute__ (( visibility (" default "))) const char * const * openslide_get_associated_image_names ( openslide_t * osr ); <br>fcns.thunkname{fcnNum}='(visibility("default")))char*const*openslide_get_associated_image_names(openslide_t*osrThunk';<a href="http://fcns.name" target="_blank">fcns.name</a>{fcnNum}='__attribute__'; fcns.alias{fcnNum}='attribute__'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='error'; fcns.RHS{fcnNum}={'error'};fcnNum=fcnNum+1;<br>
% __attribute__ (( visibility (" default "))) const char * openslide_get_version ( void ); <br>fcns.thunkname{fcnNum}='(visibility("default")))char*openslide_get_version(voidThunk';<a href="http://fcns.name" target="_blank">fcns.name</a>{fcnNum}='__attribute__'; fcns.alias{fcnNum}='attribute__'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='error'; fcns.RHS{fcnNum}={'error'};fcnNum=fcnNum+1;<br>
% __attribute__ (( visibility (" default "))) __attribute__ (( deprecated (" Use " " openslide_get_level_count " " instead "))) int32_t openslide_get_layer_count ( openslide_t * osr ); <br>
fcns.thunkname{fcnNum}='(visibility("default")))__attribute__((deprecated("Use""openslide_get_level_count""instead")))int32_topenslide_get_layer_count(openslide_t*osrThunk';<a href="http://fcns.name" target="_blank">fcns.name</a>{fcnNum}='__attribute__'; fcns.alias{fcnNum}='attribute__'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='error'; fcns.RHS{fcnNum}={'error'};fcnNum=fcnNum+1;<br>
% int _openslide_give_prefetch_hint_UNIMPLEMENTED ( void ); <br>fcns.thunkname{fcnNum}='int32voidThunk';<a href="http://fcns.name" target="_blank">fcns.name</a>{fcnNum}='_openslide_give_prefetch_hint_UNIMPLEMENTED'; fcns.alias{fcnNum}='openslide_give_prefetch_hint_UNIMPLEMENTED'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='int32'; fcns.RHS{fcnNum}=[];fcnNum=fcnNum+1;<br>
% void _openslide_cancel_prefetch_hint_UNIMPLEMENTED ( void ); <br>fcns.thunkname{fcnNum}='voidvoidThunk';<a href="http://fcns.name" target="_blank">fcns.name</a>{fcnNum}='_openslide_cancel_prefetch_hint_UNIMPLEMENTED'; fcns.alias{fcnNum}='openslide_cancel_prefetch_hint_UNIMPLEMENTED'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}=[]; fcns.RHS{fcnNum}=[];fcnNum=fcnNum+1;<br>
structs.s_openslide.members=struct('');<br>methodinfo=fcns;<br><br></div><b>2. after editing openslide-features.h to remove the space, I ran openslide_load_library and got a similar error as before:</b><br><br>Warning: Warnings messages were produced while parsing. Check the functions you intend to<br>
use for correctness. Warning text can be viewed using:<br> [notfound,warnings]=loadlibrary(...) <br>> In loadlibrary at 344<br> In openslide_load_library at 40 <br>Error loading library intermediate output follows.<br>
The actual error is at the end of this output.<br>*********<br><br>Type '' was not found. Defaulting to type error.<br><br>Found on line 103 of input from line 67 of file /usr/include/openslide/openslide.h<br><br>
Failed to parse type '( visibility (" default "))) _Bool openslide_can_open ( char * filename' original input '( visibility (" default "))) _Bool openslide_can_open ( const char * filename '<br>
Found on line 103 of input from line 67 of file /usr/include/openslide/openslide.h<br>Error parsing argument for function __attribute__ function may be invalid.<br><br>Type '' was not found. Defaulting to type error.<br>
<br>Found on line 106 of input from line 81 of file /usr/include/openslide/openslide.h<br><br>Failed to parse type '( visibility (" default "))) openslide_t * openslide_open ( char * filename' original input '( visibility (" default "))) openslide_t * openslide_open ( const char * filename '<br>
Found on line 106 of input from line 81 of file /usr/include/openslide/openslide.h<br>Error parsing argument for function __attribute__ function may be invalid.<br><br>Type '' was not found. Defaulting to type error.<br>
<br>Found on line 109 of input from line 92 of file /usr/include/openslide/openslide.h<br><br>Failed to parse type '( visibility (" default "))) int32_t openslide_get_level_count ( openslide_t * osr' original input '( visibility (" default "))) int32_t openslide_get_level_count ( openslide_t * osr '<br>
Found on line 109 of input from line 92 of file /usr/include/openslide/openslide.h<br>Error parsing argument for function __attribute__ function may be invalid.<br><br>Type '' was not found. Defaulting to type error.<br>
<br>Found on line 133 of input from line 182 of file /usr/include/openslide/openslide.h<br><br>Failed to parse type '( visibility (" default "))) void openslide_close ( openslide_t * osr' original input '( visibility (" default "))) void openslide_close ( openslide_t * osr '<br>
Found on line 133 of input from line 182 of file /usr/include/openslide/openslide.h<br>Error parsing argument for function __attribute__ function may be invalid.<br><br>Type '' was not found. Defaulting to type error.<br>
<br>Found on line 136 of input from line 227 of file /usr/include/openslide/openslide.h<br><br>Failed to parse type '( visibility (" default "))) char * openslide_get_error ( openslide_t * osr' original input '( visibility (" default "))) const char * openslide_get_error ( openslide_t * osr '<br>
Found on line 136 of input from line 227 of file /usr/include/openslide/openslide.h<br>Error parsing argument for function __attribute__ function may be invalid.<br><br>Type '' was not found. Defaulting to type error.<br>
<br>Found on line 139 of input from line 302 of file /usr/include/openslide/openslide.h<br><br>Failed to parse type '( visibility (" default "))) char * * openslide_get_property_names ( openslide_t * osr' original input '( visibility (" default "))) const char * const * openslide_get_property_names ( openslide_t * osr '<br>
Found on line 139 of input from line 302 of file /usr/include/openslide/openslide.h<br>Error parsing argument for function __attribute__ function may be invalid.<br><br>Type '' was not found. Defaulting to type error.<br>
<br>Found on line 145 of input from line 345 of file /usr/include/openslide/openslide.h<br><br>Failed to parse type '( visibility (" default "))) char * * openslide_get_associated_image_names ( openslide_t * osr' original input '( visibility (" default "))) const char * const * openslide_get_associated_image_names ( openslide_t * osr '<br>
Found on line 145 of input from line 345 of file /usr/include/openslide/openslide.h<br>Error parsing argument for function __attribute__ function may be invalid.<br><br>Type '' was not found. Defaulting to type error.<br>
<br>Found on line 158 of input from line 400 of file /usr/include/openslide/openslide.h<br><br>Failed to parse type '( visibility (" default "))) char * openslide_get_version ( void' original input '( visibility (" default "))) const char * openslide_get_version ( void '<br>
Found on line 158 of input from line 400 of file /usr/include/openslide/openslide.h<br>Error parsing argument for function __attribute__ function may be invalid.<br><br>Type '' was not found. Defaulting to type error.<br>
<br>Found on line 162 of input from line 422 of file /usr/include/openslide/openslide.h<br><br>Failed to parse type '( visibility (" default "))) __attribute__ (( deprecated (" Use " " openslide_get_level_count " " instead "))) int32_t openslide_get_layer_count ( openslide_t * osr' original input '( visibility (" default "))) __attribute__ (( deprecated (" Use " " openslide_get_level_count " " instead "))) int32_t openslide_get_layer_count ( openslide_t * osr '<br>
Found on line 162 of input from line 422 of file /usr/include/openslide/openslide.h<br>Error parsing argument for function __attribute__ function may be invalid.<br>*********<br>Error using loadlibrary (line 419)<br>Building openslidelib_thunk_glnxa64 failed. Compiler output is:<br>
gcc -I"/usr/local/MATLAB/R2012b/extern/include" -D_GNU_SOURCE -fexceptions -fPIC<br>-fno-omit-frame-pointer -pthread -I"/home/jbarker/Documents/MATLAB"<br>-I"/usr/include/openslide" "openslidelib_thunk_glnxa64.c" -o "openslidelib_thunk_glnxa64.so"<br>
-Wl,-E -shared<br>openslidelib_thunk_glnxa64.c:25:30: error: expected declaration specifiers or ‘...’ before<br>string constant<br> EXPORT_EXTERN_C (visibility("default")))_Boolopenslide_can_open(char*filenameThunk(void<br>
fcn(),const char *callstack,int stacksize)<br> ^<br>openslidelib_thunk_glnxa64.c:34:30: error: expected declaration specifiers or ‘...’ before<br>string constant<br> EXPORT_EXTERN_C (visibility("default")))openslide_t*openslide_open(char*filenameThunk(void<br>
fcn(),const char *callstack,int stacksize)<br> ^<br>openslidelib_thunk_glnxa64.c:43:30: error: expected declaration specifiers or ‘...’ before<br>string constant<br> EXPORT_EXTERN_C<br> (visibility("default")))int32_topenslide_get_level_count(openslide_t*osrThunk(void<br>
fcn(),const char *callstack,int stacksize)<br> ^<br>openslidelib_thunk_glnxa64.c:52:30: error: expected declaration specifiers or ‘...’ before<br>string constant<br> EXPORT_EXTERN_C (visibility("default")))voidopenslide_close(openslide_t*osrThunk(void<br>
fcn(),const char *callstack,int stacksize)<br> ^<br>openslidelib_thunk_glnxa64.c:61:30: error: expected declaration specifiers or ‘...’ before<br>string constant<br> EXPORT_EXTERN_C (visibility("default")))char*openslide_get_error(openslide_t*osrThunk(void<br>
fcn(),const char *callstack,int stacksize)<br> ^<br>openslidelib_thunk_glnxa64.c:70:30: error: expected declaration specifiers or ‘...’ before<br>string constant<br> EXPORT_EXTERN_C<br> (visibility("default")))char*const*openslide_get_property_names(openslide_t*osrThunk(void<br>
fcn(),const char *callstack,int stacksize)<br> ^<br>openslidelib_thunk_glnxa64.c:79:30: error: expected declaration specifiers or ‘...’ before<br>string constant<br> EXPORT_EXTERN_C<br> (visibility("default")))char*const*openslide_get_associated_image_names(openslide_t*osrThunk(void<br>
fcn(),const char *callstack,int stacksize)<br> ^<br>openslidelib_thunk_glnxa64.c:88:30: error: expected declaration specifiers or ‘...’ before<br>string constant<br> EXPORT_EXTERN_C (visibility("default")))char*openslide_get_version(voidThunk(void<br>
fcn(),const char *callstack,int stacksize)<br> ^<br>openslidelib_thunk_glnxa64.c:97:30: error: expected declaration specifiers or ‘...’ before<br>string constant<br> EXPORT_EXTERN_C<br> (visibility("default")))__attribute__((deprecated("Use""openslide_get_level_count""instead")))int32_topenslide_get_layer_count(openslide_t*osrThunk(void<br>
fcn(),const char *callstack,int stacksize)<br> ^<br><br><br>Error in openslide_load_library (line 40)<br>loadlibrary('libopenslide-0.dll','openslide.h','alias','openslidelib')<br>
<br></div><b>3. after editing openslide-features.h to remove the line, I got a new error:<br></b><br>Warning: Warnings messages were produced while parsing. Check the functions you intend to<br>use for correctness. Warning text can be viewed using:<br>
[notfound,warnings]=loadlibrary(...) <br>> In loadlibrary at 344<br> In openslide_load_library at 40 <br>Error loading library intermediate output follows.<br>The actual error is at the end of this output.<br>*********<br>
<br>Type '' was not found. Defaulting to type error.<br><br>Found on line 162 of input from line 422 of file /usr/include/openslide/openslide.h<br><br>Failed to parse type '( deprecated (" Use " " openslide_get_level_count " " instead "))) int32_t openslide_get_layer_count ( openslide_t * osr' original input '( deprecated (" Use " " openslide_get_level_count " " instead "))) int32_t openslide_get_layer_count ( openslide_t * osr '<br>
Found on line 162 of input from line 422 of file /usr/include/openslide/openslide.h<br>Error parsing argument for function __attribute__ function may be invalid.<br>*********<br>Error using loadlibrary (line 419)<br>Building openslidelib_thunk_glnxa64 failed. Compiler output is:<br>
gcc -I"/usr/local/MATLAB/R2012b/extern/include" -D_GNU_SOURCE -fexceptions -fPIC<br>-fno-omit-frame-pointer -pthread -I"/home/jbarker/Documents/MATLAB"<br>-I"/usr/include/openslide" "openslidelib_thunk_glnxa64.c" -o "openslidelib_thunk_glnxa64.so"<br>
-Wl,-E -shared<br>openslidelib_thunk_glnxa64.c:214:30: error: expected declaration specifiers or ‘...’ before<br>string constant<br> EXPORT_EXTERN_C<br> (deprecated("Use""openslide_get_level_count""instead")))int32_topenslide_get_layer_count(openslide_t*osrThunk(void<br>
fcn(),const char *callstack,int stacksize)<br> ^<br><br><br>Error in openslide_load_library (line 40)<br>loadlibrary('libopenslide-0.dll','openslide.h','alias','openslidelib')<b><br>
<br></b></div><b>4. I do not believe I got the error you referred to about libopenslide-0.dll however for completeness I also edited that line to get what appears to be the same error:<br></b></div><br>Warning: Warnings messages were produced while parsing. Check the functions you intend to<br>
use for correctness. Warning text can be viewed using:<br> [notfound,warnings]=loadlibrary(...) <br>> In loadlibrary at 344<br> In openslide_load_library at 40 <br>Error loading library intermediate output follows.<br>
The actual error is at the end of this output.<br>*********<br><br>Type '' was not found. Defaulting to type error.<br><br>Found on line 162 of input from line 422 of file /usr/include/openslide/openslide.h<br><br>
Failed to parse type '( deprecated (" Use " " openslide_get_level_count " " instead "))) int32_t openslide_get_layer_count ( openslide_t * osr' original input '( deprecated (" Use " " openslide_get_level_count " " instead "))) int32_t openslide_get_layer_count ( openslide_t * osr '<br>
Found on line 162 of input from line 422 of file /usr/include/openslide/openslide.h<br>Error parsing argument for function __attribute__ function may be invalid.<br>*********<br>Error using loadlibrary (line 419)<br>Building openslidelib_thunk_glnxa64 failed. Compiler output is:<br>
gcc -I"/usr/local/MATLAB/R2012b/extern/include" -D_GNU_SOURCE -fexceptions -fPIC<br>-fno-omit-frame-pointer -pthread -I"/home/jbarker/Documents/MATLAB"<br>-I"/usr/include/openslide" "openslidelib_thunk_glnxa64.c" -o "openslidelib_thunk_glnxa64.so"<br>
-Wl,-E -shared<br>openslidelib_thunk_glnxa64.c:214:30: error: expected declaration specifiers or ‘...’ before<br>string constant<br> EXPORT_EXTERN_C<br> (deprecated("Use""openslide_get_level_count""instead")))int32_topenslide_get_layer_count(openslide_t*osrThunk(void<br>
fcn(),const char *callstack,int stacksize)<br> ^<br><br><br>Error in openslide_load_library (line 40)<br>loadlibrary('libopenslide.so.0','openslide.h','alias','openslidelib')<br>
<br></div>Thank you very much for all your help!<br><br></div>Jocelyn<br><div><div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 26, 2014 at 1:57 AM, Benjamin Gilbert <span dir="ltr"><<a href="mailto:bgilbert@cs.cmu.edu" target="_blank">bgilbert@cs.cmu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On 06/25/2014 01:33 AM, Jocelyn Barker wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I am not sure if the problem is with openslide or the Matlab toolbox,<br>
but any help would be greatly appreciated.<br>
</blockquote>
<br></div>
MATLAB tries to parse openslide.h and appears to be choking on it. Please try these things, in order, and let us know your results:<br>
<br>
1. In MATLAB, run loadlibrary('libopenslide-0.<u></u>dll', 'openslide.h', 'mfilename', 'mHeader'). This will fail after writing a file called "mHeader.m". Please forward the contents of that file.<br>
<br>
2. Edit /usr/include/openslide/<u></u>openslide-features.h and remove the space between '__attribute__' and '((visibility("default")))', then try openslide_load_library again.<br>
<br>
3. Edit /usr/include/openslide/<u></u>openslide-features.h and delete '__attribute__((visibility("<u></u>default")))', then try openslide_load_library again.<br>
<br>
4. Steps 2 or 3 may produce a new error about not finding libopenslide-0.dll. If so, edit openslide_load_library.m and replace 'libopenslide-0.dll' with 'libopenslide.so.0'.<span><font color="#888888"><br>
<br>
--Benjamin Gilbert<br>
<br>
</font></span></blockquote></div><br></div></div></div></div>