Ami*_*yan 1 c++ macos macos-carbon
我在 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;
}
Run Code Online (Sandbox Code Playgroud)
如何在mac中使用gcc链接到carbon?