You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to build this package locally to see if I can work on a fix for #299. I didn't find any specific instructions here for how to compile the package's C++ code, so I just tried devtools::load_all(). It fails with the below compilation error on both my Ubuntu and Windows machines, and it appears to be an invalid cast from nanodbc::connection to bool at https://github.com/r-dbi/odbc/blob/main/src/nanodbc/nanodbc.cpp#L3467. When I comment out that assert, it compiles successfully and I can run the tests. I would expect it to compile without having to do that, though. Did I do something wrong? Or does this code only compile on an older GCC version or something? (Looks like I have 10.3)
Re-compiling odbc
- installing *source* package 'odbc' ...
** using staged installation
** libs
g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-42~1.1/include" -DNDEBUG -I'C:/Users/jekyllo/AppData/Local/R/win-library/4.2/Ro g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-42~1.1/include" -DNDEBUG -I'C:/Users/jekyllo/AppData/Local/R/win-library/4.2/Ro g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-42~1.1/include" -DNDEBUG -I'C:/Users/jekyllo/AppData/Local/R/win-library/4.2/Ro In file included from c:\rtools42\x86_64-w64-mingw32.static.posix\lib\gcc\x86_64-w64-mingw32.static.posix\10.3.0\inc, from nanodbc/nanodbc.cpp:33:
nanodbc/nanodbc.cpp: In function 'std::__cxx11::list<nanodbc::data_source> nanodbc::list_data_sources()':
nanodbc/nanodbc.cpp:34:30: error: no match for 'operator!' (operand type is 'nanodbc::connection')
34 | #define NANODBC_ASSERT(expr) assert(expr)
| ^~~~~~
nanodbc/nanodbc.cpp:3467:9: note: in expansion of macro 'NANODBC_ASSERT'
3467 | NANODBC_ASSERT(env);
| ^~~~~~~~~~~~~~
nanodbc/nanodbc.cpp:34:30: note: candidate: 'operator!(bool)' (built-in)
34 | #define NANODBC_ASSERT(expr) assert(expr)
| ^~~~~~
nanodbc/nanodbc.cpp:3467:9: note: in expansion of macro 'NANODBC_ASSERT'
3467 | NANODBC_ASSERT(env);
| ^~~~~~~~~~~~~~
nanodbc/nanodbc.cpp:34:30: note: no known conversion for argument 1 from 'nanodbc::connection' to 'bool'
34 | #define NANODBC_ASSERT(expr) assert(expr)
| ^~~~~~
nanodbc/nanodbc.cpp:3467:9: note: in expansion of macro 'NANODBC_ASSERT'
3467 | NANODBC_ASSERT(env);
| ^~~~~~~~~~~~~~
make: *** [Makevars.win:17: nanodbc.o] Error 1
ERROR: compilation failed for package 'odbc'
- removing 'C:/Users/jekyllo/AppData/Local/Temp/RtmpE3Ta7t/devtools_install_1cf442b29be/odbc'
Error in `(function (command = NULL, args = character(), error_on_status = TRUE, ...`:
! System command 'Rcmd.exe' failed
---
Exit status: 1
stdout & stderr: <printed>
---
Issue Description and Expected Result
I was trying to build this package locally to see if I can work on a fix for #299. I didn't find any specific instructions here for how to compile the package's C++ code, so I just tried
devtools::load_all()
. It fails with the below compilation error on both my Ubuntu and Windows machines, and it appears to be an invalid cast fromnanodbc::connection
tobool
at https://github.com/r-dbi/odbc/blob/main/src/nanodbc/nanodbc.cpp#L3467. When I comment out that assert, it compiles successfully and I can run the tests. I would expect it to compile without having to do that, though. Did I do something wrong? Or does this code only compile on an older GCC version or something? (Looks like I have 10.3)Database
N/A
Reproducible Example
-->
Session Info
The text was updated successfully, but these errors were encountered: