我正在尝试在带有 xcode 3.2.6 的 mac OS X 10.6.8 上编译包含 -std=c++0x 的程序。我用自制软件将我的 g++ 编译器升级到 g++-4.7。在我的makefile中,我更改了以下行:
CXX = g++
CXXFLAGS = -std=c++0x
LD = g++
LDFLAGS = -L.
至:
CXX = g++-4.7
CXXFLAGS = -std=c++0x
LD = g++-4.7
LDFLAGS = -L.
但是,这条线不起作用:
$(CC) -c -Icore/include/ -Ianalysis/include -Ieventbuilders/include -Isimdut/include -Istyle/include $(CXXFLAGS) $< -o $@
所以我将其更改为:
$(CXX) -c -Icore/include/ -Ianalysis/include -Ieventbuilders/include -Isimdut/include -Istyle/include $(CXXFLAGS) $< -o $@
现在一切都编译了,但是当我运行我的文件时,出现以下错误:
tbmon(25203) malloc: *** error for object 0x1029249b0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap
有人可以告诉我我做错了什么吗?先感谢您!