如何在mac中使用gcc连接碳

How to link to the carbon with gcc in mac?

本文关键字:gcc 连接 mac      更新时间:2023-10-16

我在mac中开发了一个使用碳的应用程序。

我的IDE是Code::Blocks (GCC编译器)我的代码编译成功,但没有链接。

#include <iostream>
#include <Carbon/Carbon.h>
using namespace std;
int main()
{
    //CGEventFlags flags = CGEventSourceFlagsState(1);
    while(true)
    {
        CGEventSourceStateID eventSource = kCGEventSourceStateCombinedSessionState;
        bool b = CGEventSourceKeyState(eventSource, kVK_Command) && CGEventSourceKeyState(eventSource, kVK_ANSI_Period);
        if(b)
        {
            cout << "Yes" << endl;
        }
        else
        {
            cout << "No" << endl;
        }
    }
    cout << "Hello world!" << endl;
    return 0;
}

如何在mac中与gcc链接到碳?

根据互联网上的各种来源,gcc的一个简单的-framework Carbon标志应该可以做到这一点。

无法验证。

这个问题看起来有点类似。