title: Rinside compilation error with kdb
body: <p>I sucessfully ran the sample codes in the package. Then I copied code from sample1 into another file of mine and set it up to compile using Makefile.
  Also copied sample copies into the same directory.
  The samples in the directory compile and run fine.
  But using R in my already existing code is giving issues. When compiling it gives an error saying  <code>expected unqualified-id before âreturnâ</code>. This happens in the line where I declare <code>RInside R(argc, argv)</code>.</p>
  
  <p>Another weird thing i noticed is if i include  at the bottom of included files, I get a bunch of errors in Rcpp etc. but if i include it at the top, all those errors disappear.</p>
  
  <p>Also, is the default compile option of -O3 required for the package? I have been using -Ofast for most of my codes. Browsing through the questions here I think I need to make changes to CXXFLAGS in Makevars but i can't find out where.
  Any help appreciated.</p>
  
  <p>I have boiled down the errors to another file included in my setup which is "k.h". This is a file which is used to interface c++ with kdb+ database. If I include the file before  I get errors in Rcpp classes. When included after RInside, I get the earlier error of <code>unqualified id before return</code>.</p>
  
  <p>This is the file in question: <a href="https://github.com/KxSystems/kdb/blob/master/c/c/k.h" rel="nofollow noreferrer">k.h</a></p>
  
  <p>Resolved: It appears it was a variable name conflict. In all examples we have <code>RInside R(argc, argv)</code>. As soon as I changed it to <code>RInside L(argc, argv)</code> everything worked fine. Don't know exactly why this was the case but it solves the problem at least. Tested outputs too.</p>