首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用Chapel的“编译线”编译C++

用Chapel的“编译线”编译C++
EN

Stack Overflow用户
提问于 2017-11-30 02:25:32
回答 0查看 189关注 0票数 2

我想在我的chapel库中包含一些C++代码,第一步是让Chapel编译器根据this page编译cpp。然而,我得到了一个奇怪的错误。我的.cpp

代码语言:javascript
复制
/* Hello World program
 * `/Users/buddha/github/chapel/util/config/compileline --compile` hello.cpp
 * */

//#include<stdio.h>   // just fine
#include<iostream>  // gastro-intestinal distress...

int main()
{
    printf("Hello World\n");
}

但是当我运行compileline时,我得到一个错误

代码语言:javascript
复制
 `/Users/buddha/github/chapel/util/config/compileline --compile` hello.cpp 
In file included from hello.cpp:6:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/iostream:38:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/ios:216:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/__locale:18:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/mutex:189:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/__mutex_base:17:
/Library/Developer/CommandLineTools/usr/include/c++/v1/__threading_support:156:1: error: unknown type name 'mach_port_t'
mach_port_t __libcpp_thread_get_port();
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/__threading_support:300:1: error: unknown type name 'mach_port_t'
mach_port_t __libcpp_thread_get_port() {
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/__threading_support:301:12: error: use of undeclared identifier 'pthread_mach_thread_np'
    return pthread_mach_thread_np(pthread_self());
           ^
3 errors generated.

我感觉我在遵循文档,但我看不到我遗漏了什么。

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47559380

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档