C

pchero on July 27th, 2011

  mysql 라이브러리를 이용한 MySQL C 프로그램에서 이상한 로그를 발견했다.   mysql_query()  함수 결과를 수행한 결과값이 1이 나왔던 것. mysql_query() 에 관한 명세는 다음 링크에서 찾을 수 있었다. http://dev.mysql.com/doc/refman/5.0/en/mysql-query.html   이 중, Return Value와 관계있는 항목을 아래에 나타내었다. Return Values Zero if the statement was successful. Nonzero if an error occurred. 정상일 경우 0, 실패일 […]

Continue reading about mysql_query() return 1

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 October 4th, 2010

 /usr/include/features.h 파일에는 컴파일 할 때 사용하는 -D 옵션과 긴밀한 관계가 있다.  어떤 Define을 하느냐에 따라 각기 다른 내용의 컴파일과 링크가 이루어 진다.  그 내용을 /usr/include/features.h 파일의 전문을 여기에 싣는다. /* Copyright (C) 1991-1993,1995-2006,2007,2009 Free Software Foundation, Inc.   This file is part of the GNU C Library.    The GNU C Library is free software; you […]

Continue reading about /usr/include/features.h

pchero on August 24th, 2010

 예제 프로그램을 컴파일 하려던 중 아래의 에러 메시지를 만났다. Formatter.cpp:45: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x Formatter.cpp:45: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x  문제의 발단은 다음의 문구였다. pthread_mutex_t dateLock = PTHREAD_MUTEX_INITIALIZER  mutex 초기화를 위한 매크로 함수 PTHREAD_MUTEX_INITIALIZER 를 사용하기 위해서는 -std=c++0x 를 함께 사용하라는 메시지이다.  즉, 문제 […]

Continue reading about -std=c++0x -std=gnu++0x