Boost Filesystem Error, am I Linking?
More trouble. Eclipse CDT tells me that when I try and use boost::filesystem::initial_pathboost::filesystem::path() that in include/boost/filesystem/operations.hpp on line 503 that I have a "undefined reference to 'boost::filesystem::detail::get_current_path_api(std::string&)'" I went to Google and found a forum thread where the person wasn't linking against Boost's Filesystem library. I looked in the lib/ section under my MinGW installation, however, and found libboost_filesystem.a, right where it should be. Is there still the potential for it to not be linking, or am I just not using something correctly? I tried a simpler usage of the same function and got the same problem. I should warn you, I'm still rather green at C++, all my previous programming training being in Java. I'm still getting acclimated to C++, pretty quickly, but still every once in a while I run into a wall and need someone to pick me up and steer me in the right direction, so to speak. Thanks in advance for any help you can give!
How can I instantiate a static pointer of a class using boost::scoped_pointer ? like for example: static classA *A; int main { ... ... A = new ClassA (PArameter list); } How do I do ths with boost::scoped_pointer. --------------------------------- Now you can chat without downloading messenger. Click here to know how.
________________________________ From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of swapna Sent: 21 November 2007 10:10 To: boost-users@lists.boost.org Subject: [Boost-users] scoped_ptr How can I instantiate a static pointer of a class using boost::scoped_pointer ? like for example: static classA *A; int main { ... ... A = new ClassA (PArameter list); } How do I do ths with boost::scoped_pointer. ________________________________ Now you can chat without downloading messenger. Click here <http://in.rd.yahoo.com/tagline_webmessenger_5/*http://in.messenger.yaho o.com/webmessengerpromo.php> to know how. Surely the definition of the scoped_ptr is therefore outside of the scope in which you use it, so you should probably be using shared_ptr? James This message (including any attachments) contains confidential and/or proprietary information intended only for the addressee. Any unauthorized disclosure, copying, distribution or reliance on the contents of this information is strictly prohibited and may constitute a violation of law. If you are not the intended recipient, please notify the sender immediately by responding to this e-mail, and delete the message from your system. If you have any questions about this e-mail please notify the sender immediately.
How can I instantiate a static pointer of a class using boost::scoped_pointer ? like for example: static classA *A; int main { ... ... A = new ClassA (PArameter list); } How do I do ths with boost::scoped_pointer. --------------------------------- Save all your chat conversations. Find them online.
See inline swapna wrote:
How can I instantiate a static pointer of a class using boost::scoped_pointer ? like for example:
static classA *A;
namespace { boost::scoped_ptr<classA> aPtr; }
int main { ... ... A = new ClassA (PArameter list);
aPtr.reset( new ClassA(ParameterList) );
} How do I do this with boost::scoped_pointer.
But there is no need to use static or unnamed namespace as the same effect could be accomplished with aPtr being declared within the scope of main, AFAIC. Jeff Flinn
participants (4)
-
Chris Miller
-
Hughes, James
-
Jeff Flinn
-
swapna