Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  09 Oct 2009, Exaos Lee, Bug Report, Building error of history_midas.cxx due to missing declaration build-20091010.log
    Reply  11 Oct 2009, Konstantin Olchanski, Bug Report, Building error of history_midas.cxx due to missing declaration 
Message ID: 658     Entry time: 09 Oct 2009     Reply to this: 659
Author: Exaos Lee 
Topic: Bug Report 
Subject: Building error of history_midas.cxx due to missing declaration 
Platform: Debian Linux testing
Compiler: gcc 4.3.4 (Debian 4.3.4-2)
Arch: x86
Description:
  The "g++" is whining while compiling history_midas.cxx. Please see the attached log file.
This can be fixed by add "#include <cstdlib>" to the C++ source. You know, different versions
of g++ don't act the same way. I think, maybe in version 4.2 or before, g++ can automatically
include the C header "stdlib.h" (which in C++ should be <cstdlib> because of some confusion
between C and C++), but not in version 4.3 or later. I tested g++-4.4, the problem still exists.
And g++-4.2 gives no error.
Attachment 1: build-20091010.log  3 kB  | Hide | Hide all
g++ -c -g -O2 -Wall -Wuninitialized -Iinclude -Idrivers -I../mxml -Llinux/lib -DINCLUDE_FTPLIB   -D_LARGEFILE64_SOURCE -DHAVE_MYSQL -I/usr/include/mysql -DHAVE_ODBC -DHAVE_ZLIB -DOS_LINUX -fPIC -Wno-unused-function -o linux/lib/history_midas.o src/history_midas.cxx
src/history_midas.cxx: In function 'WORD get_variable_id(DWORD, const char*, const char*)':
src/history_midas.cxx:45: error: 'atoi' was not declared in this scope
src/history_midas.cxx:47: warning: comparison between signed and unsigned integer expressions
src/history_midas.cxx:55: error: 'strchr' was not declared in this scope
src/history_midas.cxx:75: error: 'free' was not declared in this scope
src/history_midas.cxx:81: error: 'free' was not declared in this scope
src/history_midas.cxx: In function 'WORD get_variable_id_tags(const char*, const char*)':
src/history_midas.cxx:119: error: 'atoi' was not declared in this scope
src/history_midas.cxx:121: warning: comparison between signed and unsigned integer expressions
src/history_midas.cxx:127: error: 'strchr' was not declared in this scope
src/history_midas.cxx: In function 'void list_add(poor_mans_list*, const char*)':
src/history_midas.cxx:182: error: 'strlen' was not declared in this scope
src/history_midas.cxx:188: error: 'realloc' was not declared in this scope
src/history_midas.cxx:193: error: 'memcpy' was not declared in this scope
src/history_midas.cxx: In member function 'virtual int MidasHistory::hs_connect(const char*)':
src/history_midas.cxx:284: error: 'memset' was not declared in this scope
src/history_midas.cxx: In member function 'int MidasHistory::GetEventsFromOdbEvents(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >*)':
src/history_midas.cxx:471: error: 'strchr' was not declared in this scope
src/history_midas.cxx: In member function 'int MidasHistory::GetEventsFromOdbTags(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >*)':
src/history_midas.cxx:531: error: 'strtoul' was not declared in this scope
src/history_midas.cxx: In member function 'int MidasHistory::GetTagsFromHS(const char*, std::vector<TAG, std::allocator<TAG> >*)':
src/history_midas.cxx:778: error: 'free' was not declared in this scope
src/history_midas.cxx: In member function 'int MidasHistory::GetTagsFromOdb(const char*, std::vector<TAG, std::allocator<TAG> >*)':
src/history_midas.cxx:820: error: 'atoi' was not declared in this scope
src/history_midas.cxx:824: warning: comparison between signed and unsigned integer expressions
src/history_midas.cxx:874: error: 'strchr' was not declared in this scope
src/history_midas.cxx:903: error: 'strchr' was not declared in this scope
src/history_midas.cxx: In member function 'virtual int MidasHistory::hs_read(time_t, time_t, time_t, int, const char**, const char**, const int*, int*, time_t**, double**, int*)':
src/history_midas.cxx:975: error: 'malloc' was not declared in this scope
src/history_midas.cxx:994: error: 'memset' was not declared in this scope
src/history_midas.cxx:1006: error: 'realloc' was not declared in this scope
src/history_midas.cxx:1016: error: 'malloc' was not declared in this scope
src/history_midas.cxx:1070: error: 'free' was not declared in this scope
src/history_midas.cxx:1072: error: 'free' was not declared in this scope
make: *** [linux/lib/history_midas.o] Error 1
ELOG V3.1.4-2e1708b5