c++ - Multiple definition error while linking: multiple definition of `typeinfo name
问题描述
I'm very new to c++ (my background is in python and java) and I'm trying to build the cockroachdb project on a raspberry pi. To build I ran the command make build -j1
.
However I am getting the error below:
[ 0%] Linking CXX shared library lib/libgeos.so
/usr/bin/ld: CMakeFiles/geos.dir/src/noding/BasicSegmentString.cpp.o:(.rodata+0x0): multiple definition of `typeinfo name for geos::noding::BasicSegmentString'; CMakeFiles/geos.dir/src/inlines.cpp.o:(.rodata+0x6c): first defined here
/usr/bin/ld: CMakeFiles/geos.dir/src/noding/BasicSegmentString.cpp.o:(.data.rel.ro+0x0): multiple definition of `typeinfo for geos::noding::BasicSegmentString'; CMakeFiles/geos.dir/src/inlines.cpp.o:(.data.rel.ro+0x20): first defined here
/usr/bin/ld: CMakeFiles/geos.dir/src/noding/BasicSegmentString.cpp.o:(.data.rel.ro+0xc): multiple definition of `vtable for geos::noding::BasicSegmentString'; CMakeFiles/geos.dir/src/inlines.cpp.o:(.data.rel.ro+0xac): first defined here
collect2: error: ld returned 1 exit status
make[4]: *** [CMakeFiles/geos.dir/build.make:4569: lib/libgeos.so.3.8.1] Error 1
make[3]: *** [CMakeFiles/Makefile2:569: CMakeFiles/geos.dir/all] Error 2
make[2]: *** [CMakeFiles/Makefile2:616: CMakeFiles/geos_c.dir/rule] Error 2
make[1]: *** [Makefile:418: geos_c] Error 2
make: *** [Makefile:757: libgeos_inner] Error 2
I went to CMakeFiles/geos.dir/build.make
and on line 4569 I see:
$(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/geos.dir/link.txt --verbose=$(VERBOSE)
but I don't really know what is wrong and what to do next to fix this.
Can someone help out a c++ beginner? Thank you.
解决方案
推荐阅读
- python - python urllib2.urlopen SSL:CERTIFICATE_VERIFY_FAILED
- reactjs - React-Bootstrap NavItem 未触发 onClick 处理程序
- primefaces - pe:blockUI file.gif 不起作用
- java - 如何定义某些内容并将其保存在 HashMap 中
- jhipster - JHipster 网关应用程序 ZuulException
- url - 我怎样才能传递不是英文的url变量
- nested - Accessing field data from table in a deep structure?
- c# - 没有任何 SELECT(!):“已经有一个打开的 DataReader 与此连接关联”
- php - Laravel:增加第二次登录尝试的时间
- node-red - 在 node-red 上看不到调试消息