Компиляция C ++ с «компиляцией» Chapel’s

Я хочу включить немного кода C ++ в мои библиотеки chapel, первый шаг — заставить компилятор Chapel компилировать cpp в соответствии с эта страница. Однако я получаю странную ошибку. мой .cpp является

/* 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 Я получаю ошибку

 `/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.

Я чувствую, что слежу за документацией, но не вижу, чего мне не хватает.

2

Решение

Часовня 1.17 (еще не выпущена, но вы можете попробовать предварительную ветку master) добавляет util/config/compileline --compile-c++ который работает аналогично, но запрашивает компилятор C ++ вместо C.

2

Другие решения

Вы в том числе <iostream> за std::cout но вы используете printf от <cstdio>,

По сути, вы смешиваете не только C ++ и Chapel, но также C ++ и C.

1