- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我在 ubuntu14.04 上运行。我能够在机器上安装 datastax 的 cpp 驱动程序。
但是我无法运行它的任何示例
Install the project...
-- Install configuration: ""
-- Up-to-date: /usr/local/include/cassandra.h
-- Up-to-date: /usr/local/lib/libcassandra.so.0.7.0
-- Up-to-date: /usr/local/lib/libcassandra.so.0
-- Up-to-date: /usr/local/lib/libcassandra.so
-- Up-to-date: /usr/local/lib/libcassandra_static.a
root@ubuntu-cassandra:~/cpp-driver# cd -
/root/cpp-driver/examples/simple
root@ubuntu-cassandra:~/cpp-driver/examples/simple# strace -s 1024 -f -e execve gcc -I /usr/local/include/ -L /usr/local/lib/ -lcassandra simple.c
execve("/usr/bin/gcc", ["gcc", "-I", "/usr/local/include/", "-L", "/usr/local/lib/", "-lcassandra", "simple.c"], [/* 23 vars */]) = 0
Process 30450 attached
[pid 30450] execve("/usr/lib/gcc/x86_64-linux-gnu/4.8/cc1", ["/usr/lib/gcc/x86_64-linux-gnu/4.8/cc1", "-quiet", "-I", "/usr/local/include/", "-imultiarch", "x86_64-linux-gnu", "simple.c", "-quiet", "-dumpbase", "simple.c", "-mtune=generic", "-march=x86-64", "-auxbase", "simple", "-fstack-protector", "-Wformat", "-Wformat-security", "-o", "/tmp/cc8RgD1Y.s"], [/* 26 vars */]) = 0
[pid 30450] +++ exited with 0 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=30450, si_status=0, si_utime=3, si_stime=1} ---
Process 30451 attached
[pid 30451] execve("/usr/local/sbin/as", ["as", "-I", "/usr/local/include/", "--64", "-o", "/tmp/ccCetiDS.o", "/tmp/cc8RgD1Y.s"], [/* 26 vars */]) = -1 ENOENT (No such file or directory)
[pid 30451] execve("/usr/local/bin/as", ["as", "-I", "/usr/local/include/", "--64", "-o", "/tmp/ccCetiDS.o", "/tmp/cc8RgD1Y.s"], [/* 26 vars */]) = -1 ENOENT (No such file or directory)
[pid 30451] execve("/usr/sbin/as", ["as", "-I", "/usr/local/include/", "--64", "-o", "/tmp/ccCetiDS.o", "/tmp/cc8RgD1Y.s"], [/* 26 vars */]) = -1 ENOENT (No such file or directory)
[pid 30451] execve("/usr/bin/as", ["as", "-I", "/usr/local/include/", "--64", "-o", "/tmp/ccCetiDS.o", "/tmp/cc8RgD1Y.s"], [/* 26 vars */]) = 0
[pid 30451] +++ exited with 0 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=30451, si_status=0, si_utime=0, si_stime=0} ---
Process 30452 attached
[pid 30452] execve("/usr/lib/gcc/x86_64-linux-gnu/4.8/collect2", ["/usr/lib/gcc/x86_64-linux-gnu/4.8/collect2", "--sysroot=/", "--build-id", "--eh-frame-hdr", "-m", "elf_x86_64", "--hash-style=gnu", "--as-needed", "-dynamic-linker", "/lib64/ld-linux-x86-64.so.2", "-z", "relro", "/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o", "/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o", "/usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o", "-L/usr/local/lib/", "-L/usr/lib/gcc/x86_64-linux-gnu/4.8", "-L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu", "-L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib", "-L/lib/x86_64-linux-gnu", "-L/lib/../lib", "-L/usr/lib/x86_64-linux-gnu", "-L/usr/lib/../lib", "-L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../..", "-lcassandra", "/tmp/ccCetiDS.o", "-lgcc", "--as-needed", "-lgcc_s", "--no-as-needed", "-lc", "-lgcc", "--as-needed", "-lgcc_s", "--no-as-needed", "/usr/lib/gcc/x86_64-linux-gnu/4.8/crtend.o", "/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crtn.o"], [/* 28 vars */]) = 0
Process 30453 attached
[pid 30453] execve("/usr/bin/ld", ["/usr/bin/ld", "--sysroot=/", "--build-id", "--eh-frame-hdr", "-m", "elf_x86_64", "--hash-style=gnu", "--as-needed", "-dynamic-linker", "/lib64/ld-linux-x86-64.so.2", "-z", "relro", "/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o", "/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o", "/usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o", "-L/usr/local/lib/", "-L/usr/lib/gcc/x86_64-linux-gnu/4.8", "-L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu", "-L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib", "-L/lib/x86_64-linux-gnu", "-L/lib/../lib", "-L/usr/lib/x86_64-linux-gnu", "-L/usr/lib/../lib", "-L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../..", "-lcassandra", "/tmp/ccCetiDS.o", "-lgcc", "--as-needed", "-lgcc_s", "--no-as-needed", "-lc", "-lgcc", "--as-needed", "-lgcc_s", "--no-as-needed", "/usr/lib/gcc/x86_64-linux-gnu/4.8/crtend.o", "/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crtn.o"], [/* 28 vars */]) = 0
[pid 30453] +++ exited with 1 +++
[pid 30452] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=30453, si_status=1, si_utime=2, si_stime=1} ---
/tmp/ccCetiDS.o: In function `main':
simple.c:(.text+0x1b): undefined reference to `cass_cluster_new'
simple.c:(.text+0x88): undefined reference to `cass_cluster_setopt'
simple.c:(.text+0xae): undefined reference to `cass_cluster_connect'
simple.c:(.text+0xc4): undefined reference to `cass_future_wait'
simple.c:(.text+0xd3): undefined reference to `cass_future_error_code'
simple.c:(.text+0xf5): undefined reference to `cass_future_get_session'
simple.c:(.text+0x116): undefined reference to `cass_string_init'
simple.c:(.text+0x13b): undefined reference to `cass_statement_new'
simple.c:(.text+0x155): undefined reference to `cass_session_execute'
simple.c:(.text+0x165): undefined reference to `cass_future_wait'
simple.c:(.text+0x171): undefined reference to `cass_future_error_code'
simple.c:(.text+0x190): undefined reference to `cass_future_get_result'
simple.c:(.text+0x1a0): undefined reference to `cass_iterator_from_result'
simple.c:(.text+0x1b5): undefined reference to `cass_iterator_get_row'
simple.c:(.text+0x1ca): undefined reference to `cass_row_get_column'
simple.c:(.text+0x1d9): undefined reference to `cass_value_get_string'
simple.c:(.text+0x1ea): undefined reference to `cass_row_get_column'
simple.c:(.text+0x1fc): undefined reference to `cass_value_get_bool'
simple.c:(.text+0x20d): undefined reference to `cass_row_get_column'
simple.c:(.text+0x21c): undefined reference to `cass_value_get_string'
simple.c:(.text+0x22d): undefined reference to `cass_row_get_column'
simple.c:(.text+0x23c): undefined reference to `cass_value_get_string'
simple.c:(.text+0x295): undefined reference to `cass_iterator_next'
simple.c:(.text+0x2a9): undefined reference to `cass_result_free'
simple.c:(.text+0x2b5): undefined reference to `cass_iterator_free'
simple.c:(.text+0x2c3): undefined reference to `cass_future_error_message'
simple.c:(.text+0x2fa): undefined reference to `cass_future_free'
simple.c:(.text+0x309): undefined reference to `cass_session_close'
simple.c:(.text+0x319): undefined reference to `cass_future_wait'
simple.c:(.text+0x32a): undefined reference to `cass_future_error_message'
simple.c:(.text+0x364): undefined reference to `cass_future_free'
simple.c:(.text+0x373): undefined reference to `cass_cluster_free'
collect2: error: ld returned 1 exit status
[pid 30452] +++ exited with 1 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=30452, si_status=1, si_utime=0, si_stime=0} ---
+++ exited with 1 +++
我无法推断出为什么会发生这种情况,因为路径中存在库另一个调试输出:link
在进一步调查中,我分别编译和链接了这些文件。还是没有进展
root@ubuntu-cassandra:~/cpp-driver/examples/simple# g++ -g -v -o simpler -L /usr/local/lib/ -lcassandra simple.o
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-g' '-v' '-o' 'simpler' '-L/usr/local/lib/' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/4.8/collect2 --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o simpler /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o -L/usr/local/lib/ -L/usr/lib/gcc/x86_64-linux-gnu/4.8 -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../.. -lcassandra simple.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/4.8/crtend.o /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crtn.o
simple.o: In function `main':
simple.c:(.text+0x1b): undefined reference to `cass_cluster_new'
simple.c:(.text+0x88): undefined reference to `cass_cluster_setopt'
simple.c:(.text+0xae): undefined reference to `cass_cluster_connect'
simple.c:(.text+0xc4): undefined reference to `cass_future_wait'
simple.c:(.text+0xd3): undefined reference to `cass_future_error_code'
simple.c:(.text+0xf5): undefined reference to `cass_future_get_session'
simple.c:(.text+0x116): undefined reference to `cass_string_init'
simple.c:(.text+0x13b): undefined reference to `cass_statement_new'
simple.c:(.text+0x155): undefined reference to `cass_session_execute'
simple.c:(.text+0x165): undefined reference to `cass_future_wait'
simple.c:(.text+0x171): undefined reference to `cass_future_error_code'
simple.c:(.text+0x190): undefined reference to `cass_future_get_result'
simple.c:(.text+0x1a0): undefined reference to `cass_iterator_from_result'
simple.c:(.text+0x1b5): undefined reference to `cass_iterator_get_row'
simple.c:(.text+0x1ca): undefined reference to `cass_row_get_column'
simple.c:(.text+0x1d9): undefined reference to `cass_value_get_string'
simple.c:(.text+0x1ea): undefined reference to `cass_row_get_column'
simple.c:(.text+0x1fc): undefined reference to `cass_value_get_bool'
simple.c:(.text+0x20d): undefined reference to `cass_row_get_column'
simple.c:(.text+0x21c): undefined reference to `cass_value_get_string'
simple.c:(.text+0x22d): undefined reference to `cass_row_get_column'
simple.c:(.text+0x23c): undefined reference to `cass_value_get_string'
simple.c:(.text+0x295): undefined reference to `cass_iterator_next'
simple.c:(.text+0x2a9): undefined reference to `cass_result_free'
simple.c:(.text+0x2b5): undefined reference to `cass_iterator_free'
simple.c:(.text+0x2c3): undefined reference to `cass_future_error_message'
simple.c:(.text+0x2fa): undefined reference to `cass_future_free'
simple.c:(.text+0x309): undefined reference to `cass_session_close'
simple.c:(.text+0x319): undefined reference to `cass_future_wait'
simple.c:(.text+0x32a): undefined reference to `cass_future_error_message'
simple.c:(.text+0x364): undefined reference to `cass_future_free'
simple.c:(.text+0x373): undefined reference to `cass_cluster_free'
collect2: error: ld returned 1 exit status
root@ubuntu-cassandra:~/cpp-driver/examples/simple# nm simple.o
U cass_cluster_connect
U cass_cluster_free
U cass_cluster_new
U cass_cluster_setopt
U cass_future_error_code
U cass_future_error_message
U cass_future_free
U cass_future_get_result
U cass_future_get_session
U cass_future_wait
U cass_iterator_free
U cass_iterator_from_result
U cass_iterator_get_row
U cass_iterator_next
U cass_result_free
U cass_row_get_column
U cass_session_close
U cass_session_execute
U cass_statement_new
U cass_string_init
U cass_value_get_bool
U cass_value_get_string
U fprintf
0000000000000000 T main
U printf
U stderr
U strlen
最佳答案
您需要在命令中使用“-lcassandra”而不是“simple.o”:
g++ simple.o -g -o simpler -L/usr/local/lib/ -lcassandra
这是我找到的解释原因的答案:Why does the order of '-l' option in gcc matter?
关于c++ - 运行 datastax 的 cpp-driver 示例时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24571384/
这个问题在这里已经有了答案: 关闭 11 年前。 Possible Duplicate: Sample data for IPv6? 除了 wireshark 在其网站上提供的内容之外,是否有可以下
我正在寻找可以集成到现有应用程序中并使用多拖放功能的示例或任何现成的解决方案。我在互联网上找到的大多数解决方案在将多个项目从 ListBox 等控件拖放到另一个 ListBox 时效果不佳。谁能指出我
我是 GATE Embedded 的新手,我尝试了简单的示例并得到了 NoClassDefFoundError。首先我会解释我尝试了什么 在 D:\project\gate-7.0 中下载并提取 Ga
是否有像 Eclipse 中的 SWT 示例那样的多合一 JFace 控件示例?搜索(在 stackoverflow.com 上使用谷歌搜索和搜索)对我没有帮助。 如果它是一个独立的应用程序或 ecl
我找不到任何可以清楚地解释如何通过 .net API(特别是 c#)使用谷歌计算引擎的内容。有没有人可以指点我什么? 附言我知道 API 引用 ( https://developers.google.
最近在做公司的一个项目时,客户需要我们定时获取他们矩阵系统的数据。在与客户进行对接时,提到他们的接口使用的目前不常用的BASIC 认证。天呢,它好不安全,容易被不法人监听,咋还在使用呀。但是没办法呀,
最近在做公司的一个项目时,客户需要我们定时获取他们矩阵系统的数据。在与客户进行对接时,提到他们的接口使用的目前不常用的BASIC 认证。天呢,它好不安全,容易被不法人监听,咋还在使用呀。但是没办法呀,
我正在尝试为我的应用程序设计配置文件格式并选择了 YAML。但是,这(显然)意味着我需要能够定义、解析和验证正确的 YAML 语法! 在配置文件中,必须有一个名为 widgets 的集合/序列。 .这
你能给我一个使用 pysmb 库连接到一些 samba 服务器的例子吗?我读过有类 smb.SMBConnection.SMBConnection(用户名、密码、my_name、remote_name
linux服务器默认通过22端口用ssh协议登录,这种不安全。今天想做限制,即允许部分来源ip连接服务器。 案例目标:通过iptables规则限制对linux服务器的登录。 处理方法:编
我一直在寻找任何 PostProjectAnalysisTask 工作代码示例,但没有看。 This页面指出 HipChat plugin使用这个钩子(Hook),但在我看来它仍然使用遗留的 Po
我发现了 GWT 的 CustomScrollPanel 以及如何自定义滚动条,但我找不到任何示例或如何设置它。是否有任何示例显示正在使用的自定义滚动条? 最佳答案 这是自定义 native 滚动条的
我正在尝试开发一个 Backbone Marionette 应用程序,我需要知道如何以最佳方式执行 CRUD(创建、读取、更新和销毁)操作。我找不到任何解释这一点的资源(仅适用于 Backbone)。
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题?通过 editing this post 添加详细信息并澄清问题. 去年关闭。 Improve this
我需要一个提交多个单独请求的 django 表单,如果没有大量定制,我找不到如何做到这一点的示例。即,假设有一个汽车维修店使用的表格。该表格将列出商店能够进行的所有可能的维修,并且用户将选择他们想要进
我有一个 Multi-Tenancy 应用程序。然而,这个相同的应用程序有 liquibase。我需要在我的所有数据源中运行 liquibase,但是我不能使用这个 Bean。 我的应用程序.yml
我了解有关单元测试的一般思想,并已在系统中发生复杂交互的场景中使用它,但我仍然对所有这些原则结合在一起有疑问。 我们被警告不要测试框架或数据库。好的 UI 设计不适合非人工测试。 MVC 框架不包括一
我正在使用 docjure并且它的 select-columns 函数需要一个列映射。我想获取所有列而无需手动指定。 如何将以下内容生成为惰性无限向量序列 [:A :B :C :D :E ... :A
$condition使用说明和 $param在 findByAttributes在 Yii 在大多数情况下,这就是我使用 findByAttributes 的方式 Person::model()->f
我在 Ubuntu 11.10 上安装了 qtcreator sudo apt-get install qtcreator 安装的版本有:QT Creator 2.2.1、QT 4.7.3 当我启动
我是一名优秀的程序员,十分优秀!