title: Error in dyn.load(dll_copy_file) when building Rcpp package on Mac
body: <p>I'm building my own Rcpp Package (name: RUtilities) on Mac. However, I encountered the following error when executing <code>devtools::document()</code></p>
  <pre><code>** checking absolute paths in shared objects and dynamic libraries
  ─  DONE (RUtilities)
  Error in dyn.load(dll_copy_file) : 
    unable to load shared object '/var/folders/70/0x058vd10ts57r4ck5j2j3s00000gn/T//RtmpIXnrlU/pkgload13d793cdb33ea/RUtilities.so':
    dlopen(/var/folders/70/0x058vd10ts57r4ck5j2j3s00000gn/T//RtmpIXnrlU/pkgload13d793cdb33ea/RUtilities.so, 0x0006): symbol not found in flat namespace '__RUtilities_test'
  </code></pre>
  <p>My current attempts:</p>
  <ol>
  <li>delete the .so, .o files in the <code>src</code> folder and rerun the code.</li>
  <li>delete the RUtilities.so file in the <code>/var/folders/70/</code> folder.</li>
  </ol>
  <p>However, the error persists.</p>
  <p>This problem is very strange to me, because the same package can be installed correctly on my Linux server.</p>
  <p>I suspect there is something wrong with the R version, since my Linux server uses R3.6, while my mac uses R4.1. Should I modify the <code>Makevars</code> file when the R version changes? My <code>Makevars</code> file looks like this right now:</p>
  <pre><code>PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
  PKG_CPPFLAGS = -I../inst/include/
  
  
  CXX_STD = CXX11
  PKG_LIBS += $(shell ${R_HOME}/bin/Rscript -e &quot;RcppParallel::RcppParallelLibs()&quot;)
  </code></pre>
  <p>Also, my Mac uses the Apple M1 chip. Is this chip the problem?</p>
  <p>Any suggestions are welcomed! Thanks!</p>