我在代码中发现了一个错误,导致我无法将结果输出到终端。我让程序在linux中运行(输出目录);但是,当我在OSX上编译它时,终端在执行pProgram.parent_path().string();
后退出报告。
我在OSX中缺少什么阻止Boost 1.54正常运行?我能做些什么让它正常执行?谢谢。
#include <iostream>
#include <cstring>
#include <boost/filesystem.hpp>
int main()
{
boost::filesystem::path pProgram( boost::filesystem::current_path() );
std::cout << "\nhello, world - point A!\n";
std::string workingDirectory = pProgram.parent_path().string()
std::cout << "\nhello, world - point B!\n";
std::cout << workingDirectory;
return 0;
}
hello, world - point A!
Press <RETURN> to close this window..
cache()
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += main.cpp
macx {
INCLUDEPATH += /opt/local/lib
INCLUDEPATH += /opt/local/include
INCLUDEPATH += opt/local/include
DEPENDPATH += opt/local/include
unix: LIBS += -L$$PWD/../../../../../opt/local/lib/ -lboost_filesystem-mt
unix: PRE_TARGETDEPS += $$PWD/../../../../../opt/local/lib/libboost_filesystem-mt.a
unix: LIBS += -L$$PWD/../../../../../opt/local/lib/ -lboost_system-mt
unix: PRE_TARGETDEPS += $$PWD/../../../../../opt/local/lib/libboost_system-mt.a
}