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)

2
  • 1
    ehm... boost version? you use -lboost_filesystem? Commented Jan 28, 2013 at 11:52
  • And remember to put it at the end of the compile command(stackoverflow.com/questions/9966959/…) Commented Jan 28, 2013 at 11:57

1 Answer 1

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)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.