Programming

pchero on September 30th, 2011

‘__FILE__ ‘, __LINE__’ 이란 무엇인가? 로그 라이브러리를 분석하던 중, __FILE__ 과 __LINE__ 이라는 구문을 발견하고 의문을 가져 내용을 찾아보았다. 아래의 주소에서 내용을 확인할 수 있었다. http://www.codeguru.com/forum/showthread.php?t=231043 정답은 __FILE__ 과 __LINE__ 은 전처리기(Preprocessor) 에서 지정해주는 매크로라는 것. __FILE__ 의 경우 현재 __FILE__ macro 를 사용한 파일의 이름을 나타내주고 __LINE__ 의 경우 현재 __LINE__ macro 를 사용한 […]

Continue reading about What is ‘__FILE__’ and ‘__LINE__’?

pchero on July 26th, 2011

  사내에서 개발중인 제품을 테스트하기 위해 컴파일을 하던 도중, 아래의 오류를 발견했다. mysqlclient 라이브러리를 함께 사용하는 부분이 있었는데, Linking 을 하던 도중 에러가 발생한 것이다. /usr/lib/mysql/libmysqlclient.a(client.o): In function `mysql_close_free_options’: (.text+0xd7d): undefined reference to `SSL_CTX_free’ /usr/lib/mysql/libmysqlclient.a(client.o): In function `mysql_get_ssl_cipher’: (.text+0x1081): undefined reference to `SSL_get_current_cipher’ /usr/lib/mysql/libmysqlclient.a(client.o): In function `mysql_real_connect’: (.text+0x3a4c): undefined reference to `SSL_get_peer_certificate’ /usr/lib/mysql/libmysqlclient.a(client.o): In function […]

Continue reading about undefined reference to `SSL_CTX_free’

pchero on July 25th, 2011

  Stack Overflow 에서 상당히 유용한 스레드를 발견하여 이곳에 싣는다. 내용은 멀티 스레드 환경에서 네트워크 프로그램을 디버그 할 때 어떻게 gdb를 사용하는가? 이다.   Enable core dump saving in your environment. Run command ulimit -c unlimited and rerun your program. When it crashes, load generated core dump in gdb and look backtraces of crash. In […]

Continue reading about How to use gdb in Multi Threaded Network Program

pchero on April 13th, 2011

프로그램 TEST 중 아래와 같은 오류가 발생했다. 결과는 Core dump. jonathan@jonathan-laptop:~/workspace/TEST$ ./TEST *** stack smashing detected ***: ./TEST terminated ======= Backtrace: ========= /lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x50)[0xb775c390] /lib/tls/i686/cmov/libc.so.6(+0xe233a)[0xb775c33a] ./TEST[0x804a2f4] ./TEST[0x8049189] ./TEST[0x8049258] ./TEST[0x8049205] /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0xb7690bd6] ./TEST[0x8049081] ======= Memory map: ======== 08048000-0804f000 r-xp 00000000 08:05 7344439    /home/jonathan/workspace/TEST/TEST 0804f000-08050000 r–p 00007000 08:05 7344439    /home/jonathan/workspace/TEST/TEST 08050000-08051000 rw-p 00008000 08:05 7344439    /home/jonathan/workspace/TEST/TEST 08051000-080fd000 rw-p 00000000 […]

Continue reading about stack smashing detected

HP 장비에서 aCC 로 컴파일을 하던도중 아래의 에러가 발생했다. “/opt/aCC/include_std/utility”, line 99: error #2070: incomplete type is not allowed first_type  first; ^ detected during: instantiation of class “std::pair<_TypeT, _TypeU> [with _TypeT=const std::string, _TypeU=char *]” at line 97 of “/opt/aCC/include_std/rw/tree” instantiation of class “__rw::__rw_rb_tree_node<_Alloc, _Val, _Key, _KeyOf> [with _Alloc=std::allocator<std::pair<const std::string, char *>>, _Val=std::pair<const std::string, char *>, […]

Continue reading about “/opt/aCC/include_std/utility”, line 99: error #2070: incomplete type is not allowed