{"id":1558,"date":"2013-01-15T10:07:41","date_gmt":"2013-01-15T01:07:41","guid":{"rendered":"http:\/\/www.techscore.com\/blog\/?p=1558"},"modified":"2018-11-14T16:33:57","modified_gmt":"2018-11-14T07:33:57","slug":"c%e8%a8%80%e8%aa%9e%e3%81%8b%e3%82%89gauche%e3%82%92%e4%bd%bf%e3%81%8a%e3%81%86%ef%bc%81-1-%e3%82%b3%e3%83%b3%e3%83%91%e3%82%a4%e3%83%ab%e7%92%b0%e5%a2%83%e3%82%92%e6%95%b4%e3%81%88%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.techscore.com\/blog\/2013\/01\/15\/c%e8%a8%80%e8%aa%9e%e3%81%8b%e3%82%89gauche%e3%82%92%e4%bd%bf%e3%81%8a%e3%81%86%ef%bc%81-1-%e3%82%b3%e3%83%b3%e3%83%91%e3%82%a4%e3%83%ab%e7%92%b0%e5%a2%83%e3%82%92%e6%95%b4%e3%81%88%e3%82%8b\/","title":{"rendered":"C\u8a00\u8a9e\u304b\u3089Gauche\u3092\u4f7f\u304a\u3046\uff01 (1) \u30b3\u30f3\u30d1\u30a4\u30eb\u74b0\u5883\u3092\u6574\u3048\u308b"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u9234\u6728\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3057\u3070\u3089\u304f Scheme \u3068\u3054\u7121\u6c99\u6c70\u3060\u3063\u305f\u3053\u3068\u306b\u6c17\u4ed8\u304d\u3001\u6700\u8fd1\u306e\u52d5\u5411\u3092\u8abf\u3079\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u4f7f\u7528\u3057\u3066\u3044\u308b Scheme \u51e6\u7406\u7cfb\u306e <a title=\"Gauche\" href=\"http:\/\/practical-scheme.net\/gauche\/index-j.html\">Gauche<\/a> \u306e\u30b5\u30a4\u30c8\u3082\u30c1\u30a7\u30c3\u30af\u3057\u3066\u3044\u308b\u3068\u3001\u3075\u3068\u6c17\u306b\u306a\u308b\u8a00\u8449\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>Gauche \u306e\u76ee\u6a19\u306e\u4e00\u3064\u3068\u3057\u3066\u300c\u30ea\u30b9\u30c8\u51e6\u7406\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u3057\u3066\u4ed6\u306eC\/C++\u30d7\u30ed\u30b0\u30e9\u30e0\u304b\u3089\u7c21\u5358\u306b\u30ea\u30f3\u30af\u53ef\u80fd\u3067\u3042\u308b\u3053\u3068\u300d\u3068\u66f8\u304b\u308c\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u7d44\u307f\u8fbc\u307f\u7528\u8a00\u8a9e\u3067\u306f Lua \u3084\u6700\u8fd1\u8a71\u984c\u306e mruby \u306a\u3069\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u500b\u4eba\u7684\u306b\u8a00\u8a9e\u3092\u7d44\u307f\u8fbc\u3093\u3067\u4f7f\u3046\u3068\u3044\u3046\u7d4c\u9a13\u306f\u7121\u304b\u3063\u305f\u306e\u3067\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u958b\u767a\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>\u307e\u305a\u306f\u958b\u767a\u306b\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<p>Debian \u7cfb\u3067\u3042\u308c\u3070\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">sudo apt-get install gauche-dev<\/pre>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068 gauche-config \u3068\u3044\u3046\u30b3\u30de\u30f3\u30c9\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>gauche-config \u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u30a4\u30f3\u30af\u30eb\u30fc\u30c9\u30d1\u30b9\u306a\u3069\u3092\u8abf\u3079\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\"># \u30a4\u30f3\u30af\u30eb\u30fc\u30c9\u30d1\u30b9\u3092\u8abf\u3079\u308b.\r\n&gt; gauche-config -I\r\n-I\/usr\/lib\/gauche-0.9\/0.9.1\/include\r\n\r\n# \u30e9\u30a4\u30d6\u30e9\u30ea\u30d1\u30b9\u3092\u8abf\u3079\u308b.\r\n&gt; gauche-config -L\r\n-L\/usr\/lib\/gauche-0.9\/0.9.1\/i686-pc-linux-gnu \r\n\r\n# \u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u8abf\u3079\u308b.\r\n&gt; gauche-config -l\r\n-lgauche-0.9 -ldl -lcrypt -lm  -lpthread<\/pre>\n<p>\u3053\u308c\u3089\u306e\u60c5\u5831\u306f\u30b3\u30f3\u30d1\u30a4\u30eb\u3084\u30ea\u30f3\u30af\u3092\u884c\u3046\u3068\u304d\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u306f\u3058\u3081\u306e\u4e00\u6b69<\/h2>\n<p>\u3055\u3057\u3042\u305f\u308a\u4f55\u3092\u3069\u3046\u3059\u308c\u3070\u826f\u3044\u306e\u304b\u5206\u304b\u3089\u306a\u3044\u306e\u3067\u3001\u3068\u308a\u3042\u3048\u305a Gauche \u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\"># \u30c0\u30a6\u30f3\u30ed\u30fc\u30c9.\r\nwget http:\/\/prdownloads.sourceforge.net\/gauche\/Gauche-0.9.3.3.tgz\r\n\r\n# \u5c55\u958b\r\ntar xvfo Gauche-0.9.3.3.tgz<\/pre>\n<p>src\/main.c \u306b\u30a8\u30f3\u30c8\u30ea\u30dd\u30a4\u30f3\u30c8\uff08main \u95a2\u6570\uff09\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>src\/main.c \u3092\u898b\u308b\u3068\u3001<\/p>\n<ul>\n<li>#include \"gauche.h\" \u3057\u3066\u3044\u308b\u3002<\/li>\n<li>main \u95a2\u6570\u306e\u4e2d\u3067 GC_INIT() \u3057\u3066\u3044\u308b\u3002<\/li>\n<li>main \u95a2\u6570\u306e\u4e2d\u3067 Scm_Init(GAUCHE_SIGNATURE) \u3057\u3066\u3044\u308b\u3002<\/li>\n<\/ul>\n<p>\u3068\u3044\u3046\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u6700\u5c0f\u9650\u306e\u30d7\u30ed\u30b0\u30e9\u30e0<\/h2>\n<p>\u307e\u305a\u306f\u3001\u6700\u5c0f\u9650\u306e\uff08\uff1d\u4f55\u3082\u3057\u306a\u3044\uff09\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u3057\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\uff06\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u6e96\u5099\u3057\u307e\u3059\u3002<\/p>\n<p>main.c \u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u4ee5\u4e0b\u306e\u5185\u5bb9\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:c decode:true\">#include &lt;stdio.h&gt;\r\n#include &lt;gauche.h&gt;\r\n\r\nint main()\r\n{\r\n    GC_INIT();\r\n    Scm_Init(GAUCHE_SIGNATURE);\r\n\r\n    printf(\"OK\\n\");\r\n\r\n    return 0;\r\n}<\/pre>\n<p>GC_INIT() \u306f\u30de\u30af\u30ed\u306b\u306a\u3063\u3066\u304a\u308a\u3001\u30ac\u30d9\u30fc\u30b8\u30b3\u30ec\u30af\u30bf\u3092\u521d\u671f\u5316\u3059\u308b\u30b3\u30fc\u30c9\u306b\u5c55\u958b\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>Scm_Init() \u306f Gauche \u306e\u30e9\u30f3\u30bf\u30a4\u30e0\u3092\u521d\u671f\u5316\u3059\u308b\u95a2\u6570\u3067\u3001\u5f15\u6570\u306e GAUCHE_SIGUNATURE \u306f\u30d0\u30fc\u30b8\u30e7\u30f3\u30c1\u30a7\u30c3\u30af\u306e\u305f\u3081\u306b\u7528\u3044\u3089\u308c\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>Makefile \u306e\u4f5c\u6210<\/h2>\n<p>\u8272\u3005\u3068\u8a66\u884c\u932f\u8aa4\u3092\u7e70\u308a\u8fd4\u3059\u306f\u305a\u3067\u3059\u306e\u3067\u3001Makefile \u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\uff08\u203b\u30b3\u30d4\u30fc\u3059\u308b\u3068\u304d\u306f\u30bf\u30d6\u304c\u30b9\u30da\u30fc\u30b9\u306b\u306a\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u306e\u3067\u3001\u3054\u6ce8\u610f\u304f\u3060\u3055\u3044\uff09<\/p>\n<pre class=\"lang:default decode:true\">SRC = main.c\r\nOUT = a.out\r\nINCLUDE_DIR = `gauche-config -I`\r\nLIBRARY_DIR = `gauche-config -L`\r\nLIBRARIES = `gauche-config -l`\r\n\r\n$(OUT): $(SRC)\r\n\tgcc -std=gnu99 -Ofast -Wall -Werror -o $(OUT) $(INCLUDE_DIR) $^ $(LIBRARY_DIR) $(LIBRARIES)\r\n\r\nrun: $(OUT)\r\n\t@.\/$(OUT)\r\n\r\nclean:\r\n\trm -f $(OUT)<\/pre>\n<p>C\u8a00\u8a9e\u306e\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u306f main.c \u3068\u3057\u3001\u5b9f\u884c\u30d5\u30a1\u30a4\u30eb\u306f a.out \u3068\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u30b3\u30f3\u30d1\u30a4\u30eb\uff06\u5b9f\u884c<\/h2>\n<p>\u300cmake\u300d\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\uff06\u30ea\u30f3\u30af\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">make<\/pre>\n<p>\u6210\u529f\u3059\u308c\u3070 a.out \u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u300cmake run\u300d\u3067\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">make run<\/pre>\n<p>\u4ee5\u4e0b\u306e\u51fa\u529b\u304c\u5f97\u3089\u308c\u308c\u3070\u6210\u529f\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">OK<\/pre>\n<p>\u3053\u308c\u3067\u30b9\u30bf\u30fc\u30c8\u30e9\u30a4\u30f3\u306b\u7acb\u3064\u3053\u3068\u304c\u51fa\u6765\u307e\u3057\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u307e\u3060\u30b9\u30bf\u30fc\u30c8\u30e9\u30a4\u30f3\u306b\u7acb\u3063\u305f\uff08\u4f55\u3082\u3057\u306a\u3044\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\uff06\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\uff09\u3060\u3051\u3067\u3059\u304c\u3001<\/p>\n<ul>\n<li>Gauche \u306e\u30bd\u30fc\u30b9\u304c\u624b\u5143\u306b\u3042\u3063\u305f\u65b9\u304c\u826f\u3044\u3002<\/li>\n<li>\u30de\u30af\u30ed\u3084\u95a2\u6570\u306e\u6982\u8981\u3092\u77e5\u308b\u306b\u306f gauche.h \u3092\u8aad\u3080\u3068\u826f\u3044\u3002<\/li>\n<li>\u30de\u30af\u30ed\u3084\u95a2\u6570\u306e\u4f7f\u3044\u65b9\u304c\u5206\u304b\u3089\u306a\u3044\u5834\u5408\u306f main.c \u3092\u8aad\u3080\u3068\u826f\u3044\u3002<\/li>\n<\/ul>\n<p>\u3068\u3044\u3046\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u6b21\u56de\u306f\u6570\u5024\u3084\u6587\u5b57\u5217\u306a\u3069\u306e\u751f\u6210\u306e\u4ed5\u65b9\u306a\u3069\u3001\u57fa\u672c\u7684\u306a\u90e8\u5206\u3092\u8abf\u3079\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u9234\u6728\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3057\u3070\u3089\u304f Scheme \u3068\u3054\u7121\u6c99\u6c70\u3060\u3063\u305f\u3053\u3068\u306b\u6c17\u4ed8\u304d\u3001\u6700\u8fd1\u306e\u52d5\u5411\u3092\u8abf\u3079\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u4f7f\u7528\u3057\u3066\u3044\u308b Scheme \u51e6\u7406\u7cfb\u306e Gauche \u306e\u30b5\u30a4\u30c8\u3082\u30c1\u30a7\u30c3\u30af\u3057\u3066\u3044\u308b\u3068\u3001\u3075\u3068\u6c17\u306b\u306a\u308b\u8a00\u8449\u304c\u3042\u308a\u307e\u3057\u305f\u3002<br \/><a href=\"https:\/\/www.techscore.com\/blog\/2013\/01\/15\/c%e8%a8%80%e8%aa%9e%e3%81%8b%e3%82%89gauche%e3%82%92%e4%bd%bf%e3%81%8a%e3%81%86%ef%bc%81-1-%e3%82%b3%e3%83%b3%e3%83%91%e3%82%a4%e3%83%ab%e7%92%b0%e5%a2%83%e3%82%92%e6%95%b4%e3%81%88%e3%82%8b\/\">\u7d9a\u304d\u3092\u8aad\u3080...<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[85,18],"tags":[79,78,77],"_links":{"self":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/1558"}],"collection":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/comments?post=1558"}],"version-history":[{"count":1,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/1558\/revisions"}],"predecessor-version":[{"id":17979,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/1558\/revisions\/17979"}],"wp:attachment":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/media?parent=1558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/categories?post=1558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/tags?post=1558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}