gazebosim / gazebosim/sdformat

unresolved symbols when compiling with Qt's qmake

Open
#126 10 comments 0 reactions 0 assignees View on GitHub
bug major
Dominant language
C++
Stars
216
Forks
125
Avg merge
1d 14h
Merged PRs (30d)
14

Description

**Original report ([archived issue](https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/issues/126)) by Federico Ferri (Bitbucket: [f_ferri](https://bitbucket.org/%7B477cc526-91b3-4ba1-aa68-153314ae0d06%7D/)).**

----------------------------------------
I get undefined symbols:

* sdf::readFile(std::string const&, boost::shared_ptr)
* sdf::Element::HasElement(std::string const&) const

with this minimal testcase:

#include
int main(int argc, char **argv)
{
sdf::SDFPtr sdfParsed(new sdf::SDF);
sdf::init(sdfParsed);
if(sdf::readFile(argv[1], sdfParsed))
{
sdf::ElementPtr e = sdfParsed->root;
if(e->HasElement("model"))
{
std::cout << "the SDF contains a element" << std::endl;
}
}
}

Note: platform is OSX, sdformat (2.3.2) is installed via homebrew.

When compiling with plain make, no undefined symbols.

qmakefile.pro:

QT += core
TARGET = sdftest
INCLUDEPATH += "/usr/local/Cellar/boost/1.60.0_1/include"
INCLUDEPATH += "/usr/local/Cellar/sdformat/2.3.2/include/sdformat-2.3"
INCLUDEPATH += "/usr/local/Cellar/tinyxml/2.6.2/include"
QMAKE_LIBDIR += "/usr/local/Cellar/sdformat/2.3.2/lib"
LIBS += "-lsdformat"
SOURCES += sdftest.cpp

Makefile

CXXFLAGS=-I/usr/local/Cellar/sdformat/2.3.2/include/sdformat-2.3
sdftest: sdftest.o
$(CXX) -L/usr/local/Cellar/sdformat/2.3.2/lib -lsdformat $^ -o $@

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.