-
March 22nd, 2010, 12:56 PM
#1
Simple Program
I made this program to duplicate an error I'm receiving. When I run the program I receive:
Code:
Snake.obj : error LNK2019: unresolved external symbol
__imp___CrtDbgReportW referenced in function "public: __thiscall
std::_Vector_const_iterator<short,class std::allocator<short>
>::_Vector_const_iterator<short,class std::allocator<short> >(short *,class
std::_Container_base_secure const *)"
(??0?$_Vector_const_iterator@FV?$allocator@F@std@@@std@@QAE@PAFPBV_Container_base_secure@1@@Z)
I've looked up information about LNK2019 and LNK2001 in multiple forums, on MSVC, and other websites, but the information didn't really seem to apply.
Code:
#pragma comment(lib, "SDL.lib")
#pragma comment(lib, "SDLmain.lib")
#pragma comment(lib, "SDL_TTF.lib")
#pragma comment(lib, "SDL_image.lib")
#include <vector>
#include <string>
#include "SDL.h"
#include "SDL_TTF.h"
#include "SDL_image.h"
using namespace std;
class Test {
public:
Test();
private:
vector<vector<short>> myvar;
};
Test::Test()
: myvar ()
{
//Uncommenting these two lines,
//it will report LNK2001 instead of LNK2019
//vector<short> test (2, 10);
//this->myvar.push_back(test);
myvar.resize(1);
}
SDL_Event testevent;
int main( int argc, char* args[] ) {
bool genericloop = true;
while( genericloop ) {
SDL_PollEvent( &testevent );
if ( testevent.type == SDL_QUIT ) genericloop = false;
}
return 0;
}
Does anyone have any ideas? Thanks!
-Aaron
-
March 22nd, 2010, 01:04 PM
#2
Re: Simple Program
Code:
private:
vector<vector<short> > myvar;
Not sure if this is the problem, but you need to make sure this is > > ( space between > and > ) and not >>.
your humble savant
-
March 22nd, 2010, 01:10 PM
#3
Re: Simple Program
Originally Posted by TheRogue
Not sure if this is the problem, but you need to make sure this is > > ( space between > and > ) and not >>.
That would have resulted in a compile error though, but since it is a linker error it implies that KezRst is using a compiler that has incorporated that bit of the next version of C++ into the syntax that it accepts.
I think the key here is __imp___CrtDbgReportW. A quick search brings up unresolved external symbol __imp___CrtDbgReportW.
-
March 22nd, 2010, 01:11 PM
#4
Re: Simple Program
Originally Posted by TheRogue
Code:
private:
vector<vector<short> > myvar;
Not sure if this is the problem, but you need to make sure this is > > ( space between > and > ) and not >>.
Oops, that's just a typo. I have double checked to make sure that the spacing of the array is correct. I also boiled it down to a single dimensional array at one point, and still got the same error.
-
March 22nd, 2010, 01:23 PM
#5
Re: Simple Program
Originally Posted by laserlight
That would have resulted in a compile error though, but since it is a linker error it implies that KezRst is using a compiler that has incorporated that bit of the next version of C++ into the syntax that it accepts.
I think the key here is __imp___CrtDbgReportW. A quick search brings up unresolved external symbol __imp___CrtDbgReportW.
Thank you! I would not have thought to look up that particular part of the error message, since so much of it looked like Greek to me.
Scrolling down a few posts I found someone who had the exact same error as me, and how to fix it.
When I removed '_DEBUG' from my pre-processor definitions, it resolved my link error.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|