繁体   English   中英

为什么gcc不抱怨缺少符号?

[英]Why is gcc not complaining about missing symbol?

我在ac文件中定义了以下内容:

#ifdef __clang__
// clang definition here
#elif defined _GNULINUX
#define _ALIGNED_FREE(pMempointer)   _free((pMempointer))
#elif defined _MSC_VER
// VS definition here
#else
// default definition
#endif

void * pMemory = 0L;
if(pMemory) {
  _ALIGNED_FREE(pMemory);
}

gcc标志包括: -Wall -Wno-long-long -fexpensive-optimizations -fomit-frame-pointer -funroll-loops -pipe -fexceptions -Wpointer-arith -Wcast-align -Wsign-compare -pedantic -mmmx -msse

在gcc版本4.8.2(在Ubuntu 14.04计算机中)成功编译后,程序在运行时以undefined symbol: _free退出undefined symbol: _free显然_free符号是未知的,但是gcc为什么不抱怨呢? 我希望它像VS链接器一样在链接时抛出错误。

free在Linux和C Standard上都没有领先的下划线。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM