{"id":6253,"date":"2017-01-19T23:12:48","date_gmt":"2017-01-19T14:12:48","guid":{"rendered":"http:\/\/umezawa.dyndns.info\/wordpress\/?p=6253"},"modified":"2017-01-20T01:14:19","modified_gmt":"2017-01-19T16:14:19","slug":"windows-%e4%b8%8a%e3%81%a7%e3%81%ae-visual-c-%e3%81%a8-gccclang-%e3%81%ae%e7%9b%b8%e4%ba%92%e9%81%8b%e7%94%a8%ef%bc%88%e3%81%9d%e3%81%ae%ef%bc%97%ef%bc%89","status":"publish","type":"post","link":"http:\/\/umezawa.dyndns.info\/wordpress\/?p=6253","title":{"rendered":"Windows \u4e0a\u3067\u306e Visual C++ \u3068 GCC\/Clang \u306e\u76f8\u4e92\u904b\u7528\uff08\u305d\u306e\uff17\uff09"},"content":{"rendered":"<p><a href=\"http:\/\/umezawa.dyndns.info\/wordpress\/?p=6173\">\u305d\u306e\uff16<\/a>\u306e\u7d9a\u304d<\/p>\n<p>\u4eca\u307e\u3067\u305a\u3063\u3068 x86 \u3092\u8a66\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001 x64 \u3067\u306f\u3069\u3046\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p><!--more--><br \/>\n\u51e6\u7406\u7cfb\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>Windows 7 64bit<\/li>\n<li>Visual Studio 2015 \/ MS-C for <strong>x64<\/strong><\/li>\n<li>Cygwin <strong>64bit<\/strong> + gcc-core 5.4.0-1<\/li>\n<\/ul>\n<p>32bit \u306e Cygwin \u306b\u3082 x64 \u5411\u3051\u306e\u30d0\u30a4\u30ca\u30ea\u3092\u51fa\u529b\u3059\u308b\u30af\u30ed\u30b9\u30d3\u30eb\u30c9\u74b0\u5883\u306f\u3042\u308a\u307e\u3059\u304c\u3001\u3053\u3053\u3067\u306f 64bit \u7248\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>x64 \u3067\u306f\u547c\u3073\u51fa\u3057\u898f\u7d04\u306f1\u3064\u3057\u304b\u306a\u3044\u3063\u307d\u3044\u306e\u3067\u3001\u4ee5\u524d\u306e\u691c\u8a3c\u3067\u4f7f\u3063\u305f callee.c \u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4fee\u6b63\u3057\u307e\u3059\u3002<\/p>\n<blockquote>\n<pre>umezawa@selene ~$ cat callee.c\r\nint func(int x, int y, int z)\r\n{\r\n        return x * y + z;\r\n}\r\n\r\numezawa@selene ~$ cat main.c\r\n#include &lt;stdio.h&gt;\r\n\r\nint func(int x, int y, int z);\r\n\r\nint main(void)\r\n{\r\n        printf(\"%d\\n\", func(2, 3, 4));\r\n        return 0;\r\n}\r\n\r\numezawa@selene ~$ gcc -o callee_gcc.obj -c callee.c<\/pre>\n<\/blockquote>\n<blockquote>\n<pre>C:\\cygwin64\\home\\umezawa&gt;cl \/Fea.exe main.c callee_gcc.obj\r\nMicrosoft(R) C\/C++ Optimizing Compiler Version 19.00.24215.1 for x64\r\nCopyright (C) Microsoft Corporation.  All rights reserved.\r\n\r\nmain.c\r\nMicrosoft (R) Incremental Linker Version 14.00.24215.1\r\nCopyright (C) Microsoft Corporation.  All rights reserved.\r\n\r\n\/out:a.exe\r\nmain.obj\r\ncallee_gcc.obj\r\n\r\nC:\\cygwin64\\home\\umezawa&gt;a.exe\r\n10\r\n<\/pre>\n<\/blockquote>\n<blockquote>\n<pre>umezawa@selene ~$ gcc -o callee2_a_gcc.o -c callee2_a.c\r\n\r\numezawa@selene ~$ gcc -o callee2_b_gcc.o -c callee2_b.c\r\n\r\numezawa@selene ~$ gcc -o callee2_c_gcc.o -c callee2_c.c\r\n\r\numezawa@selene ~$ ar cru callee2.lib callee2_*_gcc.o<\/pre>\n<\/blockquote>\n<blockquote>\n<pre>C:\\cygwin64\\home\\umezawa&gt;cl \/Fea2.exe main2.c callee2.lib\r\nMicrosoft(R) C\/C++ Optimizing Compiler Version 19.00.24215.1 for x64\r\nCopyright (C) Microsoft Corporation.  All rights reserved.\r\n\r\nmain2.c\r\nMicrosoft (R) Incremental Linker Version 14.00.24215.1\r\nCopyright (C) Microsoft Corporation.  All rights reserved.\r\n\r\n\/out:a2.exe\r\nmain2.obj\r\ncallee2.lib\r\n\r\nC:\\cygwin64\\home\\umezawa&gt;a2\r\n20\r\n13\r\n6\r\n<\/pre>\n<\/blockquote>\n<blockquote>\n<pre>c:\\cygwin64\\home\\umezawa>cl \/Focallee_vc_2.o \/Zl \/c callee.c\r\nMicrosoft(R) C\/C++ Optimizing Compiler Version 19.00.24215.1 for x64\r\nCopyright (C) Microsoft Corporation.  All rights reserved.\r\n\r\ncallee.c\r\n<\/pre>\n<\/blockquote>\n<blockquote>\n<pre>umezawa@selene ~$ gcc -o a3 main.c callee_vc_2.o\r\n\r\numezawa@selene ~$ .\/a3\r\n10\r\n14\r\n<\/pre>\n<\/blockquote>\n<blockquote>\n<pre>C:\\cygwin64\\home\\umezawa&gt;cl \/Focallee2_a_vc.o \/Zl \/c callee2_a.c\r\nMicrosoft(R) C\/C++ Optimizing Compiler Version 19.00.24215.1 for x64\r\nCopyright (C) Microsoft Corporation.  All rights reserved.\r\n\r\ncallee2_a.c\r\n\r\nC:\\cygwin64\\home\\umezawa&gt;cl \/Focallee2_b_vc.o \/Zl \/c callee2_b.c\r\nMicrosoft(R) C\/C++ Optimizing Compiler Version 19.00.24215.1 for x64\r\nCopyright (C) Microsoft Corporation.  All rights reserved.\r\n\r\ncallee2_b.c\r\n\r\nC:\\cygwin64\\home\\umezawa&gt;cl \/Focallee2_c_vc.o \/Zl \/c callee2_c.c\r\nMicrosoft(R) C\/C++ Optimizing Compiler Version 19.00.24215.1 for x64\r\nCopyright (C) Microsoft Corporation.  All rights reserved.\r\n\r\ncallee2_c.c\r\n\r\nc:\\cygwin64\\home\\umezawa&gt;lib \/OUT:callee2_vc.a callee2_a_vc.o callee2_b_vc.o callee2_c_vc.o\r\nMicrosoft (R) Library Manager Version 14.00.24215.1\r\nCopyright (C) Microsoft Corporation.  All rights reserved.\r\n\r\n<\/pre>\n<\/blockquote>\n<blockquote>\n<pre>umezawa@selene ~$ gcc -o a4 main2.c callee2_vc.a\r\n\r\numezawa@selene ~$ .\/a4\r\n20\r\n13\r\n6\r\n\r\n<\/pre>\n<\/blockquote>\n<p>\u3068\u3044\u3046\u308f\u3051\u3067\u5927\u4e08\u592b\u306a\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u305d\u306e\uff18\u306b\u7d9a\u304f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u305d\u306e\uff16\u306e\u7d9a\u304d \u4eca\u307e\u3067\u305a\u3063\u3068 x86 \u3092\u8a66\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001 x64 \u3067\u306f\u3069\u3046\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[],"class_list":["post-6253","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/6253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6253"}],"version-history":[{"count":7,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/6253\/revisions"}],"predecessor-version":[{"id":6260,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/6253\/revisions\/6260"}],"wp:attachment":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6253"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}