0

As an input the function gets the file path anmd name parameter

const QString& buildSourcePathAndName  

It needs to extract the path onlyfor futher processing. I used the below code to do that .

boost::filesystem::path p(string(buildSourcePathAndName.toLatin1().data()));
m_pSourceCodePath = p.parent_path().string();

On windows it works OK.But on linux (ubuntu) I can`t compile it,getting the error.

undefined reference to `boost::filesystem3::path::parent_path() const'

I`ve read about this error - proposes to change boost lib version.I can`t do that in our system. What could be the possible solution for this issue? (I don`t want to implement the code which extracts the path,but rathe use some existing functions)

YAKOVM
  • 9,805
  • 31
  • 116
  • 217
  • 1
    ehm... boost version? you use -lboost_filesystem? – ForEveR Jan 28 '13 at 11:52
  • And remember to put it at the end of the compile command(http://stackoverflow.com/questions/9966959/linker-errors-when-compiling-against-glib/9966989#9966989) – hmjd Jan 28 '13 at 11:57

1 Answers1

2

On Windows, boost libraries use pragmas to automatically add the libraries to the linker command line. When building for linux you need to add the libraries explicitly in whatever build system you use (adding -lboost_filesystem at the end of the linker command line as suggested by ForEveR and hmjd)

dhavenith
  • 2,028
  • 13
  • 14