<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
What version of Rcpp are you using? With R 4.3 and Rcpp 1.0.10 I have no issues.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted0">
<div class="ContentPasted0">library(Rcpp)</div>
<div><br class="ContentPasted0">
</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">Rcpp::sourceCpp(code='</div>
<div class="ContentPasted0">  #include <Rcpp.h></div>
<div class="ContentPasted0">  using namespace Rcpp;</div>
<div class="ContentPasted0">  // [[Rcpp::export()]]</div>
<div class="ContentPasted0">  SEXP cpptest(NumericVector v) {</div>
<div class="ContentPasted0">    return v;</div>
<div class="ContentPasted0">  }'</div>
<div class="ContentPasted0">)</div>
<div class="ContentPasted0">cpptest(1:5)</div>
<div class="ContentPasted0">#> [1] 1 2 3 4 5</div>
<div><br class="ContentPasted0">
</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">R.version</div>
<div class="ContentPasted0">#>                _                                </div>
<div class="ContentPasted0">#> platform       x86_64-w64-mingw32               </div>
<div class="ContentPasted0">#> arch           x86_64                           </div>
<div class="ContentPasted0">#> os             mingw32                          </div>
<div class="ContentPasted0">#> crt            ucrt                             </div>
<div class="ContentPasted0">#> system         x86_64, mingw32                  </div>
<div class="ContentPasted0">#> status                                          </div>
<div class="ContentPasted0">#> major          4                                </div>
<div class="ContentPasted0">#> minor          3.0                              </div>
<div class="ContentPasted0">#> year           2023                             </div>
<div class="ContentPasted0">#> month          04                               </div>
<div class="ContentPasted0">#> day            21                               </div>
<div class="ContentPasted0">#> svn rev        84292                            </div>
<div class="ContentPasted0">#> language       R                                </div>
<div class="ContentPasted0">#> version.string R version 4.3.0 (2023-04-21 ucrt)</div>
<div class="ContentPasted0">#> nickname       Already Tomorrow</div>
<div class="ContentPasted0">packageVersion("Rcpp")</div>
<div class="ContentPasted0">#> [1] '1.0.10'</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Rcpp-devel <rcpp-devel-bounces@lists.r-forge.r-project.org> on behalf of Dominick Samperi <djsamperi@gmail.com><br>
<b>Sent:</b> Tuesday, May 30, 2023 2:27 PM<br>
<b>To:</b> rcpp-devel <Rcpp-devel@r-forge.wu-wien.ac.at><br>
<b>Subject:</b> [Rcpp-devel] Rcpp::sourceCpp Problem with R 4.3 update</font>
<div> </div>
</div>
<div>
<div dir="ltr">Looks like the recent update to R 4.3 broke Rcpp::sourceCpp.
<div><br>
</div>
<div>Here is a simple example...</div>
<div><br>
</div>
<div>library(Rcpp)<br>
Rcpp::sourceCpp(code='<br>
  #include <Rcpp.h><br>
  using namespace Rcpp;<br>
  // [[Rcpp::export()]]<br>
  SEXP cpptest(NumericVector v) {<br>
    return v;<br>
  }'<br>
)<br>
cpptest(1:5)<br>
</div>
<div><br>
</div>
<div>This works without problems under R 4.2.3, but under R 4.3 I get...</div>
<div><br>
</div>
<div>using C++ compiler: 'G__~1.EXE (GCC) 12.2.0'<br>
C:\rtools43\x86_64-w64-mingw32.static.posix\bin/ld.exe: internal error: aborting at ../../binutils-2.40/ld/ldlang.c:527 in compare_section<br>
C:\rtools43\x86_64-w64-mingw32.static.posix\bin/ld.exe: please report this bug<br>
collect2.exe: error: ld returned 1 exit status<br>
g++ -std=gnu++17  -I"c:/PROGRA~1/R/R-43~1.0/include" -DNDEBUG   -I"C:/PROGRA~1/R/R-43~1.0/library/Rcpp/include" -I"C:/Users/djsam/AppData/Local/Temp/RtmpKEsaiY/sourceCpp-x86_64-w64-mingw32-1.0.10"   -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include"  
   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c filebb0108a7dbf.cpp -o filebb0108a7dbf.o<br>
g++ -std=gnu++17 -shared -s -static-libgcc -o sourceCpp_2.dll tmp.def filebb0108a7dbf.o -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib -Lc:/PROGRA~1/R/R-43~1.0/bin/x64 -lR<br>
Error in Rcpp::sourceCpp(code = "\n  #include <Rcpp.h>\n  using namespace Rcpp;\n  // [[Rcpp::export()]]\n  SEXP cpptest(NumericVector v) {\n    return v;\n  }") :
<br>
  Error occurred building shared library.<br>
</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Dominick</div>
<div><br>
</div>
</div>
<p style="border:1px; border-style:solid; border-color:#FFCACA; background-color:#FFCACA; padding:1em">
<span style="font-size:12.0pt; color:black"><b>[EXTERNAL EMAIL]</span></b> <span style="font-size:10.0pt; color:black">
DO NOT CLICK links or attachments unless you recognize the sender and know the content is safe.</span></p>
</div>
</body>
</html>