• Advertisement
Sign in to follow this  

quickCG linker issues

This topic is 3005 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey I used to have no problem using quickCG on an older 32 bit machine, but now Im trying to put up the libraries on my new 64bit and its throwing linker errors... SDL is working fine, I just wanted to play with quickCG again.. heres the error:

1>------ Build started: Project: SDL, Configuration: Debug Win32 ------
1>Linking...
1>quickcg.obj : error LNK2019: unresolved external symbol __imp___CrtDbgReportW referenced in function "public: bool __thiscall std::_Tree<class std::_Tmap_traits<int,bool,struct std::less<int>,class std::allocator<struct std::pair<int const ,bool> >,0> >::const_iterator::operator==(class std::_Tree<class std::_Tmap_traits<int,bool,struct std::less<int>,class std::allocator<struct std::pair<int const ,bool> >,0> >::const_iterator const &)const " (??8const_iterator@?$_Tree@V?$_Tmap_traits@H_NU?$less@H@std@@V?$allocator@U?$pair@$$CBH_N@std@@@2@$0A@@std@@@std@@QBE_NABV012@@Z)
1>C:\Users\Logan\Documents\Visual Studio 2008\Projects\SDL\Debug\SDL.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\Users\Logan\Documents\Visual Studio 2008\Projects\SDL\SDL\Debug\BuildLog.htm"
1>SDL - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


I am assuming there is a problem with the either quickcg.h, quickcg.cpp, or my main main:
#include "quickcg.h" 

using namespace QuickCG;

int main(int argc, char *argv[])
{
    screen(256, 256, 0, "Small Test Script");
    for(int x = 0; x < w; x++)
    for(int y = 0; y < h; y++)
    {
        pset(x, y, ColorRGB(x, y, 128));
    }
    redraw();
    sleep();

	return 0;
}

quickcg.h:

#ifndef _quickcg_h_included
#define _quickcg_h_included

#include <SDL.h>

#include <string>
#include <sstream>
#include <iomanip>
#include <vector>
#include <algorithm> //std::min and std::max

namespace QuickCG
{

////////////////////////////////////////////////////////////////////////////////
//useful templates//////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

//don't know why, but the standard C++ abs sometimes gives cryptic errors? if so use this :D
template<typename T>
const T template_abs(const T &a)
{
  return (a < 0) ? -a : a;
}

//usage: std::string str = valtostr(25454.91654654f);
template<typename T>
std::string valtostr(const T& val)
{
  std::ostringstream sstream;
  sstream << val;
  return sstream.str();
}

//usage: double val = strtoval<double>("465498.654");
template<typename T>
T strtoval(const std::string& s)
{
  std::istringstream sstream(s);
  T val;
  sstream >> val;
  return val;
}

//......

quickcg.cpp:

#include "quickcg.h"

#include <SDL.h>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <map>
#include <iostream>
#include <fstream>

namespace QuickCG
{

////////////////////////////////////////////////////////////////////////////////
//VARIABLES/////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

int w; //width of the screen
int h; //height of the screen

std::map<int, bool> keypressed; //for the "keyPressed" function to detect a keypress only once
SDL_Surface* scr; //the single SDL surface used
Uint8* inkeys;
SDL_Event event = {0};
//......

Thank you for your help!

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement