Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Installing Boost, mainly for threads

This thread is locked; no one can reply to it. rss feed Print
 1   2 
Installing Boost, mainly for threads
Speedo
Member #9,783
May 2008

Oh good Lord, I need to install the Boost:thread library, but I need to compile it with their compiler Boost Build, but that's a source distro <etc, etc>

Oh good Lord, you didn't even bother reading the build instructions linked in the very first reply. If you had you'd probably have noticed a glowing linky with the text "download a pre-built bjam executable".

23yrold3yrold
Member #1,134
March 2001
avatar

Yeah, that link takes me to a bunch of source distros. That's pretty much in line with my experience thus far.

I found a bjam lib but every time I try to do anything with it, including pass it the help flag, it gives me "Unable to load Boost.Build: could not find "boost-build.jam"". boost-build.jam isn't with the binary, and it's nowhere in the Boost lib. I'm putting this one to bed for now I think ...

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

SiegeLord
Member #7,827
October 2006
avatar

Have you tried this? That seems to contain an .exe file.

But really... would it be hard of them to provide MinGW binaries? They are being very lazy, in my opinion.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

GullRaDriel
Member #3,861
September 2003
avatar

Axilmar said:

Boost threads go a step beyond pthreads in many situations, thanks to object orientation and other nifty c++ tricks.

Examples please ?

That OOP thingy always make me laught, specially now.

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

Speedo
Member #9,783
May 2008

Yeah, that link takes me to a bunch of source distros. That's pretty much in line with my experience thus far.

I found a bjam lib but every time I try to do anything with it, including pass it the help flag, it gives me "Unable to load Boost.Build: could not find "boost-build.jam"". boost-build.jam isn't with the binary, and it's nowhere in the Boost lib. I'm putting this one to bed for now I think ...

Are you really even trying at this point? The link takes you to 4 prebult binaries (BSD, Linux, OSX, WinNT) and 2 source packages. boost-build.jam is in the root of the boost source, exactly where it tells you to invoke bjam from.

axilmar
Member #1,204
April 2001

Examples please ?

That OOP thingy always make me laught, specially now.

example 1:

class Foo {
public:
    void bar() {
    }
};

int main() {
    thread t(bind(&Foo::bar, new Foo));
}

example 2:

mutex mtx;

int main() {
    lock_guard<mutex> lock(mtx);
}

example 3:

class Foo {
public:
mutex mtx;
};

int main() {
    shared_ptr<Foo> foo(new Foo);
}

anonymous
Member #8025
November 2006

That OOP thingy always make me laught, specially now.

It is quite possible that you are mixing up OOP (in the sense of polymorphism, great design patterns etc) with simply having RAII objects that automate cleanups and such tasks simply by having their destructor automatically called. RAII is immensely useful even in perfectly procedural code.

axilmar
Member #1,204
April 2001

anonymous said:

It is quite possible that you are mixing up OOP (in the sense of polymorphism, great design patterns etc) with simply having RAII objects that automate cleanups and such tasks simply by having their destructor automatically called. RAII is immensely useful even in perfectly procedural code.

No, not at all. Bind produces run-time polymorphic objects and scoped locks use compile-time polymorphic objects, plus RAII is a great design pattern helped by objects.

anonymous
Member #8025
November 2006

Ok, but does that affect your programming style (except for making things more convenient :))? If I write procedural code that uses char* for strings and I write the same code except using std::string (and worrying less about certain things), does that turn the design of my program into OOP?

BAF
Member #2,981
December 2002
avatar

I'm not sure about 2009, but AFAIK it still works the same. Your C# progra...

2009? There is no such thing as VS 2009. Assuming you mean 2008, then yes, it works the same.

axilmar
Member #1,204
April 2001

anonymous said:

Ok, but does that affect your programming style (except for making things more convenient :))? If I write procedural code that uses char* for strings and I write the same code except using std::string (and worrying less about certain things), does that turn the design of my program into OOP?

It depends on the code.

Tobias Dammers
Member #2,604
August 2002
avatar

Quote:

2009?

Typo.
Getting used to yet another year usually takes me about 6 months, I'm probably over-compensating by now.

anonymous said:

If I write procedural code that uses char* for strings and I write the same code except using std::string (and worrying less about certain things), does that turn the design of my program into OOP?

No.

For your design to be OOP, it needs to follow the principles of OO design. For starters, read this.

---
Me make music: Triofobie
---
"We need Tobias and his awesome trombone, too." - Johan Halmén

anonymous
Member #8025
November 2006

Good. My point was that claims like "sometimes OOP is good, sometimes procedural is better" can't mean that "when procedural is better, you shouldn't use any objects like std::string or boost threads".

 1   2 


Go to: