Projects

Ticket #765 (new defect)

Opened 20 months ago

Last modified 14 months ago

framework is not supported in MacRuby static

Reported by: jazzbox@… Owned by: lsansonetti@…
Priority: major Milestone: MacRuby Later
Component: MacRuby Keywords:
Cc:

Description

$ cat test.rb 
framework 'Foundation'
p NSGregorianCalendar
$ macruby test.rb 
"gregorian"
$ macrubyc -o test --static test.rb 
$ ./test
framework: is not supported in MacRuby static (RuntimeError)

Commenting out the framework 'Foundation' results in a

./test.rb:4:in `<main>': uninitialized constant NSGregorianCalendar (NameError)

Change History

follow-up: ↓ 2   Changed 20 months ago by lsansonetti@…

#framework is not supported via static compilation. You should specify the frameworks you need using --framework to macrubyc instead.

FYI, static compilation is still a work in progress, so a lot of things will not work yet.

in reply to: ↑ 1   Changed 20 months ago by jazzbox@…

Replying to lsansonetti@…:

#framework is not supported via static compilation. You should specify the frameworks you need using --framework to macrubyc instead.

NSGregorianCalendar is a constant which is defined in the foundation framework, which is already included by default in macrubyc.

FYI, static compilation is still a work in progress, so a lot of things will not work yet.

...so I have to wait until constants of Cocoa frameworks are supported!

  Changed 14 months ago by jhemmelg@…

I tried to reproduce this problem with the nightly build 4 Dec 2010. Compilation failed with:

$ macrubyc -o test --framework Foundation --static test.rb
Warning: static compilation is currently a work in progress and provided for development only. The compilation process may simply fail or generate non-functional machine code objects. Use it at your own risk.
Undefined symbols:
  "_rb_pointer_new", referenced from:
      l1021 in libmacruby-static.a(string.o)
     (maybe you meant: _rb_pointer_new2)
ld: symbol(s) not found
collect2: ld returned 1 exit status
Error when executing `/usr/bin/g++ -o "test" -arch x86_64 -lobjc -licucore -lauto -framework Foundation -L/Library/Frameworks/MacRuby.framework/Versions/0.8/usr/lib -lmacruby-static  "/var/folders/a4/a4otm566Goa4sXqf7P+jL++++TI/-Tmp-/main-16899.o" "./test.o"'

  Changed 14 months ago by mattaimonetti@…

  • milestone changed from MacRuby 0.7 to MacRuby Later
Note: See TracTickets for help on using tickets.