Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / C++ vector

Author
Message
Thejon
16
Years of Service
User Offline
Joined: 5th Jan 2008
Location:
Posted: 6th Jan 2008 05:41
I am new to Dark GDK and C++, but I have done a little programming before. Anyway, I am trying to be able to use dynamically size-able arrays like I am used to in other languages. I found out that C++ has that functionality using <vector>. I have successfully done tests with vectors in just a console cpp file, but I can't get it to work with Dark GDK. For example, I used the wizard to create a basic 3D game project. I can "include" the vector file: "#include <vector>" without any build errors. But, if I actually try to create a vector object: "std::vector <int> p;" I get all kinds of weird library errors that I don't know how to address. I copied the error info below.

Any ideas how I can include this? I really want to be able to use dynamic array functionality!

1>------ Build started: Project: DarkSandBox, Configuration: Debug Win32 ------
1>Compiling...
1>Main.cpp
1>Linking...
1>LINK : Debug\DarkSandBox.exe not found or not built by the last incremental link; performing full link
1>libcpmtd.lib(xdebug.obj) : warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>libcpmtd.lib(stdthrow.obj) : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (?_Debug_message@std@@YAXPB_W0I@Z)
1>libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __malloc_dbg referenced in function "void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)
1>libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __free_dbg referenced in function "void __cdecl operator delete(void *,struct std::_DebugHeapTag_t const &,char *,int)" (??3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z)
1>Debug\DarkSandBox.exe : fatal error LNK1120: 3 unresolved externals
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 6th Jan 2008 14:41
This should be stickied or something:

Project > Properties > Configuration Properties > C/C++ > Code Generation > Runtime Library and set to /MT

Your signature has been erased by a mod
Thejon
16
Years of Service
User Offline
Joined: 5th Jan 2008
Location:
Posted: 6th Jan 2008 15:52
Thanks that fixed it!
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 6th Jan 2008 17:24
Try to search out forums before creating a new thread! You can find tens of threads solving your problem, a recent one is pretty thorough: http://forum.thegamecreators.com/?m=forum_view&t=121186&b=22
Thejon
16
Years of Service
User Offline
Joined: 5th Jan 2008
Location:
Posted: 7th Jan 2008 15:22
tempicek,

Sorry, I did actually look through the forums, but I was not familiar enough with these new tools to realize that my question was being answered. I did some searches for vectors, and everything I was pulling up was for math vectors, not the c vector.

Anyway, the link you gave me looks really helpful. Thanks!

Login to post a reply

Server time is: 2024-09-29 09:20:17
Your offset time is: 2024-09-29 09:20:17