[Rd] Problems with MinGW and boost on Windows
florian.burkart at gmail.com
Tue Nov 27 13:53:47 CET 2012
I am not sure how widespread this problem is, but definitely occurs for me
on 64 bit Win 7 with a 64 bit R.
I think I have isolated the issue (to a certain extent) in the attached
Test.cpp file. Basically, I think linking with boost serialization is
causing the plugin to fail.
If I compile Test.cpp with line 43 (Dummy* Read() ...) commented out, I get
the expected output in R:
However, if line 43 is uncommented, the output changes to
Error in .Call("add", c(1, 3)) : C symbol name "add" not in load table
I am not sure what exactly is going wrong. This happens both if I link to
boost serialization statically or dynamically.
This is on R version R-2.15.1, and both boost serialization libraries and
the plugin are built with the gcc (4.6.3 20111208 prerelease) and make.exe
provided by RTools (Collection 126.96.36.1993) using the -m64 flag.
Build command was
g++ -c "Test.cpp" -g -std=gnu++0x -m64 -O1 -DDEBUG -o
obj/Debug64/Tester/Trunk_Test.o -I. -I/R/R-2.15.1/include
g++ -shared -fPIC -o Debug64/Tester.dll @"MinGW\Tester.txt" -L.
-L/Sys/boost/MinGW64/boost_1_50_0/lib -LDebug64 -lRcpp -lR
And for boost:
b2.exe --prefix=c:\Sys\boost\MinGW64\boost_1_50_0 toolset=gcc
address-model=64 link=static,shared -s BZIP2_SOURCE=C:\Sys\bzip2-1.0.6 -s
Also note that this works fine on linux (Ubuntu).
I have been struggling to get past this for several weeks now... any help
would be greatly appreciated.
More information about the R-devel