C_C++

pchero on 9월 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 7월 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+0×1081): 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 7월 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 4월 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+0×50)[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

pchero on 2월 23rd, 2011

Unix 는 장비도 다양하고,  버전도 다양하다. HP UX에 관련한 Hardware/OS support 에 관한 리스트는 아래의 링크에서 찾을 수 있다. http://www.hp.com/go/hpuxservermatrix 그리고 다른 HP UX 에 관한 CPU/OS support에 관한 내용은 아래의 링크에서 찾을 수 있다. http://search.cpan.org/~rjbs/perl-5.12.3/README.hpux

Continue reading about HP-UX Hardwar/OS support & CPU/OS support

pchero on 11월 29th, 2010

Invoking autoreconf in build directory: /home/jonathan/workspace/CIOD/CIOD_CTMP/0001.WorkSource_Automake/obsource autoreconf -i Can’t exec “libtoolize”: No such file or directory at /usr/bin/autoreconf line 189.Use of uninitialized value in pattern match (m//) at /usr/bin/autoreconf line 189.autoreconf: `configure.ac’ or `configure.in’ is required Configuration failed with error  eclipse 와 autoconf 연동중.. 위와 같은 오류 발생.  아래의 명령어로 해결.  # sudo apt-get install [...]

Continue reading about autoreconf 에러…

pchero on 10월 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 9월 2nd, 2010

 Linux/Unix 프로그래밍을 하다보면 GCC 버전에 영향을 받는 경우가 있다.  예를 들면 ACE 라이브러리를 컴파일 할 경우, gcc-4.x 대의 버전에는 컴파일 오류가 발생한다.  그래서 부득이 gcc/g++ 을 다시 설치하려고 해도 여의치 않는 경우가 많다. 이럴 경우 다른 배포판을 찾아보게 되는데, 여기에 배포판마다 가지고 있는 gcc의 버전 정보를 싣는다. Distribution Version Compiler version Provided by Date BeOS [...]

Continue reading about 배포판에 설치된 GCC 버전정보

pchero on 8월 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