开发者

undefined reference to `std::__default_alloc_template<true, 0>::deallocate(void*, unsigned int)'

开发者 https://www.devze.com 2023-03-25 15:48 出处:网络
During linking code on ubuntu I get following error undefined reference to \'std::__default_alloc_template<true, 0>::deallocate(void*, unsigned int)\'

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号