During linking code on ubuntu I get following error
undefined reference to 'std::__default_alloc_template<true, 0>::deallocate(void*, unsigned int)'
I tried several g++ compilers but nothing changes. The reason I found in previous answers is wrong configuration if includes. Here are includes in the code:
#pragma warning(disable:4786)
#include <stdio.h>
#include <map>
#include <string>
#include <vector>
#include <png.h>
#include <math.h>
#include <ft2build.h>
#include <gd.h>
#include FT_FREETYPE_H
using namespace std;
#ifndef WIN32
#define stricmp strcasecmp
#else
#include <io.h>
#include <fcntl.h>开发者_如何学Python;
#endif
Please help to fix those includes?
Your are probably compiling and linking with gcc
instead of g++
. For compilation, there's not much difference. GCC uses the file extension to guess the real language, but when linking, g++
also pulls in the C++ Standard library, which is where allocators are usually defined.
精彩评论