Hello,
How can I include the boost library in a c++ program with TextMate? So I can run programs like using TextMate.
#include <boost/lambda/lambda.hpp> #include <iostream> #include <iterator> #include <algorithm>
int main() { using namespace boost::lambda; typedef std::istream_iterator<int> in;
std::for_each( in(std::cin), in(), std::cout << (_1 * 3) << " " ); }
Thanks for the reaction, Andre
Just make sure it's in Textmate's path (configured in the preferences), then it should work like a charm :)
Best regards Thor
lørdag 15. oktober 2011 skrev Andre de Boer følgende:
Hello,
How can I include the boost library in a c++ program with TextMate? So I can run programs like using TextMate.
#include <boost/lambda/lambda.hpp> #include <iostream> #include <iterator> #include <algorithm>
int main() { using namespace boost::lambda; typedef std::istream_iterator<int> in;
std::for_each( in(std::cin), in(), std::cout << (_1 * 3) << " " ); }
Thanks for the reaction, Andre
textmate mailing list textmate@lists.macromates.com javascript:; http://lists.macromates.com/listinfo/textmate
Hello Thor,
I added /opt/local/include in TextMate's path: /opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/2.6/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/texbin:/opt/local/include
Boost is in /opt/local/include:
MacBook-Pro-van-Andre-de-Boer:include aajd$ pwd /opt/local/include MacBook-Pro-van-Andre-de-Boer:include aajd$ ls boost accumulators date_time.hpp intrusive_ptr.hpp ....
But I still get this message: /Users/aajd/Desktop/Rspace/test.cpp:1:35: error: boost/lambda/lambda.hpp: No such file or directory
Thanks for the help, Andre
On 15 okt. 2011, at 20:27, Thor Erik Lie wrote:
Just make sure it's in Textmate's path (configured in the preferences), then it should work like a charm :)
Best regards Thor
lørdag 15. oktober 2011 skrev Andre de Boer følgende: Hello,
How can I include the boost library in a c++ program with TextMate? So I can run programs like using TextMate.
#include <boost/lambda/lambda.hpp> #include <iostream> #include <iterator> #include <algorithm>
int main() { using namespace boost::lambda; typedef std::istream_iterator<int> in;
std::for_each( in(std::cin), in(), std::cout << (_1 * 3) << " " ); }
Thanks for the reaction, Andre
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
-- Best regards / Med vennlig hilsen Thor Erik Lie +47 976 20 928 http://thorerik.net
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
is /opt/local/include in your global path as well? it could be that g++ runs under your user and takes the global PATH and not the one from TextMate
Best regards / Med vennlig hilsen Thor Erik http://thorerik.net
2011/10/16 Andre de Boer aajd@xs4all.nl
Hello Thor,
I added /opt/local/include in TextMate's path:
/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/2.6/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/texbin:/opt/local/include
Boost is in /opt/local/include:
MacBook-Pro-van-Andre-de-Boer:include aajd$ pwd /opt/local/include MacBook-Pro-van-Andre-de-Boer:include aajd$ ls boost accumulators date_time.hpp intrusive_ptr.hpp ....
But I still get this message: /Users/aajd/Desktop/Rspace/test.cpp:1:35: error: boost/lambda/lambda.hpp: No such file or directory
Thanks for the help, Andre
On 15 okt. 2011, at 20:27, Thor Erik Lie wrote:
Just make sure it's in Textmate's path (configured in the preferences), then it should work like a charm :)
Best regards Thor
lørdag 15. oktober 2011 skrev Andre de Boer følgende:
Hello,
How can I include the boost library in a c++ program with TextMate? So I can run programs like using TextMate.
#include <boost/lambda/lambda.hpp> #include <iostream> #include <iterator> #include <algorithm>
int main() { using namespace boost::lambda; typedef std::istream_iterator<int> in;
std::for_each( in(std::cin), in(), std::cout << (_1 * 3) << " " ); }
Thanks for the reaction, Andre
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
-- Best regards / Med vennlig hilsen Thor Erik Lie +47 976 20 928 http://thorerik.net
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On 16 Oct 2011, at 00:08, Andre de Boer wrote:
I added /opt/local/include in TextMate's path: /opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/2.6/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/texbin:/opt/local/include
Do *not* alter/set PATH (unless you know what you’er doing). This is unrelated to running C++ code but affects a lot of other stuff.
Boost is in /opt/local/include:
I assume you’re using the built-in “Run” command for C/C++ on ⌘R.
In this case you want to set the TM_CXX_FLAGS variable to something like: -I/opt/local/include
Additionally, since your program reads from stdin you should read http://blog.macromates.com/2009/interactive-input/
Thanks Allan, that did the trick.
But the interactive-input trick is not working for me: version 10.7.1, but this is not a problem. The example I gave is just one from the boost-website.
I did alter the PATH in TextMate and indeed I came into trouble but deleting the complete PATH in TextMate and running the program (cmd-r) gave me the opportunity to recover the PATH.
Regards, Andre
On 16 okt. 2011, at 09:11, Allan Odgaard wrote:
On 16 Oct 2011, at 00:08, Andre de Boer wrote:
I added /opt/local/include in TextMate's path: /opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/2.6/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/texbin:/opt/local/include
Do *not* alter/set PATH (unless you know what you’er doing). This is unrelated to running C++ code but affects a lot of other stuff.
Boost is in /opt/local/include:
I assume you’re using the built-in “Run” command for C/C++ on ⌘R.
In this case you want to set the TM_CXX_FLAGS variable to something like: -I/opt/local/include
Additionally, since your program reads from stdin you should read http://blog.macromates.com/2009/interactive-input/
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate