프로그래밍 https://debianusers.or.kr/ en cvs add 안 될 때 어떻게 하나요? https://debianusers.or.kr/node/222 <span property="schema:name" class="field field--name-title field--type-string field--label-hidden">cvs add 안 될 때 어떻게 하나요?</span> <div class="field field--name-taxonomy-forums field--type-entity-reference field--label-above"> <div class="field__label">Forums</div> <div class="field__item"><a href="/taxonomy/term/11" hreflang="en">프로그래밍</a></div> </div> <div property="schema:text" class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>sebul@sebulnet:~/webwml/korean/releases/buster$ cvs ci index.wml<br /> cvs commit: No CVSROOT specified!&nbsp; Please use the `-d' option<br /> cvs [commit aborted]: or set the CVSROOT environment variable.</p> <p><br /> sebul@sebulnet:~/webwml/korean/releases/buster$ cvs add index.wml&nbsp;<br /> cvs add: No CVSROOT specified!&nbsp; Please use the `-d' option<br /> cvs [add aborted]: or set the CVSROOT environment variable.</p> <p>무언가를 잘못한 거 같은데 그 무엇이 무언지 모르겠네요...</p> </div> <span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/5" typeof="schema:Person" property="schema:name" datatype="">세벌</span></span> <span property="schema:dateCreated" content="2017-12-19T21:58:45+00:00" class="field field--name-created field--type-created field--label-hidden">2017.12.20.(Wed) - 06:58</span> <section class="field field--name-comment-forum field--type-comment field--label-hidden comment-wrapper"> <article role="article" data-comment-user-id="5" id="comment-447" class="comment js-comment by-node-author clearfix"> <span class="hidden" data-comment-timestamp="1514048321"></span> <footer class="comment__meta"> <article typeof="schema:Person" about="/user/5" class="profile"> </article> <p class="comment__author"><span lang="" about="/user/5" typeof="schema:Person" property="schema:name" datatype="">세벌</span></p> <p class="comment__time">작성: 2017.12.24.(Sun) - 01:58</p> <p class="comment__time">수정: 2017.12.24.(Sun) - 01:58</p> <p class="comment__permalink"><a href="/comment/447#comment-447" hreflang="en">Permalink</a></p> </footer> <div class="comment__content"> <h3><a href="/comment/447#comment-447" class="permalink" rel="bookmark" hreflang="en">directory 를 먼저 add</a></h3> <div class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item"><p>buster 디렉토리를 만들었는데 그 아래의 파일들만&nbsp; cvs add 했더니 에러가 나는 거였네요.</p> <p>디렉토리를 cvs add 한 다음, 그 아래의 파일도 cvs add 하면 됩니다.</p> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=447&amp;1=default&amp;2=en&amp;3=" token="se2PF9xuAQqRRweZvij_k80ub5L1TG-tqL5pYOeKs4o"></drupal-render-placeholder> </div> </article> </section> Tue, 19 Dec 2017 21:58:45 +0000 세벌 222 at https://debianusers.or.kr https://debianusers.or.kr/node/222#comments 32비트 gcc를 64비트 gcc로 사용하려는데 실행이 안되네요. https://debianusers.or.kr/node/173 <span property="schema:name" class="field field--name-title field--type-string field--label-hidden">32비트 gcc를 64비트 gcc로 사용하려는데 실행이 안되네요.</span> <div class="field field--name-taxonomy-forums field--type-entity-reference field--label-above"> <div class="field__label">Forums</div> <div class="field__item"><a href="/taxonomy/term/11" hreflang="en">프로그래밍</a></div> </div> <div property="schema:text" class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; line-height: 1.5px; background-color: rgb(255, 255, 255);">지금 제가 사용하는 gcc 버전은 4.4.5입니다.</p> <p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; line-height: 1.5px; background-color: rgb(255, 255, 255);">gcc는 32비트를 쓰고 있고 데비안은 64비트를 쓰고 있습니다.</p> <p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; line-height: 1.5px; background-color: rgb(255, 255, 255);">&nbsp;</p> <pre> <code class="language-markdown">// test.c #include &lt;stdio.h&gt; int main(void) { char *pt = NULL; printf("sizeof(pt) = %d\n", sizeof(pt)); return 0; }</code></pre> <p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; line-height: 1.5px; background-color: rgb(255, 255, 255);">위 소스를 64비트로 컴파일 해보려고 했습니다.</p> <p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; line-height: 1.5px; background-color: rgb(255, 255, 255);">gcc를 컴파일 할 때 -m64 옵션을 붙여주면 된다고 해서</p> <pre> <code class="language-markdown">root@localhost:/home/westporch/c# gcc -m64 -o test test.c In file included from /usr/include/features.h:378, from /usr/include/stdio.h:28, from test.c:1: /usr/include/gnu/stubs.h:9:27: error: gnu/stubs-64.h: 그런 파일이나 디렉터리가 없습니다</code></pre> <p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; line-height: 1.5px; background-color: rgb(255, 255, 255);">&nbsp;</p> <p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; line-height: 1.5px; background-color: rgb(255, 255, 255);">위와 같이 -m64 옵션을 줘서 컴파일을 시도했지만</p> <p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; line-height: 1.5px; background-color: rgb(255, 255, 255);">stubs-64.h 파일이 없다고 해서 gcc-multilib를 설치했습니다.</p> <pre> <code class="language-markdown">root@localhost:/home/westporch/c# apt-get install gcc-multilib 패키지 목록을 읽는 중입니다... 완료 의존성 트리를 만드는 중입니다 상태 정보를 읽는 중입니다... 완료 다음 패키지를 더 설치할 것입니다: gcc-4.4-multilib lib64gcc1 lib64gomp1 libc6-amd64 libc6-dev-amd64 제안하는 패키지: lib64mudflap0 다음 새 패키지를 설치할 것입니다: gcc-4.4-multilib gcc-multilib lib64gcc1 lib64gomp1 libc6-amd64 libc6-dev-amd64 0개 업그레이드, 6개 새로 설치, 0개 제거 및 1개 업그레이드 안 함. 8,488 k바이트 아카이브를 받아야 합니다. 이 작업 후 22.0 M바이트의 디스크 공간을 더 사용하게 됩니다. 계속 하시겠습니까 [Y/n]? y 받기:1 http://ftp.kr.debian.org/debian/ squeeze/main libc6-amd64 i386 2.11.3-4 [4,180 kB] 받기:2 http://ftp.kr.debian.org/debian/ squeeze/main libc6-dev-amd64 i386 2.11.3-4 [2,032 kB] 받기:3 http://ftp.kr.debian.org/debian/ squeeze/main lib64gcc1 i386 1:4.4.5-8 [44.9 kB] 받기:4 http://ftp.kr.debian.org/debian/ squeeze/main lib64gomp1 i386 4.4.5-8 [25.3 kB] 받기:5 http://ftp.kr.debian.org/debian/ squeeze/main gcc-4.4-multilib i386 4.4.5-8 [2,205 kB] 받기:6 http://ftp.kr.debian.org/debian/ squeeze/main gcc-multilib i386 4:4.4.5-1 [820 B] 내려받기 8,488 k바이트, 소요시간 3초 (2,588 k바이트/초) 전에 선택하지 않은 libc6-amd64 패키지를 선택합니다. (데이터베이스 읽는중 ...현재 131116개의 파일과 디렉터리가 설치되어 있습니다.) libc6-amd64 패키지를 푸는 중입니다 (.../libc6-amd64_2.11.3-4_i386.deb에서) ... 전에 선택하지 않은 libc6-dev-amd64 패키지를 선택합니다. libc6-dev-amd64 패키지를 푸는 중입니다 (.../libc6-dev-amd64_2.11.3-4_i386.deb에서) ... 전에 선택하지 않은 lib64gcc1 패키지를 선택합니다. lib64gcc1 패키지를 푸는 중입니다 (.../lib64gcc1_1%3a4.4.5-8_i386.deb에서) ... 전에 선택하지 않은 lib64gomp1 패키지를 선택합니다. lib64gomp1 패키지를 푸는 중입니다 (.../lib64gomp1_4.4.5-8_i386.deb에서) ... 전에 선택하지 않은 gcc-4.4-multilib 패키지를 선택합니다. gcc-4.4-multilib 패키지를 푸는 중입니다 (.../gcc-4.4-multilib_4.4.5-8_i386.deb에서) ... 전에 선택하지 않은 gcc-multilib 패키지를 선택합니다. gcc-multilib 패키지를 푸는 중입니다 (.../gcc-multilib_4%3a4.4.5-1_i386.deb에서) ... libc6-amd64 (2.11.3-4) 설정하는 중입니다 ... libc6-dev-amd64 (2.11.3-4) 설정하는 중입니다 ... lib64gcc1 (1:4.4.5-8) 설정하는 중입니다 ... lib64gomp1 (4.4.5-8) 설정하는 중입니다 ... gcc-4.4-multilib (4.4.5-8) 설정하는 중입니다 ... gcc-multilib (4:4.4.5-1) 설정하는 중입니다 ...</code></pre> <p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; line-height: 1.5px; background-color: rgb(255, 255, 255);">&nbsp;</p> <p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; line-height: 1.5px; background-color: rgb(255, 255, 255);">gcc-multilib를 설치하고 64비트로 컴파일을 시도했습니다.</p> <pre> <code class="language-markdown">root@localhost:/home/westporch/c# gcc -m64 -o test test.c root@localhost:/home/westporch/c# ./test bash: ./test: cannot execute binary file root@localhost:/home/westporch/c# ls test test.c</code></pre> <p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; line-height: 1.5px; background-color: rgb(255, 255, 255);"><br /> <br /> 그런데 바이너리 파일을 실행할 수 없다고 하네요.<br /> &nbsp;</p> <p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; line-height: 1.5px; background-color: rgb(255, 255, 255);"><br /> <br /> <br /> <br /> gcc가 컴파일 할 때 Linking 과정에서 문제가 있는것 같아서</p> <p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; line-height: 1.5px; background-color: rgb(255, 255, 255);">-v 옵션을 주고 컴파일을 해봤습니다.</p> <pre> <code class="language-markdown">root@localhost:/home/westporch/c# gcc -v -m64 -o test test.c Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.5-8' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-targets=all --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu Thread model: posix gcc version 4.4.5 (Debian 4.4.5-8) COLLECT_GCC_OPTIONS='-v' '-m64' '-o' 'test' '-mtune=generic' /usr/lib/gcc/i486-linux-gnu/4.4.5/cc1 -quiet -v -imultilib 64 test.c -quiet -dumpbase test.c -m64 -mtune=generic -auxbase test -version -o /tmp/ccBP33C2.s ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu" ignoring nonexistent directory "/usr/lib/gcc/i486-linux-gnu/4.4.5/../../../../i486-linux-gnu/include" #include "..." search starts here: #include &lt;...&gt; search starts here: /usr/local/include /usr/lib/gcc/i486-linux-gnu/4.4.5/include /usr/lib/gcc/i486-linux-gnu/4.4.5/include-fixed /usr/include/x86_64-linux-gnu /usr/include End of search list. GNU C (Debian 4.4.5-8) version 4.4.5 (i486-linux-gnu) compiled by GNU C version 4.4.5, GMP version 4.3.2, MPFR version 3.0.0-p3. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 0192d925385d4e6642a93c63f245f907 COLLECT_GCC_OPTIONS='-v' '-m64' '-o' 'test' '-mtune=generic' as -V -Qy --64 -o /tmp/ccDnXfBL.o /tmp/ccBP33C2.s GNU assembler version 2.20.1 (i486-linux-gnu) using BFD version (GNU Binutils for Debian) 2.20.1-system.20100303 COMPILER_PATH=/usr/lib/gcc/i486-linux-gnu/4.4.5/:/usr/lib/gcc/i486-linux-gnu/4.4.5/:/usr/lib/gcc/i486-linux-gnu/:/usr/lib/gcc/i486-linux-gnu/4.4.5/:/usr/lib/gcc/i486-linux-gnu/:/usr/lib/gcc/i486-linux-gnu/4.4.5/:/usr/lib/gcc/i486-linux-gnu/ LIBRARY_PATH=/usr/lib/gcc/i486-linux-gnu/4.4.5/64/:/usr/lib/gcc/i486-linux-gnu/4.4.5/64/:/usr/lib/gcc/i486-linux-gnu/4.4.5/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/i486-linux-gnu/4.4.5/:/usr/lib/gcc/i486-linux-gnu/4.4.5/:/usr/lib/gcc/i486-linux-gnu/4.4.5/../../../:/lib/:/usr/lib/:/usr/lib/i486-linux-gnu/ COLLECT_GCC_OPTIONS='-v' '-m64' '-o' 'test' '-mtune=generic' /usr/lib/gcc/i486-linux-gnu/4.4.5/collect2 --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=both -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o test /usr/lib/gcc/i486-linux-gnu/4.4.5/../../../../lib64/crt1.o /usr/lib/gcc/i486-linux-gnu/4.4.5/../../../../lib64/crti.o /usr/lib/gcc/i486-linux-gnu/4.4.5/64/crtbegin.o -L/usr/lib/gcc/i486-linux-gnu/4.4.5/64 -L/usr/lib/gcc/i486-linux-gnu/4.4.5/64 -L/usr/lib/gcc/i486-linux-gnu/4.4.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/i486-linux-gnu/4.4.5 -L/usr/lib/gcc/i486-linux-gnu/4.4.5 -L/usr/lib/gcc/i486-linux-gnu/4.4.5/../../.. -L/usr/lib/i486-linux-gnu /tmp/ccDnXfBL.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/i486-linux-gnu/4.4.5/64/crtend.o /usr/lib/gcc/i486-linux-gnu/4.4.5/../../../../lib64/crtn.o root@localhost:/home/westporch/c# </code></pre> <p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; line-height: 1.5px; background-color: rgb(255, 255, 255);">컴파일 과정을 보면 Preprocessing ---&gt; Compilation ---&gt; Assemble ---&gt; Linking 과정을 거쳐서</p> <p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; line-height: 1.5px; background-color: rgb(255, 255, 255);">컴파일이 정상적으로 완료된것 같은데 어디가 문제인지 잘 모르겠습니다.</p> <p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; line-height: 1.5px; background-color: rgb(255, 255, 255);">&nbsp;</p> <p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; line-height: 1.5px; background-color: rgb(255, 255, 255);">아시는 분은 도와주세요~</p> </div> <span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">westporch</span></span> <span property="schema:dateCreated" content="2012-12-19T13:27:00+00:00" class="field field--name-created field--type-created field--label-hidden">2012.12.19.(Wed) - 22:27</span> <section class="field field--name-comment-forum field--type-comment field--label-hidden comment-wrapper"> </section> Wed, 19 Dec 2012 13:27:00 +0000 westporch 173 at https://debianusers.or.kr https://debianusers.or.kr/node/173#comments 어셈블리 https://debianusers.or.kr/node/148 <span property="schema:name" class="field field--name-title field--type-string field--label-hidden">어셈블리</span> <div class="field field--name-taxonomy-forums field--type-entity-reference field--label-above"> <div class="field__label">Forums</div> <div class="field__item"><a href="/taxonomy/term/11" hreflang="en">프로그래밍</a></div> </div> <div property="schema:text" class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p><span style="color: rgb(34, 34, 34); font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255);">처음에 value의 값은 1이지만 나중에는 value의 값이 100이 되는 프로그램입니다.<br /> 원본 소스에 나름대로 주석을 달아보았는데 올바른 해석인지 궁금하여 질문을 올립니다. </span></p> <pre> <code class="language-markdown">#movetest2.s - An example of moving register data to memory .section .data value: .int 1 ;value 값을 1로 설정 .section .text .globl _start _start: nop movl $100, %eax ;100을 eax 레지스터에 저장 movl %eax, value ; eax 레지스터의 값을 value에 이동. movl $1, %eax ; 초기 value 값인 1을 eax 레지스터로 이동. 따라서, value 값은 100이 된다? movl $0, %ebx int $0x80</code></pre> <p><br /> <span style="color: rgb(34, 34, 34); font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255);">아래 내용은 위 프로그램을 gdb로 분석하는 내용입니다. </span></p> <pre> <code class="language-markdown">(gdb) break *_start+1 Breakpoint 1 ast 0x8048075: file movetest2.s, line 8 (gdb) run Starting program: /home/westporch/S/movetest2 Breakpoint 1, _start () at movetest2.s:8 8 movl $100, %eax Current language: auto; currently asm (gdb) x/d &amp;value 0x804908c : 1 (gdb) s _start () at movetest2.s:9 9 movl %eax, value (gdb) s _start () at movetest2.s:10 10 movl $1, %eax (gdb) x/d &amp;value 0x804908c : 100 (gdb)</code></pre> <p>&nbsp;</p> </div> <span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">westporch</span></span> <span property="schema:dateCreated" content="2009-12-14T12:49:00+00:00" class="field field--name-created field--type-created field--label-hidden">2009.12.14.(Mon) - 21:49</span> <section class="field field--name-comment-forum field--type-comment field--label-hidden comment-wrapper"> </section> Mon, 14 Dec 2009 12:49:00 +0000 westporch 148 at https://debianusers.or.kr https://debianusers.or.kr/node/148#comments [최초보]문자열 입출력문제 https://debianusers.or.kr/node/132 <span property="schema:name" class="field field--name-title field--type-string field--label-hidden">[최초보]문자열 입출력문제</span> <div class="field field--name-taxonomy-forums field--type-entity-reference field--label-above"> <div class="field__label">Forums</div> <div class="field__item"><a href="/taxonomy/term/11" hreflang="en">프로그래밍</a></div> </div> <div property="schema:text" class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p><span style="color: rgb(34, 34, 34); font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255);">안녕하세요? 항상 질문만 하는 최초보입니다.<br /> php와 mysql을 이용하여 문자열을 입력 할때 addslashes()함수를 이용하여 입력하고 stripslashes()함수를 이용하여 출력하면 "\"나 뭐 그런 문자들은 잘 들어가고 나오쟎아요?<br /> 그런데, 공백(blank)는 어떻게 처리 하나요? 책을 뒤져 봤는데... 그런 루틴은 찾지를 못하겠습니다.<br /> <br /> 입력 후 mysql에 접속해 보면 분명 공백(blank)까지 다 들어가 있는데요...<br /> 출력을 해 보면 공백(blank)부분에서 잘려 나옵니다.<br /> 예를 들어 입력 할때 "최 초보" 이렇게 입력하면 출력시에는 "최"만 덜렁 나옵니다.<br /> <br /> 해결 방안을 알려 주시면 정말 감사하겠습니다.<br /> 좋은 밤 되세요. 감사합니다.<br /> 최 초보드림</span></p> </div> <span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/15" typeof="schema:Person" property="schema:name" datatype="">dhchoi</span></span> <span property="schema:dateCreated" content="2009-10-12T15:13:00+00:00" class="field field--name-created field--type-created field--label-hidden">2009.10.13.(Tue) - 00:13</span> <section class="field field--name-comment-forum field--type-comment field--label-hidden comment-wrapper"> <article role="article" data-comment-user-id="69" id="comment-318" class="comment js-comment clearfix"> <span class="hidden" data-comment-timestamp="1493790035"></span> <footer class="comment__meta"> <article typeof="schema:Person" about="/user/69" class="profile"> </article> <p class="comment__author"><span lang="" about="/user/69" typeof="schema:Person" property="schema:name" datatype="">wildapple</span></p> <p class="comment__time">작성: 2009.10.13.(Tue) - 21:02</p> <p class="comment__time">수정: 2017.05.03.(Wed) - 14:40</p> <p class="comment__permalink"><a href="/comment/318#comment-318" hreflang="en">Permalink</a></p> </footer> <div class="comment__content"> <h3><a href="/comment/318#comment-318" class="permalink" rel="bookmark" hreflang="en">출력 방법</a></h3> <div class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item"><div class="content" style="margin: 0px; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">출력은 어떤 방법으로 하나요? 제 경우에는 문제가 없거든요.</div> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=318&amp;1=default&amp;2=en&amp;3=" token="Ae33QtGHx243z4k30WlFr-yNUWRP9pkt_f9D65v-icU"></drupal-render-placeholder> </div> </article> <div class="indented"><article role="article" data-comment-user-id="15" id="comment-319" class="comment js-comment by-node-author clearfix"> <span class="hidden" data-comment-timestamp="1493790209"></span> <footer class="comment__meta"> <article typeof="schema:Person" about="/user/15" class="profile"> </article> <p class="comment__author"><span lang="" about="/user/15" typeof="schema:Person" property="schema:name" datatype="">dhchoi</span></p> <p class="comment__time">작성: 2009.10.14.(Wed) - 09:07</p> <p class="comment__time">수정: 2017.05.03.(Wed) - 14:43</p> <p class="comment__permalink"><a href="/comment/319#comment-319" hreflang="en">Permalink</a></p> <p class="visually-hidden">In reply to <a href="/comment/318#comment-318" class="permalink" rel="bookmark" hreflang="en">출력 방법</a> by <span lang="" about="/user/69" typeof="schema:Person" property="schema:name" datatype="">wildapple</span></p> </footer> <div class="comment__content"> <h3><a href="/comment/319#comment-319" class="permalink" rel="bookmark" hreflang="en">죄송합니다</a></h3> <div class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item"><div class="content" style="margin: 0px; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">제 질문이 너무 엉성했나 봅니다. 죄송합니다.<br /> web에서 입력을 받습니다. (예를 들면 : input.html - form사용) 그걸 받아서 (예. inputok.php)를 통하여 mysql에 입력합니다.<br /> 그때 addslashes()함수를 사용하여 입력합니다. 그러면, mysql 에서 봐도 정상적으로 보입니다.<br /> 다시, 출력화면(예.output.php)를 작성하여 이름을 입력하면 불러 오기는 하는데 공백문자(blank)에서 잘려 버립니다.<br /> <br /> 그런데, 한가지 아무리 생각해 봐도 제가 이해 안되는게 있습니다. 저는 지금 화면을 frame으로 나누어 씁니다.<br /> 한쪽에는 이름만 주~~~욱 보이도록 했구요.<br /> 그 이름을 클릭하면 다른 한쪽 frame에서 자세한 내역이 나오도록 (이름/전화번호 등등)이 나오도록 했습니다.<br /> <br /> 문제는 이름만 주~~욱 나열된 곳은 공백문자(blank)의 문제 없이 다 보입니다.<br /> 그런데, 자세한 내역이 나오도록 한 곳은 잘려 버립니다. 두 php문서는, 아시는 바와 같이 제가 워낙 초보라 똑 같이 했습니다.<br /> 불러오는 방법도 같고 뿌려주는 방법도 같은데...<br /> 다만 한가지 다른게 있다면 주~~~욱 나열된 곳은 를 사용하지 않고 그냥 화면에 보이도록 했고 자세한 내역이 나오도록 한 곳은 &gt;을 사용하였다는 겁니다.<br /> 혹시 여기서 문제가 있는게 아닐까요? 창피하지만 소스코드 보여 드릴까요???<br /> <br /> 도움 부탁드리겠습니다.<br /> 감사합니다. 최 초보 드림</div> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=319&amp;1=default&amp;2=en&amp;3=" token="WBQ30tb5bYFICG49D3miYjTdZ8w6UHLaHPpNFgq9zxg"></drupal-render-placeholder> </div> </article> <div class="indented"><article role="article" data-comment-user-id="69" id="comment-320" class="comment js-comment clearfix"> <span class="hidden" data-comment-timestamp="1493790300"></span> <footer class="comment__meta"> <article typeof="schema:Person" about="/user/69" class="profile"> </article> <p class="comment__author"><span lang="" about="/user/69" typeof="schema:Person" property="schema:name" datatype="">wildapple</span></p> <p class="comment__time">작성: 2009.10.14.(Wed) - 09:39</p> <p class="comment__time">수정: 2017.05.03.(Wed) - 14:45</p> <p class="comment__permalink"><a href="/comment/320#comment-320" hreflang="en">Permalink</a></p> <p class="visually-hidden">In reply to <a href="/comment/319#comment-319" class="permalink" rel="bookmark" hreflang="en">죄송합니다</a> by <span lang="" about="/user/15" typeof="schema:Person" property="schema:name" datatype="">dhchoi</span></p> </footer> <div class="comment__content"> <h3><a href="/comment/320#comment-320" class="permalink" rel="bookmark" hreflang="en">추측해 보면</a></h3> <div class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item"><div class="content" style="margin: 0px; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">일단 대충(?) 추측해 보면 &gt; 에서 $data[name] 형태는 php에서 배열인 것 같습니다.<br /> "1 2 3" 이런 데이터를 배열로 다룬다면 공백이 각각의 데이터를 구분하기 때문에 데이터 하나만 출력 되겠죠.<br /> 확실하지 않지만 이 부분을 고쳐야 할 것 같습니다.</div> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=320&amp;1=default&amp;2=en&amp;3=" token="agq3fAVGPoifV1dhY4DdEx3wttnxYjnxbBByVpsS8BE"></drupal-render-placeholder> </div> </article> <div class="indented"><article role="article" data-comment-user-id="15" id="comment-321" class="comment js-comment by-node-author clearfix"> <span class="hidden" data-comment-timestamp="1493790545"></span> <footer class="comment__meta"> <article typeof="schema:Person" about="/user/15" class="profile"> </article> <p class="comment__author"><span lang="" about="/user/15" typeof="schema:Person" property="schema:name" datatype="">dhchoi</span></p> <p class="comment__time">작성: 2009.10.14.(Wed) - 22:33</p> <p class="comment__time">수정: 2017.05.03.(Wed) - 14:49</p> <p class="comment__permalink"><a href="/comment/321#comment-321" hreflang="en">Permalink</a></p> <p class="visually-hidden">In reply to <a href="/comment/320#comment-320" class="permalink" rel="bookmark" hreflang="en">추측해 보면</a> by <span lang="" about="/user/69" typeof="schema:Person" property="schema:name" datatype="">wildapple</span></p> </footer> <div class="comment__content"> <h3><a href="/comment/321#comment-321" class="permalink" rel="bookmark" hreflang="en">네.. 맞습니다. </a></h3> <div class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item"><div class="content" style="margin: 0px; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">제가 보고 있는 책들(3권)이 전부 mysql_fetch_array()를 사용하고 있습니다.<br /> 그래서 저는 그게 맞는 줄 알고 책에 있는데로 따라 하고 있습니다. 그런데, 책대로 해도 안됩니다.<br /> 잠시 코드를 봐 주세요. <pre> <code class="language-php">&lt;?php include"db_connect.php"; $query="select * from company where id=$id"; $result=mysql_query($query,$connect); $row = mysql_fetch_array($result); $id = $row[id]; ?&gt;</code></pre> 위와 같이 접속 했습니다. <pre> <code class="language-php">echo "$row[name]"; echo "$row[tel]"; echo "$row[fax]"; echo "$row[address]"; echo "$row[remarks]"; echo "$row[name]"; </code></pre> 위 명령은 정상적으로 다 나옵니다. 공백문자(blank)는 물론 역슬래쉬까지도 잘 나옵니다.<br /> 회사명(&lt;? echo $row[id] ?&gt;) &gt; 여기서는 회사이름이 잘립니다.<br /> <br /> 저의 생각으로는 <pre> <code class="language-php">echo "$row[name]";</code></pre> 가 정상적으로 출력이 된다면 밑에도 정상적으로 출력이 되어야 하는것 같은데 안됩니다. 그래서 더욱 궁금합니다.<br /> 뭐가 잘못되었는지 지적해 주시고 해결 방법을 알려 주시기를 간절히 부탁드립니다.<br /> <br /> 감사합니다. 최 초보드림</div> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=321&amp;1=default&amp;2=en&amp;3=" token="E1T7r4pd3xTNtoTi8qRUi6BzqvMg6X1aurhd-AtgwBU"></drupal-render-placeholder> </div> </article> <div class="indented"><article role="article" data-comment-user-id="69" id="comment-322" class="comment js-comment clearfix"> <span class="hidden" data-comment-timestamp="1493790815"></span> <footer class="comment__meta"> <article typeof="schema:Person" about="/user/69" class="profile"> </article> <p class="comment__author"><span lang="" about="/user/69" typeof="schema:Person" property="schema:name" datatype="">wildapple</span></p> <p class="comment__time">작성: 2009.10.14.(Wed) - 23:20</p> <p class="comment__time">수정: 2017.05.03.(Wed) - 14:53</p> <p class="comment__permalink"><a href="/comment/322#comment-322" hreflang="en">Permalink</a></p> <p class="visually-hidden">In reply to <a href="/comment/321#comment-321" class="permalink" rel="bookmark" hreflang="en">네.. 맞습니다. </a> by <span lang="" about="/user/15" typeof="schema:Person" property="schema:name" datatype="">dhchoi</span></p> </footer> <div class="comment__content"> <h3><a href="/comment/322#comment-322" class="permalink" rel="bookmark" hreflang="en">따옴표를 붙여 주세요</a></h3> <div class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item"><div class="content" style="margin: 0px; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">php와는 상관이 없군요. 저도 잘 몰라서 직접 해봐야지 답이 나오네요^^<br /> &gt; 이 부분에서 value에 "를 붙여 주세요. <pre> <code class="language-php">value="&lt;? echo $row[name]; ?&gt;" </code></pre> * ?&gt;" 앞에 ; 빠진 거 아닌가요? 없어도 되나요?<br /> &nbsp; <pre> <code class="language-php">value="1 2" </code></pre> 여기에서 " 빠지면 value=1 2 가 되니 당연히 1만 나오겠죠.</div> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=322&amp;1=default&amp;2=en&amp;3=" token="pyBW2EJGm5ybbG96VgGmmJ_ecTU8Wyx5XCqFgKEd9fI"></drupal-render-placeholder> </div> </article> <div class="indented"><article role="article" data-comment-user-id="15" id="comment-323" class="comment js-comment by-node-author clearfix"> <span class="hidden" data-comment-timestamp="1493790959"></span> <footer class="comment__meta"> <article typeof="schema:Person" about="/user/15" class="profile"> </article> <p class="comment__author"><span lang="" about="/user/15" typeof="schema:Person" property="schema:name" datatype="">dhchoi</span></p> <p class="comment__time">작성: 2009.10.14.(Wed) - 23:27</p> <p class="comment__time">수정: 2017.05.03.(Wed) - 14:55</p> <p class="comment__permalink"><a href="/comment/323#comment-323" hreflang="en">Permalink</a></p> <p class="visually-hidden">In reply to <a href="/comment/322#comment-322" class="permalink" rel="bookmark" hreflang="en">따옴표를 붙여 주세요</a> by <span lang="" about="/user/69" typeof="schema:Person" property="schema:name" datatype="">wildapple</span></p> </footer> <div class="comment__content"> <h3><a href="/comment/323#comment-323" class="permalink" rel="bookmark" hreflang="en">정말 감사합니다</a></h3> <div class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item"><div class="content" style="margin: 0px; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">이 고마움... 이 감사함... 어떻게 말로 다 표현하리까... 정말 감사합니다. 절 받으시죠.... OZL...<br /> 잘 나옵니다. 이제 드디어 다음 진도를 나갈 수 있게 되었습니다.<br /> 단순히 " 하나에도 울고 웃을 수 있다는 걸 느끼게 됩니다.<br /> <br /> 역시 컴퓨터는 아무나 하는게 아니군요... ;)<br /> 다시 한번 진심으로 감사드립니다.<br /> 최 초보드림</div> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=323&amp;1=default&amp;2=en&amp;3=" token="pjccKWezhN6HwHOcOOyiFO2SR6Ip7Ri5ljYV3zxNayE"></drupal-render-placeholder> </div> </article> <article role="article" data-comment-user-id="15" id="comment-324" class="comment js-comment by-node-author clearfix"> <span class="hidden" data-comment-timestamp="1493791219"></span> <footer class="comment__meta"> <article typeof="schema:Person" about="/user/15" class="profile"> </article> <p class="comment__author"><span lang="" about="/user/15" typeof="schema:Person" property="schema:name" datatype="">dhchoi</span></p> <p class="comment__time">작성: 2009.10.14.(Wed) - 23:29</p> <p class="comment__time">수정: 2017.05.03.(Wed) - 15:00</p> <p class="comment__permalink"><a href="/comment/324#comment-324" hreflang="en">Permalink</a></p> <p class="visually-hidden">In reply to <a href="/comment/322#comment-322" class="permalink" rel="bookmark" hreflang="en">따옴표를 붙여 주세요</a> by <span lang="" about="/user/69" typeof="schema:Person" property="schema:name" datatype="">wildapple</span></p> </footer> <div class="comment__content"> <h3><a href="/comment/324#comment-324" class="permalink" rel="bookmark" hreflang="en">없어도 나옵니다</a></h3> <div class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item"><blockquote> <p>&nbsp;value="&lt;? echo $row[name]; ?&gt;"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * ?&gt;" 앞에 ; 빠진 거 아닌가요? 없어도 되나요?</p> </blockquote> <div class="content" style="margin: 0px; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">써 놓고 보니 이상해서 다시 한번 봤습니다만 ;<br /> 없어도 나옵니다.<br /> 이것도 이상합니다만 결과가 나와서... ㅎㅎㅎ<br /> <br /> 최 초보드림</div> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=324&amp;1=default&amp;2=en&amp;3=" token="3KIc1nrY3j9oCLNlXTWBpWnU6yk4qS2ouXpK-ykewhs"></drupal-render-placeholder> </div> </article> </div></div></div></div></div> </section> Mon, 12 Oct 2009 15:13:00 +0000 dhchoi 132 at https://debianusers.or.kr https://debianusers.or.kr/node/132#comments curses에서 한글 출력하기. https://debianusers.or.kr/node/118 <span property="schema:name" class="field field--name-title field--type-string field--label-hidden">curses에서 한글 출력하기.</span> <div class="field field--name-taxonomy-forums field--type-entity-reference field--label-above"> <div class="field__label">Forums</div> <div class="field__item"><a href="/taxonomy/term/11" hreflang="en">프로그래밍</a></div> </div> <div property="schema:text" class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p><span style="color: rgb(34, 34, 34); font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255);">소스</span></p> <pre> <code class="language-java">#include &lt;ncurses.h&gt; # go.c int main(void) { setlocale(LC_CTYPE,"ko_KR.utf8"); initscr(); printw("안녕하세요."); refresh(); getch(); endwin(); return 0; }</code></pre> <p><br /> 컴파일</p> <pre> <code>localhost:/home/westporch# gcc -o go go.c -lncurses</code></pre> <p><br /> 실행</p> <pre> <code># ./go M-m~C~@M-l~^~PM-l~WM-0M-l~JM-5M-l~]~D M-l~K~\M-l~^~QM-m~UM-)M-k~K~HM-k~KM-$.</code></pre> <p><br /> <span style="color: rgb(34, 34, 34); font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255);">위와같이 한글이 깨져서 출력되네요. @.@<span>&nbsp;</span></span><br /> <a href="http://kldp.org/node/59797" style="margin: 0px; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(0, 102, 153); outline: none; text-decoration: none; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" title="http://kldp.org/node/59797">http://kldp.org/node/59797</a><span style="color: rgb(34, 34, 34); font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255);"><span>&nbsp;</span>위 사이트의 답변을 참고하면<br /> <strong>setlocale(LC_ALL, "ko_KR.utf8");<br /> setlocale(LC_CTYPE, "ko_KR.utf8");</strong><br /> 둘 중에 하나를 추가해주면 된다는데 왜 한글이 깨지는 걸까요?</span></p> </div> <span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">westporch</span></span> <span property="schema:dateCreated" content="2009-07-28T03:09:00+00:00" class="field field--name-created field--type-created field--label-hidden">2009.07.28.(Tue) - 12:09</span> <section class="field field--name-comment-forum field--type-comment field--label-hidden comment-wrapper"> <article role="article" data-comment-user-id="51" id="comment-252" class="comment js-comment clearfix"> <span class="hidden" data-comment-timestamp="1493707935"></span> <footer class="comment__meta"> <article typeof="schema:Person" about="/user/51" class="profile"> </article> <p class="comment__author"><span lang="" about="/user/51" typeof="schema:Person" property="schema:name" datatype="">redneval</span></p> <p class="comment__time">작성: 2009.07.28.(Tue) - 16:46</p> <p class="comment__time">수정: 2017.05.02.(Tue) - 15:52</p> <p class="comment__permalink"><a href="/comment/252#comment-252" hreflang="en">Permalink</a></p> </footer> <div class="comment__content"> <h3><a href="/comment/252#comment-252" class="permalink" rel="bookmark" hreflang="en">답변드립니다</a></h3> <div class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item"><div class="content" style="margin: 0px; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);"><a href="http://kldp.org/node/59797">KLDP 답변</a>에 설명이 잘 돼있네요.<br /> 정리해보면 다음과 같습니다.<br /> <br /> 1. ncursesw 라이브러리 설치</div> <div class="content" style="margin: 0px; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);"> <pre> <code>sudo apt-get install libncursesw5-dev</code></pre> <p>2. setlocale(LC_ALL, "ko_KR.utf8"); 으로 로케일 설정<br /> 3. 소스코드를 UTF-8으로 저장<br /> 4. 컴파일할 때 ncursesw로 링크</p> <pre> <code>gcc -o go go.c -lncursesw</code></pre> <p>&nbsp;</p> </div> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=252&amp;1=default&amp;2=en&amp;3=" token="pFHYS2ButXmoTqaj8U3FKhLmHq5UOJIR8TU5T9LKtOE"></drupal-render-placeholder> </div> </article> <div class="indented"><article role="article" data-comment-user-id="1" id="comment-253" class="comment js-comment by-node-author clearfix"> <span class="hidden" data-comment-timestamp="1493710768"></span> <footer class="comment__meta"> <article typeof="schema:Person" about="/user/1" class="profile"> </article> <p class="comment__author"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">westporch</span></p> <p class="comment__time">작성: 2009.07.28.(Tue) - 17:04</p> <p class="comment__time">수정: 2017.05.02.(Tue) - 16:39</p> <p class="comment__permalink"><a href="/comment/253#comment-253" hreflang="en">Permalink</a></p> <p class="visually-hidden">In reply to <a href="/comment/252#comment-252" class="permalink" rel="bookmark" hreflang="en">답변드립니다</a> by <span lang="" about="/user/51" typeof="schema:Person" property="schema:name" datatype="">redneval</span></p> </footer> <div class="comment__content"> <h3><a href="/comment/253#comment-253" class="permalink" rel="bookmark" hreflang="en">감사해요</a></h3> <div class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item"><div class="content" style="margin: 0px; padding: 0px; border: 0px; font-weight: normal; font-style: normal; font-size: 12px; font-family: &quot;Lucida Grande&quot;, Verdana, Arial, Helvetica, sans-serif; vertical-align: baseline; color: rgb(34, 34, 34); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">컴파일할 때 -lncursesw옵션을 붙여주니 한글이 제대로 출력되네요.<br /> <a href="http://kldp.org/node/59797에">http://kldp.org/node/59797에</a> 있던 내용인데 전체 내용을 제가 소흘히 봤네요..<br /> 답변 감사해요.</div> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=253&amp;1=default&amp;2=en&amp;3=" token="WsXjGO0ed9ttHWprlEMJW2sCIuTQSwaz9cV-FeR1JsI"></drupal-render-placeholder> </div> </article> </div> </section> Tue, 28 Jul 2009 03:09:00 +0000 westporch 118 at https://debianusers.or.kr https://debianusers.or.kr/node/118#comments