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
Using nm -gC libSQLiteCpp.a | grep SQLite::Statement::bind to get the result.
U SQLite::Statement::bind(int, char const*)
U SQLite::Statement::bind(int, std::string const&)
0000000000000594 T SQLite::Statement::bindNoCopy(int, char const*)
00000000000005e6 T SQLite::Statement::bindNoCopy(int, void const*, int)
000000000000051c T SQLite::Statement::bindNoCopy(int, std::string const&)
000000000000063a T SQLite::Statement::bind(int)
0000000000000474 T SQLite::Statement::bind(int, char const*)
00000000000004c8 T SQLite::Statement::bind(int, void const*, int)
00000000000003fc T SQLite::Statement::bind(int, std::string const&)
00000000000003ac T SQLite::Statement::bind(int, double)
00000000000002c8 T SQLite::Statement::bind(int, int)
0000000000000310 T SQLite::Statement::bind(int, unsigned int)
0000000000000362 T SQLite::Statement::bind(int, long)
my code↓
const std::string &softId is a formal parameter.
tips
Using softId.c_str() is normal in this case because it conforms to the signature of SQLite::Statement::bind(int, char const*). This means that the char const* type returned by softId.c_str() can be passed as a parameter to the bind function, allowing it to be used normally in this situation.
Scenario 2
os version:g++ (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2)
sqlite version:3.7.17
Everything is normal
My English is not good, using translation, sorry.😂
The text was updated successfully, but these errors were encountered:
Using nm -gC libSQLiteCpp.a | grep SQLite::Statement::bind to get the result.
U SQLite::Statement::bind(int, char const*)
U SQLite::Statement::bind(int, std::string const&)
0000000000000594 T SQLite::Statement::bindNoCopy(int, char const*)
00000000000005e6 T SQLite::Statement::bindNoCopy(int, void const*, int)
000000000000051c T SQLite::Statement::bindNoCopy(int, std::string const&)
000000000000063a T SQLite::Statement::bind(int)
0000000000000474 T SQLite::Statement::bind(int, char const*)
00000000000004c8 T SQLite::Statement::bind(int, void const*, int)
00000000000003fc T SQLite::Statement::bind(int, std::string const&)
00000000000003ac T SQLite::Statement::bind(int, double)
00000000000002c8 T SQLite::Statement::bind(int, int)
0000000000000310 T SQLite::Statement::bind(int, unsigned int)
0000000000000362 T SQLite::Statement::bind(int, long)
my code↓
const std::string &softId is a formal parameter.
libSQLiteCpp.a|libsqlite3.a was compiled in Scenario 2 environment.
Scenario 1
os version:g++ (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
sqlite version:3.31.1
error:/usr/bin/ld: CMakeFiles/xp-tasks.dir/src/task/task.cpp.o: in function
Task::Install(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': /home/pya789/project/xp-tasks/src/task/task.cpp:172: undefined reference to
SQLite::Statement::bind(int, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'tips
Using softId.c_str() is normal in this case because it conforms to the signature of SQLite::Statement::bind(int, char const*). This means that the char const* type returned by softId.c_str() can be passed as a parameter to the bind function, allowing it to be used normally in this situation.
Scenario 2
os version:g++ (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2)
sqlite version:3.7.17
Everything is normal
My English is not good, using translation, sorry.😂
The text was updated successfully, but these errors were encountered: