[MacRuby-devel] Request for feedback on new tutorial

Emil Tin emil at tin.dk
Fri Aug 20 06:51:15 PDT 2010


progress!
I downloaded your project, and it builds without problems. Comparing them I found out that:

1. my project was missing the 'Copy Headers' build phase.

2. after adding a 'copy headers' phase, and using the get info.. then checkbox method to add headers files from the taglib target to the taglibbundle target, it still couldn't build because my project had list.tcc and tmap.tcc in the 'compile sources' build phase. for some reason, it seems that when i use 'get info' method, files with the .tcc extension are added to the 'compile source' phase isntead of the 'copy headers' phase.


after moving the two .tcc files to the 'copy headers phase', my project builds. moving on i found.


3.  TagLib.h needs #import <Cocoa/Cocoa.h>

4. TagLib.m needs #import "tag_c.h"

5. the copy script at the end failed. the reason was i copied it from the webpage, which had a line break. you might add a "\" to the code at the webapge:

cp -v "${TARGET_BUILD_DIR}/${EXECUTABLE_PATH}" \
"${SOURCE_ROOT}/${FULL_PRODUCT_NAME}"

6. i need to require the full path to the bundle (or modify load paths). simply using require 'TagLibBundle' fails even if i'm inside the folder the bundle is?

7. it works! i can use test.tags[:title] and get the title af an mp3.

8. if i call test.tags i get a segmentation fault:

~/Desktop/MacRuby/TagLib.framework$ macirb
Couldn't load Wirble: no such file to load -- wirble
irb(main):001:0> require '/Users/emiltin/Desktop/MacRuby/TagLib.framework/TagLibBundle.bundle'
=> true
irb(main):002:0> test = TagLib.alloc.initWithFileAtPath("/Users/emiltin/Music/Elysium\ etc/Celestial_Sounds_and_Tribal_Beats_mp3/05.Wisdom.mp3")
=> #<TagLib:0x200031f40>
irb(main):003:0> test.tags[:title]=> "Wisdom"
irb(main):004:0> test.tagsSegmentation fault




thanks,
emil  

On 20/08/2010, at 14.42, Nick Ludlam wrote:

> Thanks very much Emil. I'll go through the points:
> 
> 1. Good catch. I'll replace this with 'curl' since it's part of the base system. 
> 
> 2. I'll describe this step in a little more detail, perhaps with a screenshot. There is a reasonable familiarity with XCode that's assumed, though.
> 
> 3. I suspect this is related to build setting change that I may have missed out. If you have time, could you grab the project from http://github.com/nickludlam/TagLib.framework and try compiling ?
> 
> 
> Nick
> 
> 
> On 20 Aug 2010, at 12:42, Emil Tin wrote:
> 
>> 
>> nice tutorials!
>> 
>> i tried following the tutorial but ran into a few problems:
>> 
>> 1.
>> wget command was not found. wget is not installed by default in os x, it seems.
>> 
>> 2.
>> linking agains foundation and libz: as an xcode beginner, i had to guess a bit to figure out how to do this. i suppose you mean adding items in the 'linked libraries' area of the taglibbundle target info pane. maybe describe in a sentence the simple steps involved.
>> 
>> 3.
>> can't compile. when i try to build the project, i get a lot of errors. here's the first:
>> 
>> 
>> CompileC /Users/emiltin/Desktop/builds/TagLib.build/Debug/TagLibBundle.build/Objects-normal/x86_64/tlist.o taglib-src/taglib/toolkit/tlist.tcc normal x86_64 c++ com.apple.compilers.gcc.4_2
>> cd /Users/emiltin/Desktop/MacRuby/TagLib.framework
>> setenv LANG en_US.US-ASCII
>> /Developer/usr/bin/gcc-4.2 -x c++ -arch x86_64 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -DHAVE_CONFIG_H -isysroot /Developer/SDKs/MacOSX10.6.sdk -mfix-and-continue -fvisibility-inlines-hidden -mmacosx-version-min=10.6 -gdwarf-2 -iquote /Users/emiltin/Desktop/builds/TagLib.build/Debug/TagLibBundle.build/TagLibBundle-generated-files.hmap -I/Users/emiltin/Desktop/builds/TagLib.build/Debug/TagLibBundle.build/TagLibBundle-own-target-headers.hmap -I/Users/emiltin/Desktop/builds/TagLib.build/Debug/TagLibBundle.build/TagLibBundle-all-target-headers.hmap -iquote /Users/emiltin/Desktop/builds/TagLib.build/Debug/TagLibBundle.build/TagLibBundle-project-headers.hmap -F/Users/emiltin/Desktop/builds/Debug -I/Users/emiltin/Desktop/builds/Debug/include -I/Users/emiltin/Desktop/builds/TagLib.build/Debug/TagLibBundle.build/DerivedSources/x86_64 -I/Users/emiltin/Desktop/builds/TagLib.build/Debug/TagLibBundle.build/DerivedSources 
> -c /Users/emiltin/Desktop/MacRuby/TagLib.framework/taglib-src/taglib/toolkit/tlist.tcc -o /Users/emiltin/Desktop/builds/TagLib.build/Debug/TagLibBundle.build/Objects-normal/x86_64/tlist.o
>> 
>> /Users/emiltin/Desktop/MacRuby/TagLib.framework/taglib-src/taglib/toolkit/tlist.tcc:42: error: expected class-name before '{' token
>> /Users/emiltin/Desktop/MacRuby/TagLib.framework/taglib-src/taglib/toolkit/tlist.tcc:51: error: 'List' is not a template
>> /Users/emiltin/Desktop/MacRuby/TagLib.framework/taglib-src/taglib/toolkit/tlist.tcc:51: error: 'List' has not been declared
>> /Users/emiltin/Desktop/MacRuby/TagLib.framework/taglib-src/taglib/toolkit/tlist.tcc:51: error: expected unqualified-id before ':' token
>> /Users/emiltin/Desktop/MacRuby/TagLib.framework/taglib-src/taglib/toolkit/tlist.tcc:66: error: 'List' is not a template
>> /Users/emiltin/Desktop/MacRuby/TagLib.framework/taglib-src/taglib/toolkit/tlist.tcc:66: error: 'List' has not been declared
>> /Users/emiltin/Desktop/MacRuby/TagLib.framework/taglib-src/taglib/toolkit/tlist.tcc:66: error: expected unqualified-id before '<' token
>> /Users/emiltin/Desktop/MacRuby/TagLib.framework/taglib-src/taglib/toolkit/tlist.tcc:90: error: expected constructor, destructor, or type conversion before '<' token
>> /Users/emiltin/Desktop/MacRuby/TagLib.framework/taglib-src/taglib/toolkit/tlist.tcc:96: error: expected constructor, destructor, or type conversion before '<' token
>> /Users/emiltin/Desktop/MacRuby/TagLib.framework/taglib-src/taglib/toolkit/tlist.tcc:102: error: expected constructor, destructor, or type conversion before '<' token
>> /Users/emiltin/Desktop/MacRuby/TagLib.framework/taglib-src/taglib/toolkit/tlist.tcc:109: error: expected nested-name-specifier before 'List'
>> /Users/emiltin/Desktop/MacRuby/TagLib.framework/taglib-src/taglib/toolkit/tlist.tcc:109: error: expected initializer before '<' token
>> /Users/emiltin/Desktop/MacRuby/TagLib.framework/taglib-src/taglib/toolkit/tlist.tcc:116: error: expected nested-name-specifier before 'List'
>> /Users/emiltin/Desktop/MacRuby/TagLib.framework/taglib-src/taglib/toolkit/tlist.tcc:116: error: expected initializer before '<' token
>> /Users/emiltin/Desktop/MacRuby/TagLib.framework/taglib-src/taglib/toolkit/tlist.tcc:122: error: expected nested-name-specifier before 'List'
>> /Users/emiltin/Desktop/MacRuby/TagLib.framework/taglib-src/taglib/toolkit/tlist.tcc:122: error: expected initializer before '<' token
>> /Users/emiltin/Desktop/MacRuby/TagLib.framework/taglib-src/taglib/toolkit/tlist.tcc:129: error: expected nested-name-specifier before 'List'
>> /Users/emiltin/Desktop/MacRuby/TagLib.framework/taglib-src/taglib/toolkit/tlist.tcc:129: error: expected initializer before '<' token
>> /Users/emiltin/Desktop/MacRuby/TagLib.framework/taglib-src/taglib/toolkit/tlist.tcc:135: error: expected nested-name-specifier before 'List'
>> /Users/emiltin/Desktop/MacRuby/TagLib.framework/taglib-src/taglib/toolkit/tlist.tcc:135: error: expected initializer before '<' token
>> .....
>> 
>> 
>> i'm using taglib 1.6.3, os x 10.6.4 and xcode 3.2.3
>> 
>> I'm not very experienced with xcode, and not sure what to do next. i followed the steps you described wtih setting up xcode build settings, etc. it seems the header files is somehow not included correctly?
>> 
>> thanks,
>> emil
>> 
>> 
>> On 19/08/2010, at 19.12, Nick Ludlam wrote:
>> 
>>> I've written up a first draft of a tutorial on taking C/C++, wrapping the code in a simple Obj-C class, then exporting this as a bundle which can be loaded by MacRuby. In this case, it's about wrapping the open-source TagLib library in order to extract ID3 tags from mp3 files.
>>> 
>>> If people have the time, I'd really appreciate any feedback on things like length, clarity, and accuracy of describing steps in XCode etc etc. 
>>> 
>>> http://recoil.org/~nick/macruby/documentation/realworld-dynamic-bundles.html
>>> 
>>> 
>>> Thanks,
>>> Nick
>>> 
>>> _______________________________________________
>>> MacRuby-devel mailing list
>>> MacRuby-devel at lists.macosforge.org
>>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>> 
>> _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
> 
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1920 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20100820/032a1b04/attachment-0001.bin>


More information about the MacRuby-devel mailing list