C++ boost alternitive.

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
User avatar
THe Floating Brain
Chaos Rift Junior
Chaos Rift Junior
Posts: 284
Joined: Tue Dec 28, 2010 7:22 pm
Current Project: RTS possible Third Person shooter engine.
Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
Programming Language of Choice: C/C++, Python 3, C#
Location: U.S

C++ boost alternitive.

Post by THe Floating Brain »

I would like to use the C++ boost library's "any" class. However when I downloaded the boost library's I immediately got run-time errors (on a program that ran fine before I downloaded the boost library's). I was wondering if there was something similar or alternative to using the "any" class.
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself

ImageImage
User avatar
bnpph
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 75
Joined: Thu Mar 10, 2011 12:30 pm

Re: C++ boost alternitive.

Post by bnpph »

Why do you need to use boost::any? You can probably achieve the same result using a different way.
XianForce
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 767
Joined: Wed Oct 29, 2008 8:36 pm

Re: C++ boost alternitive.

Post by XianForce »

bnpph wrote:Why do you need to use boost::any? You can probably achieve the same result using a different way.
It sounds to me like he's asking what that "different way" is.

And if you got runtime errors, then you probably didn't install boost correctly. I say reinstall it, so you learn how to correctly install libraries... It's a necessary skill, I'd say :o
User avatar
THe Floating Brain
Chaos Rift Junior
Chaos Rift Junior
Posts: 284
Joined: Tue Dec 28, 2010 7:22 pm
Current Project: RTS possible Third Person shooter engine.
Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
Programming Language of Choice: C/C++, Python 3, C#
Location: U.S

Re: C++ boost alternitive.

Post by THe Floating Brain »

XianForce wrote:
bnpph wrote:Why do you need to use boost::any? You can probably achieve the same result using a different way.
It sounds to me like he's asking what that "different way" is.

And if you got runtime errors, then you probably didn't install boost correctly. I say reinstall it, so you learn how to correctly install libraries... It's a necessary skill, I'd say :o
(Please correct me if I did this incorrectly)
1: Extracted files to my desktop.
2: Put the "boost" folder inside of C:\Program Files\Microsoft Visual Studio 9.0\VC\include .
3: Went into my project Options > *Project Name* Properties > Configurations and Settings (I think) > C\C++ > general > Add Include Directory ( C:\Program Files\Microsoft Visual Studio 9.0\VC\include\boost).
???
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself

ImageImage
User avatar
MrDeathNote
ES Beta Backer
ES Beta Backer
Posts: 594
Joined: Sun Oct 11, 2009 9:57 am
Current Project: cocos2d-x project
Favorite Gaming Platforms: SNES, Sega Megadrive, XBox 360
Programming Language of Choice: C/++
Location: Belfast, Ireland
Contact:

Re: C++ boost alternitive.

Post by MrDeathNote »

THe Floating Brain wrote:
XianForce wrote:
bnpph wrote:Why do you need to use boost::any? You can probably achieve the same result using a different way.
It sounds to me like he's asking what that "different way" is.

And if you got runtime errors, then you probably didn't install boost correctly. I say reinstall it, so you learn how to correctly install libraries... It's a necessary skill, I'd say :o
(Please correct me if I did this incorrectly)
1: Extracted files to my desktop.
2: Put the "boost" folder inside of C:\Program Files\Microsoft Visual Studio 9.0\VC\include .
3: Went into my project Options > *Project Name* Properties > Configurations and Settings (I think) > C\C++ > general > Add Include Directory ( C:\Program Files\Microsoft Visual Studio 9.0\VC\include\boost).
???
You need to add the lib folder to your library files (similar to Include Directories). Then you need to go into your linker options for the project and add the actual lib files to your additional dependencies.
http://www.youtube.com/user/MrDeathNote1988

Image
Image

"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
User avatar
THe Floating Brain
Chaos Rift Junior
Chaos Rift Junior
Posts: 284
Joined: Tue Dec 28, 2010 7:22 pm
Current Project: RTS possible Third Person shooter engine.
Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
Programming Language of Choice: C/C++, Python 3, C#
Location: U.S

Re: C++ boost alternitive.

Post by THe Floating Brain »

MrDeathNote wrote: You need to add the lib folder to your library files (similar to Include Directories). Then you need to go into your linker options for the project and add the actual lib files to your additional dependencies.
I went to the file but I did not see a single .lib or .dll in there 0.0
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself

ImageImage
User avatar
MrDeathNote
ES Beta Backer
ES Beta Backer
Posts: 594
Joined: Sun Oct 11, 2009 9:57 am
Current Project: cocos2d-x project
Favorite Gaming Platforms: SNES, Sega Megadrive, XBox 360
Programming Language of Choice: C/++
Location: Belfast, Ireland
Contact:

Re: C++ boost alternitive.

Post by MrDeathNote »

THe Floating Brain wrote:
MrDeathNote wrote: You need to add the lib folder to your library files (similar to Include Directories). Then you need to go into your linker options for the project and add the actual lib files to your additional dependencies.
I went to the file but I did not see a single .lib or .dll in there 0.0
Which boost libs are you using? A lot of them are header only, so you may not need a .lib or .dll. Also, what runtime errors are you getting? Out of curiosity, have you checked out this page?

http://www.boost.org/doc/libs/1_46_1/mo ... ndows.html
http://www.youtube.com/user/MrDeathNote1988

Image
Image

"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
User avatar
THe Floating Brain
Chaos Rift Junior
Chaos Rift Junior
Posts: 284
Joined: Tue Dec 28, 2010 7:22 pm
Current Project: RTS possible Third Person shooter engine.
Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
Programming Language of Choice: C/C++, Python 3, C#
Location: U.S

Re: C++ boost alternitive.

Post by THe Floating Brain »

MrDeathNote wrote:
THe Floating Brain wrote:
MrDeathNote wrote: You need to add the lib folder to your library files (similar to Include Directories). Then you need to go into your linker options for the project and add the actual lib files to your additional dependencies.
I went to the file but I did not see a single .lib or .dll in there 0.0
Which boost libs are you using? A lot of them are header only, so you may not need a .lib or .dll. Also, what runtime errors are you getting? Out of curiosity, have you checked out this page?

http://www.boost.org/doc/libs/1_46_1/mo ... ndows.html
-----------------------------------------------------------------EDIT-----------------------------------------------------------------
Thank you for the link. I was able to compile the lib's. But I still get the error. The error I get is when I try to use luabind.

I have a class (this happens even if the class does not have a template argument):

Code: Select all

template<class T>
class Printer
{
	T t;
public:
	Printer(){}
	void Print( T value )
	{
		t = value;
		std::cout<<t<<std::endl;
	}
};

Then this is my wrapper (which I have determined the is the source of the problem even when NOT using a template argument on my class):

Code: Select all

	luabind::module( Lua )
	[
		luabind::class_<Printer<std::string>>( "Printer" )
		.def( luabind::constructor<>() )
		.def( "Print", &Printer<std::string>::Print)
	];
The error I get is

Code: Select all

Unhandled exception at 0xbd0015ff in Test Boost.exe: 0xC0000005: Access violation.
Then it brings me to line 880 of function_template.hpp .
If I take out the boost library's the program runs perfectly.
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself

ImageImage
Post Reply