Staredit Network > Forums > Technology & Computers > Topic: Using Boost in Visual Studio 2010
Using Boost in Visual Studio 2010
Jan 31 2012, 7:14 pm
By: JaFF  

Jan 31 2012, 7:14 pm JaFF Post #1



I'm a noob programmer when it comes to serious business such as C++, but I have to use it for my university project. I must use Visual Studio 2010 because that's what my department has as the "departmental software". My personal drive is H which can be accessed from any university computer under my account. I need to use Boost for its random number generators, so I download it and unzip it into my H drive. Then I go and read this manual that explains how to connect your project and the boost library.
Quote
1. Unarchive the latest version of boost (1.47.0 as of writing) into a directory of your choice (e.g. C:\boost_1_47_0).
2. Create a new empty project in Visual Studio.
3. Open the Property Manager and expand one of the configuration for the platform of your choice.
4. Select & right click Microsoft.Cpp.<Platform>.user, and select Properties to open the Property Page for edit.
5. Select VC++ Directories on the left.
6. Edit the Include Directories section to include the path to your boost source files.
7. Repeat steps 3 - 6 for different platform of your choice if needed.
Although what I see is a little bit different to what the person describes, I got to the menu he is talking about in step 6 with "Include Directories". When clicking the "..." to browse directories I cannot see my H drive, I only see the default C and D drives. Naturally I just enter the directory manually and it doesn't seem to reject it. Now what? I type in "#include <boost>" but it does not compile and it is underlined with red in my code editor - it is seeing an obvious error.

So I guess my question is of two parts:
1. Why does it not recognise my H drive (as well as all the other remote university drives) and is it a problem?
2. Once I get it to recognise the Boost library (if I haven't done it correctly so far), what is the correct method of using the "random" part of Boost in my code?

Note: I cannot put the Boost folder into the C drive because of space restrictions.

Thanks. :)



None.

Jan 31 2012, 8:04 pm Lanthanide Post #2



If this is a university assignment, and you're tasked with using boost, why don't you ask the course supervisor/whoever how to fix the issue? Surely other people are going to have the same problem.



None.

Jan 31 2012, 8:48 pm CecilSunkure Post #3



You have to use Boost? Or you need random numbers? You can get your own random numbers: http://cecilsunkure.blogspot.com/search/label/PRNG

You can add Boost to your system path. You can also place it somewhere else other than the H drive so that the linker can find it properly.



None.

Jan 31 2012, 9:25 pm Lanthanide Post #4



rand() is actually very bad if you want to use it for any serious purpose.

http://www.azillionmonkeys.com/qed/random.html

Post has been edited 1 time(s), last time on Jan 31 2012, 9:32 pm by Lanthanide.



None.

Jan 31 2012, 9:32 pm Aristocrat Post #5



Quote from Lanthanide
rand() is actually very bad if you want to use it for any serious purpose

Why? Pseudorandom numbers are statistically indistinguishable from true randomness.



None.

Jan 31 2012, 9:35 pm Lanthanide Post #6



Quote from Aristocrat
Why? Pseudorandom numbers are statistically indistinguishable from true randomness.
If you have a good statistically sound PRNG then yes, of course. If your PRNG is not statistically sound, then no.

rand() is implementation dependant: it depends on your compiler/libraries. Most implementations these days are probably ok to use, but in the 80s and 90s that was not necessarily the case - you could take your program that used rand() and compile it with a bad compiler and end up with a program that doesn't operate properly because it is relying on the bad rand() function. Follow the link for more discussion on rand and its pitfalls.

In general, C only provides very basic library and general purpose functionality. In a lot of cases you'll have to roll your own (or acquire from a 3rd party) better functions to handle a lot of stuff.



None.

Jan 31 2012, 10:42 pm JaFF Post #7



Quote from Lanthanide
If this is a university assignment, and you're tasked with using boost, why don't you ask the course supervisor/whoever how to fix the issue? Surely other people are going to have the same problem.
This is a final year project, so it's up to me to pick what means I use to obtain results. This isn't a programming course and my supervisor isn't a programmer.
Quote from CecilSunkure
You have to use Boost? Or you need random numbers? You can get your own random numbers: http://cecilsunkure.blogspot.com/search/label/PRNG

You can add Boost to your system path. You can also place it somewhere else other than the H drive so that the linker can find it properly.
I need a wide range of distributions to be available for a very computation-heavy task. Getting the uniform and the exponential distributions is easy but others are quite messy and I suspect would be much faster if taken from a library written by people who are actually good at programming. :P

What do you mean by "adding Boost to my system path?" I can't place it anywhere else because of file size restrictions - I have huge space available on my H drive but virtually none on any other drive so the Boost folder doesn't fit into C drive.



None.

Jan 31 2012, 11:07 pm ShadowFlare Post #8



Try making a shortcut to the folder and checking the shortcut's properties to find the path to make sure it is what you think it is or if it is something else.



None.

Jan 31 2012, 11:51 pm Lanthanide Post #9



Quote from JaFF
This isn't a programming course and my supervisor isn't a programmer.
All the more reason that there should be someone at the university you can ask for help, either in the CS department or the IT department (they are not the same thing, generally).



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[09:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[2024-4-27. : 3:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[2024-4-27. : 1:53 am]
Ultraviolet -- :lol:
[2024-4-26. : 6:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[2024-4-26. : 6:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[2024-4-26. : 6:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[2024-4-26. : 6:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
[2024-4-26. : 6:48 pm]
Vrael -- On this Topic, I could definitely use some Introductions.
Please log in to shout.


Members Online: Roy, Oh_Man, RIVE, Excalibur