C++ boost alternitive.
Moderator: Coders of Rage
- THe Floating Brain
- 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.
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
Re: C++ boost alternitive.
Why do you need to use boost::any? You can probably achieve the same result using a different way.
Re: C++ boost alternitive.
It sounds to me like he's asking what that "different way" is.bnpph wrote:Why do you need to use boost::any? You can probably achieve the same result using a different way.
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
- THe Floating Brain
- 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.
(Please correct me if I did this incorrectly)XianForce wrote:It sounds to me like he's asking what that "different way" is.bnpph wrote:Why do you need to use boost::any? You can probably achieve the same result using a different way.
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
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
- MrDeathNote
- 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.
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.THe Floating Brain wrote:(Please correct me if I did this incorrectly)XianForce wrote:It sounds to me like he's asking what that "different way" is.bnpph wrote:Why do you need to use boost::any? You can probably achieve the same result using a different way.
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
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).
???
http://www.youtube.com/user/MrDeathNote1988
"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
"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
- THe Floating Brain
- 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.
I went to the file but I did not see a single .lib or .dll in there 0.0MrDeathNote 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.
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself
- MrDeathNote
- 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.
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?THe Floating Brain wrote:I went to the file but I did not see a single .lib or .dll in there 0.0MrDeathNote 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.
http://www.boost.org/doc/libs/1_46_1/mo ... ndows.html
http://www.youtube.com/user/MrDeathNote1988
"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
"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
- THe Floating Brain
- 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.
-----------------------------------------------------------------EDIT-----------------------------------------------------------------MrDeathNote wrote: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?THe Floating Brain wrote:I went to the file but I did not see a single .lib or .dll in there 0.0MrDeathNote 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.
http://www.boost.org/doc/libs/1_46_1/mo ... ndows.html
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)
];
Code: Select all
Unhandled exception at 0xbd0015ff in Test Boost.exe: 0xC0000005: Access violation.
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