使错误:架构x86_64的未定义符号 [英] Make Error: Undefined symbols for architecture x86_64

查看:246
本文介绍了使错误:架构x86_64的未定义符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个漂亮的新手程序员(因为我只是在需要时编码),但我大多在电视上工作。我一直在试图编译一个工具,我下载了



这告诉我们一个类 PGGui 已经声明了一个函数 DoStuff code> PGGui 构造函数: PGGui :: PGGui(QObject *),但是找不到函数体。 >

正如你所看到的,这里,只看第一行的错误信息并没有什么帮助。您需要阅读其余的错误以查看缺少什么,这可能是一个函数的主体,或包含一个库或其他对象。



如果您开始尝试了解错误消息,而不是简单地在网络上搜索错误,并希望其他人的问题和解决方案与您自己的问题匹配,您会发现软件开发更容易。


I'm a pretty novice programmer (as in I only code when I need to), but I mostly work in television. I've been trying to compile a tool I downloaded (bmdtools) for compilation on OSX because we (for whatever reason) are not allowed to use Linux machines.

So, after installing all the libraries and linking what I need to, I ran "make" and got the error message:

ld: symbol(s) not found for architecture x86_64

I had then read that adding -stdlib=libc++ would fix whatever issue was being reflected. And this time it finishes, creating all three files that should be created. However, those three files are completely blank. Zero bytes.

Any help or insight would be greatly appreciated. Thanks!

解决方案

ld: symbol(s) not found for architecture x86_64

I've always thought this message to be confusing as people tend to focus on the "for architecture x86_64" part of the message. The actual problem here is that a symbol is not found. So, practically, what does this mean?

If we create a class and declare a function, but don't implement that function's body, the same error will be presented, as the compilation/linker process has been told that a function exists, but can't find it.

The line below the symbol(s) not found for achitecture x86_4 will usually identify what has not been found.

Let's look at an example: -

class PGGui
{
   public:
       PGGui::PGGui(QObject*)
       {
           DoSomeStuff();
       }

    private:
       DoSomeStuff();
};

This tells us that a class PGGui has declared a function DoStuff, which was referenced from the PGGui constructor: PGGui::PGGui(QObject*), but the function body can't be found.

As you can see, here, just looking at the first line of the error message doesn't help very much. You need to read the rest of the error to see what is missing, which may be the body of a function, or the inclusion of a library or some other object.

You'll find software development easier if you begin by trying to understand error messages, rather than simply searching the web for the error and hoping someone else's problem and solution matches your own.

这篇关于使错误:架构x86_64的未定义符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆