-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mini-LISP in C is not compiling on mac #424
Comments
To solve this, I need to know:
|
Firstly, just to make sure we're on the same page, I'm referring to the
project in the folder safor/Mini-Lisp.Chic
Secondly, I'm trying to run the command "make mini-lisp".
1. See attached screenshot.
2. The build command that produces the error is:
"c++ -w -std=gnu2x -c tokenizer.cc", so the compiler is gnu, and the
version is gnu2x. The problem seems to be that the command tries to compile
C++ files with a strictly C compiler version.
3.
What happens is an occurrence of errors, different from the one with the
rogue flag:
***@***.*** Mini-Lisp.Chic % make mini-lisp
c++ -w -std=c++17 -c tokenizer.cc
In file included from tokenizer.cc:3:
In file included from ./mode.h:6:
In file included from ./debugging.h:5:
In file included from ./dump.h:3:
In file included from
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/iostream:37:
In file included from
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/ios:215:
In file included from
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:14:
In file included from
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/string:506:
In file included from
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/string_view:175:
In file included from
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__string:57:
In file included from
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/algorithm:644:
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:1444:21:
**error: **declaration of anonymous class must be a definition*
template<class _Fp> class _LIBCPP_DEPRECATED_CXX03_FUNCTION
_LIBCPP_TEMPLATE_VIS function; // undefined
* ^*
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:1485:6:
**error: **redefinition of '__not_null' as different kind of symbol*
bool __not_null(function<_Fp> const& __f) { return !!__f; }
* ^*
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:1481:6:
note: *previous definition is here
bool __not_null(_Ret _Class::*__ptr) { return __ptr; }
* ^*
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:1485:25:
**error: **expected expression*
bool __not_null(function<_Fp> const& __f) { return !!__f; }
* ^*
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:1485:26:
**error: **'_Fp' does not refer to a value*
bool __not_null(function<_Fp> const& __f) { return !!__f; }
* ^*
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:1483:17:
note: *declared here
template <class _Fp>
* ^*
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:1485:31:
**error: **expected expression*
bool __not_null(function<_Fp> const& __f) { return !!__f; }
* ^*
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:1485:42:
**error: **expected ';' at end of declaration*
bool __not_null(function<_Fp> const& __f) { return !!__f; }
* ^*
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:1485:43:
**error: **expected unqualified-id*
bool __not_null(function<_Fp> const& __f) { return !!__f; }
* ^*
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:2326:1:
**error: **declaration of anonymous class must be a definition*
class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)>
*^*
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:2328:7:
**error: **expected unqualified-id*
public
__function::__maybe_derive_from_binary_function<_Rp(_ArgTypes...)>
* ^*
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:2429:15:
**error: **C++ requires a type specifier for all declarations*
function(_Rp(*)(_Ap...)) -> function<_Rp(_Ap...)>;
* ^*
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:2429:10:
**error: **C++ requires a type specifier for all declarations*
function(_Rp(*)(_Ap...)) -> function<_Rp(_Ap...)>;
* ^*
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:2429:25:
**error: **expected ';' at end of declaration*
function(_Rp(*)(_Ap...)) -> function<_Rp(_Ap...)>;
* ^*
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:2429:26:
**error: **cannot use arrow operator on a type*
function(_Rp(*)(_Ap...)) -> function<_Rp(_Ap...)>;
* ^*
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:2471:10:
**error: **C++ requires a type specifier for all declarations*
function(_Fp) -> function<_Stripped>;
* ^*
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:2471:14:
**error: **expected ';' at end of declaration*
function(_Fp) -> function<_Stripped>;
* ^*
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:2471:15:
**error: **cannot use arrow operator on a type*
function(_Fp) -> function<_Stripped>;
* ^*
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:2475:9:
**error: **expected unqualified-id*
function<_Rp(_ArgTypes...)>::function(const function& __f) :
__f_(__f.__f_) {}
* ^*
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:2623:14:
**error: **no template named '__is_bind_expression'; did you mean
'is_bind_expression'?*
: public __is_bind_expression<typename remove_cv<_Tp>::type> {};
* ^*
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:2622:49:
note: *'is_bind_expression' declared here
template<class _Tp> struct _LIBCPP_TEMPLATE_VIS is_bind_expression
* ^*
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:2900:8:
**error: **no template named '__is_bind_expression'; did you mean
'is_bind_expression'?*
struct __is_bind_expression<__bind<_Fp, _BoundArgs...> > : public
true_type {};
* ^*
*/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:2622:49:
note: *'is_bind_expression' declared here
template<class _Tp> struct _LIBCPP_TEMPLATE_VIS is_bind_expression
* ^*
*fatal error: *too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [tokenizer.o] Error 1
…On Wed, 28 Jul 2021 at 17:46, Yossi Gil ***@***.***> wrote:
To solve this, I need to know:
1. What is the error message you get. Try to copy it, or include a
screen dump.
2. Which C++ compiler you use? Gcc? Version?
3. What happens if you remove the rogue flag?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#424 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/APCETIFQO5CTVVD75GFTW6DT2AJ5LANCNFSM5BD7HAKQ>
.
|
OK.
|
***@***.*** Mini-Lisp.js % g++ --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr
--with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.5 (clang-1205.0.22.11)
Target: x86_64-apple-darwin20.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
…On Wed, 28 Jul 2021 at 18:25, Yossi Gil ***@***.***> wrote:
OK.
1. This seems a bug in compiling library files. Please try to disable
inclusion of all library files. Add before including "mode.h" a definition
that this is a production file, better yet, use this flag in Makefile. This
should eliminate
2. Which C++ compiler you use? Gcc? Version? Follow this image, and
provide the results:
[image: image]
<https://user-images.githubusercontent.com/12775400/127349949-c77320cd-6069-4525-ada8-dec8560f5e21.png>
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#424 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/APCETIC42536FW5HUKV7NXTT2AOOZANCNFSM5BD7HAKQ>
.
|
Not sure: GCC or CLAng?What do you think? @OfirMarkowitz1 |
Seems like clang to me
…On Sat, 31 Jul 2021 at 14:07, Yossi Gil ***@***.***> wrote:
Not sure: GCC or CLAng?What do you think? @OfirMarkowitz1
<https://github.com/OfirMarkowitz1>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#424 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/APCETIAMMVF4CTRPI2LFVTDT2PKONANCNFSM5BD7HAKQ>
.
|
Well, we got it. We need GCC... |
There seems to be some problem with the compiler version
The text was updated successfully, but these errors were encountered: