简体   繁体   English

找不到Dyld符号错误

[英]Dyld Symbol not Found Error

Here's my error. 这是我的错误。

dyld: Symbol not found: __ZTIN8eqOsirix3ROIE
  Referenced from: /Users/slate/Documents/osirixplugins/CoreDataTrial_EQOsirix/build/Development/rcOsirix.app/Contents/MacOS/rcOsirix
  Expected in: flat namespace
 in /Users/slate/Documents/osirixplugins/CoreDataTrial_EQOsirix/build/Development/rcOsirix.app/Contents/MacOS/rcOsirix
Data Formatters temporarily unavailable, will re-try after a 'continue'. (Not safe to call dlopen at this time.)
(gdb) bt
#0  0x8fe01065 in __dyld_dyld_fatal_error ()
#1  0x8fe04fa5 in __dyld__ZN4dyld4haltEPKc ()
#2  0x8fe0796b in __dyld__ZN4dyld5_mainEPK12macho_headermiPPKcS5_S5_ ()
#3  0x8fe018b1 in __dyld__ZN13dyldbootstrap5startEPK12macho_headeriPPKcl ()
#4  0x8fe01057 in __dyld__dyld_start ()
(gdb) continue
Program received signal:  “EXC_BAD_ACCESS”.
Data Formatters temporarily unavailable, will re-try after a 'continue'. (Not safe to call dlopen at this time.)
(gdb) bt
#0  0x8fe010e3 in __dyld__ZN13dyldbootstrapL30randomizeExecutableLoadAddressEPK12macho_headerPPKcPm ()
#1  0x8fe04fa5 in __dyld__ZN4dyld4haltEPKc ()
#2  0x8fe0796b in __dyld__ZN4dyld5_mainEPK12macho_headermiPPKcS5_S5_ ()
#3  0x8fe018b1 in __dyld__ZN13dyldbootstrap5startEPK12macho_headeriPPKcl ()
#4  0x8fe01057 in __dyld__dyld_start ()
(gdb) 

where eqOsirix is my main namespace. 其中eqOsirix是我的主要名称空间。 I had two similar problems a while ago ( one and two ) but neither solution is helping me now. 不久前我遇到了两个类似的问题( 一个两个 ),但是现在都没有解决方案对我有帮助。

I noticed the problem after I updated my mac, but I think it's unrelated. 更新Mac之后,我注意到了这个问题,但我认为这无关紧要。

No compile errors are generated (or warnings). 不会产生编译错误(或警告)。

What could cause this? 是什么原因造成的? Why isn't the compiler catching anything during linking? 为什么编译器在链接期间没有捕获任何内容? I've done clean builds, reset both XCode and the Mac.... I'm just at wit's end and Google just gives me stuff for 3rd party Frameworks not being included but this is my main namespace !! 我已经完成了干净的构建,同时重置了XCode和Mac。...我只是机智的结束,而Google只是为我提供了不包含第3方框架的内容,但这是我的主要namespace Augh! Augh!


[EDIT] Since @Troubador pointed out that ROI wasn't part of the scramble, I'm including ROI below: [编辑]由于@Troubador指出ROI并不是争夺战的一部分,因此我将ROI包括在下面:

#ifndef EQOSIRIX_ROI_H
#define EQOSIRIX_ROI_H

namespace eqOsirix{

    class ROI : public eq::Object
    {

    public:
        ROI() {};
        virtual ~ROI() {};

        virtual uint32_t getType() {return NONE;};

        virtual void draw() {};

    protected:

        enum ROIType {
            NONE = 0,
            LINE,
            POLY,
            AREA,
            VOLUME
        };

    private:

    };

}


#endif//EQOSIRIX_ROI_H

not much to screw up, and I think I have all the virtuals defined ok for C++ (as opposed to Java or ObjC) ??? 没有太多的事情要解决,我我已经为C ++(而不是Java或ObjC)定义了所有虚拟函数?

Based on our discussion on your question I'm sure it has something to do with the fact that all your methods are defined within the class definition. 根据我们对您的问题的讨论,我确定这与您的所有方法都在类定义中定义有关。 This means that gcc has no "key" function alongside which it can emit the symbol for the typeinfo object ie there is no single object file that the typeinfo object can be placed in. What gcc therefore does is to emit the typeinfo symbol into each object file that requires it and inform the linker to ignore duplicates when it creates the dylib. 这意味着gcc没有“键”功能,它可以为typeinfo对象发出符号,即没有可以放置typeinfo对象的单个对象文件。gcc因此要做的是向每个对象发出typeinfo符号。需要它的文件,并在创建dylib时通知链接程序忽略重复项。

The reason I asked about the visibility attributes is that if even one of the duplicated symbols is marked as "hidden" then the linker will hide the typeinfo symbol within the dylib and any other part of your application will fail to look it up at run-time. 我询问可见性属性的原因是,即使将重复的符号之一标记为“隐藏”,链接器也将在dylib中隐藏typeinfo符号,而应用程序的任何其他部分在运行时都无法对其进行查找-时间。 You will not get a compile time error which seems to fit the behaviour you are reporting. 您不会收到似乎与您报告的行为相符的编译时错误。

If you are not sure if you are using visibility attributes then you probably are not since the default visiblity is "default" which basically means not hidden. 如果您不确定是否使用可见性属性,则可能不是,因为默认可见性是“默认”,这基本上意味着没有隐藏。 Look for options to gcc that start -fvisibility in your build files. 在构建文件中寻找启动-fvisibility gcc选项。 Visiblity can also be marked up in code using things like __attribute__ ((visibility ("hidden"))) . 也可以使用诸如__attribute__ ((visibility ("hidden")))类的代码在代码中标记__attribute__ ((visibility ("hidden")))

The reason I suggested moving at least one member definition inside a cpp file was to force a single emission of the typeinfo object and test whether this made a difference. 我建议在cpp文件中移动至少一个成员定义的原因是强制一次发出typeinfo对象并测试这是否有所不同。 You didn't say whether you tried this or not so it would be good to know. 您没有说自己是否尝试过,所以很高兴知道。

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

相关问题 在Mac上编译C ++代码时处理“ dyld:惰性符号绑定失败:找不到符号”错误 - Handling “dyld: lazy symbol binding failed: Symbol not found” error when compiling C++ code on Mac 编译错误链接dyld符号 - compilation error link dyld Symbol dyld:找不到符号:_PyBaseObject_Type - dyld: Symbol not found: _PyBaseObject_Type 编译 GCC-5.0 OS X Lion dyld:找不到符号:__ZNKSt11logic_error4whatEv - Compiling GCC-5.0 OS X Lion dyld: Symbol not found: __ZNKSt11logic_error4whatEv dyld:惰性符号绑定失败:找不到符号:_yylex - dyld: lazy symbol binding failed: Symbol not found: _yylex 未找到dyld符号,但nm报告否则(OS X更新问题) - dyld symbol not found, but nm reports otherwise (OS X Update issue) 关于boost-python:dyld:未找到符号:_PyBaseObject_Type - About boost-python: dyld: Symbol not found: _PyBaseObject_Type OSX 10.7.5上的node-gyp - dyld:惰性符号绑定失败:找不到符号 - node-gyp on OSX 10.7.5 — dyld: lazy symbol binding failed: Symbol not found dyld:懒惰的符号绑定失败:找不到符号。 预期在:平面命名空间 - dyld: lazy symbol binding failed: Symbol not found. Expected in: flat namespace dyld:未找到符号:在MAC OS 10.10上运行简单代码时,__ ZN2cv6imreadERKNSt3 - dyld: Symbol not found: __ZN2cv6imreadERKNSt3 when run a simple code on MAC OS 10.10
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM