Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linker error on CRAN Windows / winbuilder machines #67

Closed
ablaette opened this issue Aug 30, 2022 · 4 comments
Closed

Linker error on CRAN Windows / winbuilder machines #67

ablaette opened this issue Aug 30, 2022 · 4 comments

Comments

@ablaette
Copy link
Collaborator

I see the identical error on CRAN Windows machines (R-release and R-devel), and on R winbuilder.

g++ -std=gnu++11 -shared -s -static-libgcc -o RcppCWB.dll tmp.def RcppExports.o addons.o cl.o cqp.o utils.o -L/d/temp/RtmpS6TBsV/R.INSTALLf8d437f238ec/RcppCWB/src/cwb/cl -L/d/temp/RtmpS6TBsV/R.INSTALLf8d437f238ec/RcppCWB/src/cwb/cqp -L/d/temp/RtmpS6TBsV/R.INSTALLf8d437f238ec/RcppCWB/src/cwb/utils -lcwb -lcqp -lcl -lglib-2.0 -lintl -liconv -lws2_32 -lpcre -lole32 -Ld:/rtools42/x86_64-w64-mingw32.static.posix/lib/x64 -Ld:/rtools42/x86_64-w64-mingw32.static.posix/lib -LD:/RCompile/recent/R-4.2.1/bin/x64 -lR
D:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: d:/rtools42/x86_64-w64-mingw32.static.posix/lib/libglib-2.0.a(gutils.c.obj):gutils.c:(.rdata$.refptr.FOLDERID_InternetCache[.refptr.FOLDERID_InternetCache]+0x0): undefined reference to `FOLDERID_InternetCache'
D:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: d:/rtools42/x86_64-w64-mingw32.static.posix/lib/libglib-2.0.a(gutils.c.obj):gutils.c:(.rdata$.refptr.FOLDERID_LocalAppData[.refptr.FOLDERID_LocalAppData]+0x0): undefined reference to `FOLDERID_LocalAppData'
D:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: d:/rtools42/x86_64-w64-mingw32.static.posix/lib/libglib-2.0.a(gutils.c.obj):gutils.c:(.rdata$.refptr.FOLDERID_Videos[.refptr.FOLDERID_Videos]+0x0): undefined reference to `FOLDERID_Videos'
D:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: d:/rtools42/x86_64-w64-mingw32.static.posix/lib/libglib-2.0.a(gutils.c.obj):gutils.c:(.rdata$.refptr.FOLDERID_Templates[.refptr.FOLDERID_Templates]+0x0): undefined reference to `FOLDERID_Templates'
D:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: d:/rtools42/x86_64-w64-mingw32.static.posix/lib/libglib-2.0.a(gutils.c.obj):gutils.c:(.rdata$.refptr.FOLDERID_Public[.refptr.FOLDERID_Public]+0x0): undefined reference to `FOLDERID_Public'
D:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: d:/rtools42/x86_64-w64-mingw32.static.posix/lib/libglib-2.0.a(gutils.c.obj):gutils.c:(.rdata$.refptr.FOLDERID_Pictures[.refptr.FOLDERID_Pictures]+0x0): undefined reference to `FOLDERID_Pictures'
D:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: d:/rtools42/x86_64-w64-mingw32.static.posix/lib/libglib-2.0.a(gutils.c.obj):gutils.c:(.rdata$.refptr.FOLDERID_Music[.refptr.FOLDERID_Music]+0x0): undefined reference to `FOLDERID_Music'
D:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: d:/rtools42/x86_64-w64-mingw32.static.posix/lib/libglib-2.0.a(gutils.c.obj):gutils.c:(.rdata$.refptr.FOLDERID_Downloads[.refptr.FOLDERID_Downloads]+0x0): undefined reference to `FOLDERID_Downloads'
D:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: d:/rtools42/x86_64-w64-mingw32.static.posix/lib/libglib-2.0.a(gutils.c.obj):gutils.c:(.rdata$.refptr.FOLDERID_Documents[.refptr.FOLDERID_Documents]+0x0): undefined reference to `FOLDERID_Documents'
D:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: d:/rtools42/x86_64-w64-mingw32.static.posix/lib/libglib-2.0.a(gutils.c.obj):gutils.c:(.rdata$.refptr.FOLDERID_Desktop[.refptr.FOLDERID_Desktop]+0x0): undefined reference to `FOLDERID_Desktop'
D:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: d:/rtools42/x86_64-w64-mingw32.static.posix/lib/libglib-2.0.a(gutils.c.obj):gutils.c:(.rdata$.refptr.FOLDERID_Profile[.refptr.FOLDERID_Profile]+0x0): undefined reference to `FOLDERID_Profile'
D:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: d:/rtools42/x86_64-w64-mingw32.static.posix/lib/libglib-2.0.a(gutils.c.obj):gutils.c:(.rdata$.refptr.FOLDERID_PublicDocuments[.refptr.FOLDERID_PublicDocuments]+0x0): undefined reference to `FOLDERID_PublicDocuments'
D:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: d:/rtools42/x86_64-w64-mingw32.static.posix/lib/libglib-2.0.a(gutils.c.obj):gutils.c:(.rdata$.refptr.FOLDERID_ProgramData[.refptr.FOLDERID_ProgramData]+0x0): undefined reference to `FOLDERID_ProgramData'
collect2.exe: error: ld returned 1 exit status

I cannot reproduce the issue locally with my R 4.2.1 and R-devel.-

@ablaette
Copy link
Collaborator Author

This is the glib file gutils.c where FOLDERID_* is referenced:
https://github.com/GNOME/glib/blob/main/glib/gutils.c

@ablaette
Copy link
Collaborator Author

The FOLDERID_* keywords were introduced with glib on May 7:
GNOME/glib@d270d5b

@ablaette
Copy link
Collaborator Author

Adding '-luuid' to 'PKG_LIBS' in src/Makevars.ucrt seems to do the job. This stackoverflow has been very helpful:
https://stackoverflow.com/questions/66338153/undefined-reference-to-folderid-c

ablaette pushed a commit that referenced this issue Aug 30, 2022
@ablaette
Copy link
Collaborator Author

I submitted RcppCWB v0.5.4 to CRAN yesterday. R-devel Windows results are there - no linker error any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant