<div dir="ltr"><div><div><div><div>Hi all,<br><br></div>Steve's post got me thinking about a potential more general template declaration issue, so I browsed around, and came across this post in SO (as well as a couple of others):<br>
<a href="http://stackoverflow.com/questions/14753499/type-defined-in-template-class-does-not-name-a-type">http://stackoverflow.com/questions/14753499/type-defined-in-template-class-does-not-name-a-type</a><br><br></div>This made me try to just forward declare the 2 Octave classes octave_value and octave_value_list, and... it worked! (see below)<br>
</div><div>It does not explain why simply including headers in the order RcppCommon.h > Octave stuff > Rcpp.h breaks things up, but I'll leave that for next winter...<br><br></div><div>So I hear happy voices asking: "do we have RcppOctave for windows now?"<br>
</div><div>Not yet:<br> * Compilation is ok<br> * Linking is ok, after I managed to solve issues which were going silent on Linux due to some "magic" resolution of dependencies to libraries. Libraries liboctave and libcruft are apparently needed but were not stated in the gcc command, which worked fine in Linux. Plus Octave windows GCC dlls are suffixed .dll.a and not just .dll<br>
</div><div> <br>Problem: loading Octave windows libraries from R crashes Rterm. It complains about the .dll.a objects not being "either not designed to run on Windows or contains errors...". This is my next quest. Anybody has an idea on this?<br>
</div><div><br></div><div>Thank you all who helped solved the original issue!<br><br></div><div>Bests,<br></div><div>Renaud, taking impulsion for the cross-platform leap<br></div><div><br>##### <br><br></div><div>My header now looks like this:<br>
</div>// rcpp_octave.h<br>#include <RcppCommon.h><br><br>// forward declaration of Octave classes<br>class octave_value;<br>class octave_value_list;<br>// declaring the specialization<br>namespace Rcpp {<br> template <> SEXP wrap( const octave_value& );<br>
template <> SEXP wrap( const octave_value_list& );<br><br> template <> octave_value as( SEXP );<br> template <> octave_value_list as( SEXP );<br>}<br><br>// this must appear after the specialization,<br>
// otherwise the specialization will not be seen by Rcpp types<br>#include <Rcpp.h><br><br>// Octave libraries<br>#include <octave/config.h><br>#include <octave/oct-obj.h><br><br>// .....<br>/////////<br>
<br></div>Compilation now only warns about macro _WIN32_WINNT being redefined, which I can easily live with:<br><br>g++ -m32 -I"c:/R/R-3.0.2/include" -DNDEBUG -IC:/R/R-3.0.2/library/Rcpp/include -fmax-errors=10 -DOCT_POST_3_4_0=1 -I"C:\Octave\Octave3.6.4_g<br>
cc4.6.2\include" -I"C:\Octave\Octave3.6.4_gcc4.6.2\include\octave-3.6.4\octave" -I"C:\Octave\Octave3.6.4_gcc4.6.2\include\octave-3.6.4\octav<br>e/../" -I"c:/R/R-3.0.2/library/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c rcpp_octave.<br>
cpp -o rcpp_octave.o<br>In file included from rcpp_octave.h:36:0,<br> from rcpp_octave.cpp:21:<br>C:\Octave\Octave3.6.4_gcc4.6.2\include\octave-3.6.4\octave/../octave/config.h:2764:0: warning: "_WIN32_WINNT" redefined [enabled by default]<br>
<br>c:\rtools\gcc-4.6.3\bin\../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/include/_mingw.h:244:0: note: this is the location of<br> the previous definition<br><div><div><div><div><br><div><div><div><div><div class="gmail_extra">
<br></div></div></div></div></div></div></div></div></div></div>