Skip to content
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

install failed: undeclared identifier: 'defer' #2241

Closed
select opened this issue Mar 1, 2015 · 5 comments
Closed

install failed: undeclared identifier: 'defer' #2241

select opened this issue Mar 1, 2015 · 5 comments

Comments

@select
Copy link

select commented Mar 1, 2015

I was following the official install instructions

git clone -b master git://github.com/Araq/Nim.git
cd Nim
git clone -b master --depth 1 git://github.com/nim-lang/csources
cd csources && sh build.sh
cd ..
bin/nim c koch

but the last line crashed

$ bin/nim c koch
config/nim.cfg(53, 2) Hint: added path: '/home/select/.babel/pkgs/' [Path]
config/nim.cfg(54, 2) Hint: added path: '/home/select/.nimble/pkgs/' [Path]
Hint: used config file '/home/select/bin/Nim/config/nim.cfg' [Conf]
Hint: used config file 'koch.nim.cfg' [Conf]
Hint: system [Processing]
lib/system.nim(3131, 12) Warning: undeclared conditional symbol; use --symbol to declare it: nimnode [User]
lib/system.nim(3222, 31) Warning: unknown magic 'ProcCall' might crash the compiler [UnknownMagic]
Hint: koch [Processing]
Hint: os [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: times [Processing]
Hint: posix [Processing]
Hint: parseopt [Processing]
lib/pure/parseopt.nim(56, 34) Warning: quoteIfContainsWhite is deprecated [Deprecated]
koch.nim(19, 16) Warning: parseopt is deprecated [Deprecated]
Hint: osproc [Processing]
Hint: strtabs [Processing]
Hint: hashes [Processing]
Hint: streams [Processing]
Hint: cpuinfo [Processing]
Hint: linux [Processing]
lib/pure/osproc.nim(647, 4) Error: undeclared identifier: 'defer'

did i miss something?

$ cat /etc/issue
Ubuntu 14.10 \n \l
$ uname -a
Linux select 3.16.0-30-generic #40-Ubuntu SMP Mon Jan 12 22:06:37 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
@def-
Copy link
Member

def- commented Mar 1, 2015

Are you sure you're not on the devel branch of the Nim compiler? The csources and Nim compiler branch must always match. Either both master or both devel.

When I check lib/pure/osproc.nim at line 647 in the master branch, it says finally, not defer.

@select
Copy link
Author

select commented Mar 1, 2015

could be true, I'll check

@select
Copy link
Author

select commented Mar 1, 2015

Indeed I was in the wrong branch, thanks for the help :D

@select select closed this as completed Mar 1, 2015
@rjammala
Copy link

I made sure that I was on the master branch and still hit this error.

[rjammalamadaka@localhost Nim]$ bin/nim c koch
config/nim.cfg(53, 2) Hint: added path: '/home/rjammalamadaka/.babel/pkgs/' [Path]
config/nim.cfg(54, 2) Hint: added path: '/home/rjammalamadaka/.nimble/pkgs/' [Path]
Hint: used config file '/home/rjammalamadaka/Nim/config/nim.cfg' [Conf]
Hint: used config file 'koch.nim.cfg' [Conf]
Hint: system [Processing]
lib/system.nim(147, 40) Warning: unknown magic 'Addr' might crash the compiler [UnknownMagic]
lib/system.nim(152, 39) Warning: unknown magic 'TypeOf' might crash the compiler [UnknownMagic]
lib/system.nim(229, 62) Warning: unknown magic 'DotDot' might crash the compiler [UnknownMagic]
lib/system.nim(237, 59) Warning: unknown magic 'DotDot' might crash the compiler [UnknownMagic]
lib/system.nim(3210, 31) Warning: unknown magic 'Plugin' might crash the compiler [UnknownMagic]
lib/system.nim(3242, 31) Warning: unknown magic 'ProcCall' might crash the compiler [UnknownMagic]
lib/system.nim(3251, 44) Warning: unknown magic 'Roof' might crash the compiler [UnknownMagic]
lib/system.nim(3269, 34) Warning: unknown magic 'XLenStr' might crash the compiler [UnknownMagic]
lib/system.nim(3270, 37) Warning: unknown magic 'XLenSeq' might crash the compiler [UnknownMagic]
Hint: koch [Processing]
Hint: os [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: times [Processing]
lib/pure/times.nim(585, 30) Info: instantiation from here
lib/system.nim(229, 62) Warning: unknown magic 'DotDot' might crash the compiler [UnknownMagic]
Hint: posix [Processing]
Hint: parseopt [Processing]
lib/pure/parseopt.nim(59, 34) Warning: quoteIfContainsWhite is deprecated [Deprecated]
Hint: osproc [Processing]
Hint: strtabs [Processing]
Hint: hashes [Processing]
Hint: streams [Processing]
Hint: cpuinfo [Processing]
Hint: linux [Processing]
lib/pure/osproc.nim(647, 4) Error: undeclared identifier: 'defer'

[rjammalamadaka@localhost Nim]$ uname -a
Linux localhost.localdomain 2.6.32-504.12.2.el6.x86_64 #1 SMP Wed Mar 11 22:03:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[rjammalamadaka@localhost Nim]$ gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@refi64
Copy link
Contributor

refi64 commented Apr 30, 2015

To quote my message from #2624:

Your nim version is probably too old. Try rebuilding it from the C sources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants