题
我只在我的应用程序的部署构建让这些非虚thunk的错误。它使用一个名为LGI的私人框架。建立在使用了XCode 3.1.4(最新的豹?)错误看起来是这样10.5.8:
Ld /Users/matthew/Code/Scribe-Branches/v2.00/build/Development/Scribe.app/Contents/MacOS/Scribe normal i386
cd /Users/matthew/Code/Scribe-Branches/v2.00
/Developer/usr/bin/g++-4.0 -arch i386 -L/Users/matthew/Code/Scribe-Branches/v2.00/build/Development -F/Users/matthew/Code/Scribe-Branches/v2.00/build/Development -F/Users/matthew/Code/Lgi/build -F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Development -F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Development -F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Deployment -F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Development -F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Deployment -filelist /Users/matthew/Code/Scribe-Branches/v2.00/build/Scribe.build/Development/Scribe.build/Objects-normal/i386/Scribe.LinkFileList -framework Carbon -framework Lgi -o /Users/matthew/Code/Scribe-Branches/v2.00/build/Development/Scribe.app/Contents/MacOS/Scribe
Undefined symbols:
"non-virtual thunk to GWindow::OnDrop(char*, GVariant*, GdcPt2, int)", referenced from:
vtable for ScribeWndin ScribeApp.o
vtable for GShutdownin ScribeApp.o
vtable for CalendarUiin Calendar.o
vtable for CalendarViewWndin CalendarView.o
vtable for CalendarConfigin CalendarView.o
vtable for ScribeExportin Exp_Scribe.o
vtable for GNewMailDlgin GNewMailDlg.o
....etc for lots of classes....
反正我知道我不会离开那些不确定的,因为它在开发版本实际上链接并运行正常呢。现在,谷歌搜索的问题后尝试的第一件事就是改变了优化设置,我做到了......和没有骰子。一些链接错误。
因此,这些虚拟功能在最初GDragDropTarget定义,并且GWindow的继承看起来像这样:
class LgiClass GWindow : public GView
#ifndef WIN32
, public GDragDropTarget
#endif
(在Win32 LgiClass是用于__declspec出口/进口)
这是什么尝试下一个任何想法?
顺便说一句,这是该框架的一些示例国旗:
CompileC build/Lgi.build/Deployment/Lgi.build/Objects-normal/i386/GViewCommon.o
/Users/matthew/Code/Lgi/src/common/Lgi/GViewCommon.cpp normal i386 c++
com.apple.compilers.gcc.4_0
cd /Users/matthew/Code/Lgi
/Developer/usr/bin/gcc-4.0 -x c++ -arch i386 -fmessage-length=0 -pipe -Wno-trigraphs
-fpascal-strings -fasm-blocks -Os -Wreturn-type -Wunused-variable
-isysroot /Developer/SDKs/MacOSX10.4u.sdk -fvisibility-inlines-hidden
-mmacosx-version-min=10.4
-I/Users/matthew/Code/Lgi/build/Lgi.build/Deployment/Lgi.build/Lgi.hmap
-F/Users/matthew/Code/Lgi/build/Deployment
-F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks -Iinclude/common
-Iinclude/mac -Iinclude/posix -I/Users/matthew/Code/Lgi/build/Deployment/include
-I/Users/matthew/Code/Lgi/build/Lgi.build/Deployment/Lgi.build/DerivedSources/i386
-I/Users/matthew/Code/Lgi/build/Lgi.build/Deployment/Lgi.build/DerivedSources
-DMAC
-include /var/folders/b4/b4LnxwCQGLCmwy36TH3QuU+++TQ/-Caches-/com.apple.Xcode.503/SharedPrecompiledHeaders/Lgi_Prefix-aukthgaeovjxcucuoascfyqekpzz/Lgi_Prefix.pch -c /Users/matthew/Code/Lgi/src/common/Lgi/GViewCommon.cpp
-o /Users/matthew/Code/Lgi/build/Lgi.build/Deployment/Lgi.build/Objects-normal/i386/GViewCommon.o
Ld /Users/matthew/Code/Lgi/build/Lgi.build/Deployment/Lgi.build/Objects-normal/i386/Lgi normal i386
cd /Users/matthew/Code/Lgi
setenv MACOSX_DEPLOYMENT_TARGET 10.4
/Developer/usr/bin/g++-4.0 -arch i386 -dynamiclib -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-L/Users/matthew/Code/Lgi/build/Deployment
-F/Users/matthew/Code/Lgi/build/Deployment
-F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks
-filelist /Users/matthew/Code/Lgi/build/Lgi.build/Deployment/Lgi.build/Objects-normal/i386/Lgi.LinkFileList
-install_name @executable_path/../Frameworks/Lgi.framework/Versions/A/Lgi
-mmacosx-version-min=10.4 -framework Carbon
-framework SystemConfiguration -Wl,-single_module -compatibility_version 1
-current_version 1 -o /Users/matthew/Code/Lgi/build/Lgi.build/Deployment/Lgi.build/Objects-normal/i386/Lgi
和此是应用程序的编译/链接标志:
CompileC build/Scribe.build/Deployment/Scribe.build/Objects-normal/ppc/IHttp.o
/Users/matthew/Code/Lgi/src/common/INet/IHttp.cpp normal ppc c++ com.apple.compilers.gcc.4_0
cd /Users/matthew/Code/Scribe-Branches/v2.00
/Developer/usr/bin/gcc-4.0 -x c++ -arch ppc -fmessage-length=0 -pipe -Wno-trigraphs
-fpascal-strings -Os -mdynamic-no-pic -DMAC -DSCRIBE_APP -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-mtune=G4 -fvisibility=hidden -fvisibility-inlines-hidden -mmacosx-version-min=10.4
-I/Users/matthew/Code/Scribe-Branches/v2.00/build/Scribe.build/Deployment/Scribe.build/Scribe.hmap
-F/Users/matthew/Code/Scribe-Branches/v2.00/build/Deployment -F/Users/matthew/Code/Lgi/build
-F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Development
-F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Development
-F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Deployment
-F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Development
-F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Deployment
-F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Development
-F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Deployment
-I/Users/matthew/libpng-1.2.37 -I/Users/matthew/jpeg-6b -I../../Lgi/include/common
-I../../Lgi/include/mac -I../../aspell-0.60.6/interfaces/cc
-I/Users/matthew/Code/Scribe-Branches/v2.00/build/Deployment/include
-IResources -I../Lgi/include/common -I../Lgi/include/mac
-I/Users/matthew/Code/Scribe-Branches/v2.00/build/Scribe.build/Deployment/Scribe.build/DerivedSources/ppc
-I/Users/matthew/Code/Scribe-Branches/v2.00/build/Scribe.build/Deployment/Scribe.build/DerivedSources
-DMAC
-include /var/folders/b4/b4LnxwCQGLCmwy36TH3QuU+++TQ/-Caches-/com.apple.Xcode.503/SharedPrecompiledHeaders/Scribe_Prefix-ebutivbeomfbzzguhklrzxnwuwzc/Scribe_Prefix.pch
-c /Users/matthew/Code/Lgi/src/common/INet/IHttp.cpp
-o /Users/matthew/Code/Scribe-Branches/v2.00/build/Scribe.build/Deployment/Scribe.build/Objects-normal/ppc/IHttp.o
Ld /Users/matthew/Code/Scribe-Branches/v2.00/build/Scribe.build/Deployment/Scribe.build/Objects-normal/i386/Scribe
normal i386
cd /Users/matthew/Code/Scribe-Branches/v2.00
setenv MACOSX_DEPLOYMENT_TARGET 10.4
/Developer/usr/bin/g++-4.0 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-L/Users/matthew/Code/Scribe-Branches/v2.00/build/Deployment
-F/Users/matthew/Code/Scribe-Branches/v2.00/build/Deployment
-F/Users/matthew/Code/Lgi/build
-F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Development
-F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Development
-F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Deployment
-F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Development
-F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Deployment
-F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Development
-F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Deployment
-filelist /Users/matthew/Code/Scribe-Branches/v2.00/build/Scribe.build/Deployment/Scribe.build/Objects-normal/i386/Scribe.LinkFileList
-mmacosx-version-min=10.4 -framework Carbon -framework Lgi
-o /Users/matthew/Code/Scribe-Branches/v2.00/build/Scribe.build/Deployment/Scribe.build/Objects-normal/i386/Scribe
Undefined symbols:
"non-virtual thunk to GWindow::OnDrop(char*, GVariant*, GdcPt2, int)", referenced from:
vtable for ScribeWndin ScribeApp.o
vtable for GShutdownin ScribeApp.o
我没有,所以我贴出来所有的相关的肯定什么。
解决方案 3
我做了一个小例子框架和应用程序,遵守所有相同的模式/类heirarchies,我在我的主要应用程序中使用,与努力,使这个问题的一个简单的例子的图。但是,编译和链接。我不能肯定这是否是因为我从它,或者是因为通过重新创建项目文件中的XCode的当前版本已经解决了这一问题削减太多的代码。
因此,尝试和分离物,它的这些情况是真实的我重新创建我的整个框架项目从头(快进几个小时),以及建立在“释放”(未配置)模式,并与我没有任何错误的应用链接!咦? Ooooooooooooook。
这意味着,原来的项目文件在某种程度上是不容易的选项可见破碎。我diff'd对新创建的项目中的所有选项,它是相当1:1。没有什么明显的不同。所以,这件事情在选项文件不可见。有一个问题我以前也有没有注意到,在项目的选择是在目标的选择实际上是不同的。现在我知道在这两个地方,我能看到一些“用户自定义”选项得到的方式来看待。
在旧的项目文件已经通过几个操作系统升级和众多的XCode升级...我想这是可能的一些升级有相互冲突和搞砸了该项目。所以,感谢阅读和您的意见。
更新:好让 “释放” 模式下编译后,你猜怎么着?是啊调试不会编译。 ARRRRGGGGGGGHHHHH!所以,我已经复制所有框架的设置,以便调试版本是完全一样的发布版本两个目标和项目。不链接。工作仍在继续......
原来,发布和调试之间上次不同的构建应用程序的,就是我定义“_DEBUG”为调试版本。这对各种事物开关一样断言和一些额外的调试API的。现在,我必须制定出其中那些导致该链接错误。
其他提示
找到马特这次调职,大概是有人在苹果: HTTP ://lists.apple.com/archives/unix-porting/2003/Dec/msg00107.html
在它,马特表示:
[A非虚拟thunk是]的内部 用于C实现细节++ 类层次涉及 多重继承。你是不是做 哪里不对了;这是一个编译器 错误。我们知道,我们需要解决它。 与此同时,最好的解决方法 我们知道的是使用相同的 优化级别针对链接 一个库,你用来编译 库。
(你也可以考虑不出口 从库C ++接口。我们 工作很辛苦,确保了C 和目标C ABI保持不变 从一个编译器版本到下一个, 但我们为C ++没有这样的保证。)
--Matt
因此,也许你正在尝试使用是由不同版本化的C ++编译器编译一个C ++库?在C ++ ABI没有被定义为便携式它似乎。
里德
为什么不更改生产版本的编译器标志,以您用于开发的那些,然后逐渐改回的样子制作你现在用一个标志的时间,直到你赶上了一个引起该问题?
然后,可以看这个标志起来gcc手册,挖得更深。