trying to pull and build Visqol following the instructions provided for Linux. I downloaded Bazel, everything seems fine. But when I try to execute with bazel build :visqol -c opt i get the following errors
bazel-out/k8-opt/bin/_objs/visqol/main.o:main.cc:function main: error: undefined reference to 'std::filesystem::__cxx11::path::_M_split_cmpts()'
bazel-out/k8-opt/bin/_objs/visqol/main.o:main.cc:function main: error: undefined reference to 'std::filesystem::status(std::filesystem::__cxx11::path const&)'
bazel-out/k8-opt/bin/_objs/visqol_lib/commandline_parser.o:commandline_parser.cc:function Visqol::VisqolCommandLineParser::FileExists(Visqol::FilePath const&): error: undefined reference to 'std::filesystem::__cxx11::path::_M_split_cmpts()'
bazel-out/k8-opt/bin/_objs/visqol_lib/commandline_parser.o:commandline_parser.cc:function Visqol::VisqolCommandLineParser::FileExists(Visqol::FilePath const&): error: undefined reference to 'std::filesystem::status(std::filesystem::__cxx11::path const&)'
bazel-out/k8-opt/bin/_objs/visqol_lib/commandline_parser.o:commandline_parser.cc:function Visqol::VisqolCommandLineParser::ReadFilesToCompare(Visqol::FilePath const&): error: undefined reference to 'std::filesystem::__cxx11::path::_M_split_cmpts()'
bazel-out/k8-opt/bin/_objs/visqol_lib/commandline_parser.o:commandline_parser.cc:function Visqol::VisqolCommandLineParser::BuildFilePairPaths(Visqol::CommandLineArgs const&): error: undefined reference to 'std::filesystem::__cxx11::path::_M_split_cmpts()'
bazel-out/k8-opt/bin/_objs/visqol_lib/commandline_parser.o:commandline_parser.cc:function Visqol::VisqolCommandLineParser::BuildFilePairPaths(Visqol::CommandLineArgs const&): error: undefined reference to 'std::filesystem::status(std::filesystem::__cxx11::path const&)'
bazel-out/k8-opt/bin/_objs/visqol_lib/commandline_parser.o:commandline_parser.cc:function Visqol::VisqolCommandLineParser::BuildFilePairPaths(Visqol::CommandLineArgs const&): error: undefined reference to 'std::filesystem::status(std::filesystem::__cxx11::path const&)'
bazel-out/k8-opt/bin/_objs/visqol_lib/commandline_parser.o:commandline_parser.cc:function Visqol::VisqolCommandLineParser::Parse(int, char**): error: undefined reference to 'std::filesystem::current_path[abi:cxx11]()'
bazel-out/k8-opt/bin/_objs/visqol_lib/commandline_parser.o:commandline_parser.cc:function Visqol::VisqolCommandLineParser::Parse(int, char**): error: undefined reference to 'std::filesystem::current_path[abi:cxx11]()'
collect2: error: ld returned 1 exit status
I've seen similar issues in c++ on the web but most of these are building with make commands and solve this by adding the -lstdc++fs or LDLIBS=-lstdc++fs options. However, those are unrecognized for Bazel
I'm on Debian 10.13 and my Bazel version is 5.3.1, my c++ version seems to be 8.3.0
In accordance with how to use std::filesystem on gcc 8?, change the line build --linkopt=-ldl in .bazelrc into:
build --linkopt=-lstdc++fs -ldl
You could also open a ticket in the Visgol repo and tell them about this problem and get a proper solution in the future releases of Visgol.
Related
I am a beginner to organizing C++ projects and I have been trying to start an Open Dynamics Engine project for a week now but I keep getting several errors. First, what I have done:
Installed ode-0.13.1 with automake as directed in the manual.
Created a file test.cpp with the code from the bouncing ball HOWTO.
Wrote a makefile to compile.
But when I run my makefile, I get the following errors:
gcc -Wall -g -DdDOUBLE -o test test.o -L/home/username/ode-0.13.1/ode/src/libode.la -L/home/username/ode-0.13.1/drawstuff/src/libdrawstuff.la -L/usr/X11R6/lib -L/usr/lib -L/usr/local/lib -I. -I/home/username/ode-0.13.1/include/ -I/usr/X11R6/include -I/usr/include -lm -lode -lGL -lGLU
/usr/local/lib/libode.a(collision_trimesh_box.o): In function dCalcVectorLength3':
/home/username/ode-0.13.1/ode/src/../../include/ode/odemath.h:148: undefined reference tosqrt'
/home/username/ode-0.13.1/ode/src/../../include/ode/odemath.h:148: undefined reference to sqrt'
/home/username/ode-0.13.1/ode/src/../../include/ode/odemath.h:148: undefined reference tosqrt'
/usr/local/lib/libode.a(util.o): In function dxStepBody(dxBody*, double)':
/home/username/ode-0.13.1/ode/src/util.cpp:618: undefined reference tosincos'
/home/username/ode-0.13.1/ode/src/util.cpp:630: undefined reference to sincos'
/home/username/ode-0.13.1/ode/src/util.cpp:628: undefined reference tosqrt'
/home/username/ode-0.13.1/ode/src/util.cpp:590: undefined reference to `sqrt'
... (and this keeps going for pages)
/usr/local/lib/libode.a(OPC_AABBTree.o): In function Opcode::AABBTree::Build(Opcode::AABBTreeBuilder*)':
/home/username/ode-0.13.1/OPCODE/OPC_AABBTree.cpp:413: undefined reference tooperator new[](unsigned long)'
/home/username/ode-0.13.1/OPCODE/OPC_AABBTree.cpp:427: undefined reference to operator new[](unsigned long)'
/usr/local/lib/libode.a(OPC_AABBTree.o): In functionOpcode::AABBTreeNode::~AABBTreeNode()':
/home/username/ode-0.13.1/OPCODE/OPC_AABBTree.cpp:83: undefined reference to operator delete[](void*, unsigned long)'
/usr/local/lib/libode.a(OPC_Collider.o): In functionOpcode::Collider::~Collider()':
/home/username/ode-0.13.1/OPCODE/OPC_Collider.cpp:54: undefined reference to operator delete(void*, unsigned long)'
/usr/local/lib/libode.a(OPC_Collider.o):(.data.rel.ro._ZTIN6Opcode8ColliderE[_ZTIN6Opcode8ColliderE]+0x0): undefined reference tovtable for __cxxabiv1::__class_type_info'
/usr/local/lib/libode.a(OPC_Collider.o):(.data.rel.ro._ZTVN6Opcode8ColliderE[_ZTVN6Opcode8ColliderE]+0x20): undefined reference to `__cxa_pure_virtual'
collect2: error: ld returned 1 exit status
makefile:14: recipe for target 'test' failed
make: *** [test] Error 1
These errors seem like the library has not been set up correctly, but I'm pretty sure I've properly installed and my -L's are set to the correct paths.
Note 1: the demos included with the ode library work.
Note 2: I've tried (and failed) to install other versions of ode previously. I did my best with make uninstall and make clean to clean these failed installs, but I think they may be affecting new installs because when I run sudo make install for the first time there is an awful lot of Nothing to do here... messages.
I am new to qt. I am using qt creator successfully to create ui. I need bluetooth functionality from qt. I had earlier version of code running through terminal. I copy pasted the running code. I get a lot of undefined references.
error: undefined reference to str2ba'
error: undefined reference tosqlite3_open'
error: undefined reference to sqlite3_errmsg'
error: undefined reference tosqlite3_errmsg'
error: undefined reference to sqlite3_free'
error: undefined reference tosqlite3_close'
error: undefined reference to hci_get_route'
error: undefined reference tohci_open_dev'
error: undefined reference to hci_inquiry'
error: undefined reference toba2str'
error: undefined reference to hci_read_remote_name'
error: undefined reference toba2str'
Is there anything like linux apis can not be used in qt? how to integrate the app then? Or do I have to link libraries like -lpthread -lbluetooth etc.
"Undefined reference..." seems to be a linker error.
Do you link against libsqlite3 and libbluetooth?
Adding
-lsqplite3 -lbluetooth
to your ld/g++ command line helps in that case
Could someone tell me how to solve this issue. I'm trying to compile this library here:
http://www.codeproject.com/Articles/42504/ExcelFormat-Library
I'm doing: g++ Examples.cpp
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
If my question is to easy/basic/simple/os dependent... please tell recommend me a book or two that I should read first in order to be able to figure out an answer for this question.
Here's the error message:
/tmp/cczceVBy.o: In function example1(char const*)':
Examples.cpp:(.text+0x2d): undefined reference toYExcel::BasicExcel::BasicExcel()'
Examples.cpp:(.text+0x41): undefined reference to YExcel::BasicExcel::New(int)'
Examples.cpp:(.text+0x55): undefined reference toYExcel::BasicExcel::GetWorksheet(int)'
Examples.cpp:(.text+0x75): undefined reference to ExcelFormat::XLSFormatManager::XLSFormatManager(YExcel::BasicExcel&)'
Examples.cpp:(.text+0xf2): undefined reference toYExcel::BasicExcelWorksheet::Cell(int, int)'
Examples.cpp:(.text+0x10d): undefined reference to YExcel::BasicExcelCell::Set(char const*)'
Examples.cpp:(.text+0x166): undefined reference toYExcel::BasicExcelWorksheet::Cell(int, int)'
Examples.cpp:(.text+0x173): undefined reference to YExcel::BasicExcelCell::Set(char const*)'
Examples.cpp:(.text+0x287): undefined reference toYExcel::BasicExcelWorksheet::Cell(int, int)'
Examples.cpp:(.text+0x2a2): undefined reference to YExcel::BasicExcelCell::Set(char const*)'
Examples.cpp:(.text+0x2df): undefined reference toYExcel::BasicExcelWorksheet::Cell(int, int)'
---- snip many more of the same kind -----
collect2: ld returned 1 exit status
Use BasicExcel.Cpp and BasicExcel.hpp file in your project directory which comes with the Excelformat zip file.
I would like to compile the following program that makes alignment of fasta sequences, the program is available in:
http://compbio.cs.princeton.edu/mems/
I have downloaded a zip file called sparseMEM and downloaded the g++ in Ubuntu Linux, in the directory created there is a Makefile archive, so I tried to compile with make. The problem is that I got the following error:
g++ -lpthread -O3 -DSIXTYFOURBITS mummer.o qsufsort.o sparseSA.o fasta.o -o mummer
mummer.o: In function `main':
mummer.cpp:(.text.startup+0x480): undefined reference to `pthread_create'
mummer.cpp:(.text.startup+0x4a8): undefined reference to `pthread_join'
sparseSA.o: In function `sparseSA::MEM(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::vector<match_t, std::allocator<match_t> >&, int, bool, int)':
sparseSA.cpp:(.text+0x3bbc): undefined reference to `pthread_create'
sparseSA.cpp:(.text+0x3be0): undefined reference to `pthread_join'
collect2: ld returned 1 exit status
make: *** [mummer] Error 1
how I can make it run?
also if somebody knows how to test this program it would be great
thanks
For Linux you need -pthread instead of -lpthread.
Hi I'm trying to use gnuplot-iostream, at the minute I'm just trying to get the code here working. When I try to combile I get errors in the linker saying:
In function `stream<int, boost::iostreams::file_descriptor_flags>':
/usr/include/boost/iostreams/stream.hpp:130: undefined reference to `boost::iostreams::file_descriptor_sink::file_descriptor_sink(int, boost::iostreams::file_descriptor_flags)'
In function `boost::iostreams::file_descriptor_sink boost::iostreams::detail::wrap<boost::iostreams::file_descriptor_sink>(boost::iostreams::file_descriptor_sink const&, boost::disable_if<boost::iostreams::is_std_io<boost::iostreams::file_descriptor_sink>, void>::type*)':
/usr/include/boost/iostreams/detail/wrap_unwrap.hpp:53: undefined reference to `boost::iostreams::file_descriptor_sink::file_descriptor_sink(boost::iostreams::file_descriptor_sink const&)'
In function `concept_adapter':
/usr/include/boost/iostreams/detail/adapter/concept_adapter.hpp:67: undefined reference to `boost::iostreams::file_descriptor_sink::file_descriptor_sink(boost::iostreams::file_descriptor_sink const&)'
/usr/include/boost/iostreams/detail/adapter/concept_adapter.hpp:38: undefined reference to `boost::iostreams::file_descriptor_sink::file_descriptor_sink(boost::iostreams::file_descriptor_sink const&)'
In function `long boost::iostreams::detail::write_device_impl<boost::iostreams::output>::write<boost::iostreams::file_descriptor_sink>(boost::iostreams::file_descriptor_sink&, boost::iostreams::char_type_of<boost::iostreams::file_descriptor_sink>::type const*, long)':
/usr/include/boost/iostreams/write.hpp:121: undefined reference to `boost::iostreams::file_descriptor::write(char const*, long)'
In function `void boost::iostreams::detail::close_impl<boost::iostreams::closable_tag>::close<boost::iostreams::file_descriptor_sink>(boost::iostreams::file_descriptor_sink&, std::_Ios_Openmode)':
/usr/include/boost/iostreams/close.hpp:224: undefined reference to `boost::iostreams::file_descriptor::close()'
In function `std::fpos<__mbstate_t> boost::iostreams::detail::seek_device_impl<boost::iostreams::any_tag>::seek<boost::iostreams::file_descriptor_sink>(boost::iostreams::file_descriptor_sink&, long, std::_Ios_Seekdir, std::_Ios_Openmode)':
/usr/include/boost/iostreams/seek.hpp:137: undefined reference to `boost::iostreams::file_descriptor::seek(long, std::_Ios_Seekdir)'
collect2: ld returned 1 exit status
Note I have boost installed and have previously compiled programs that use iostream.
Any help massively appreciated. Thanks
Ruling out the obvious... are you compiling with g++ -lboost_iostreams? If you can share some information about how the compiler and linker are being invoked it will make it easier to answer your question.
Run into exact problem when tried to use g++ with gnuplot-iostream library.
g++ prog.cpp -L/usr/lib -lboost_filesystem -lboost_system -lboost_iostreams
Resolved the issue for me - the code were compiled successfully with no errors.