Hi,
I'm having a lot of trouble with this, mainly because I'm new to C++.
I'm trying to get the filename and extension from a string with this.
'''
#include <boost/filesystem.hpp>
namespace fs = boost::filesystem;
using boost::filesystem::path;
path p = path(imagePath);
std::string filename = p.filename().string();
std::string extension = p.stem().string();
'''
I get this error:
'''
LJSView.cpp:(.text+0xc304): undefined reference to
`boost::filesystem::path::filename() const'
LJSView.cpp:(.text+0xc33c): undefined reference to
`boost::filesystem::path::stem() const'
'''
I've tried adding the following to the plugin/project Superbuild.cmake
'''
# ----------------- Boost ------------------------
-DBOOST_ROOT:PATH=${BOOST_ROOT}
-DBOOST_LIBRARYDIR:PATH=${BOOST_LIBRARYDIR}
'''
I had to add too the following to the plugin/project CMakeLists.txt
'''
mitk_create_plugin(
...
PACKAGE_DEPENDS Boost
...
)
'''
But I can't get it to work. Any advice? Thanks :)
Regards,
--
Luis J. Salvatierra
http://www.ljsalvatierra.com
Python San Sebastián - ACPySS
------------------------------------------------------------------------------
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users