#12 [linux] Compiling of SpeedKernel failed

v1.0_(example)
open
nobody
None
1
2014-08-18
2012-10-19
anilatx
No

[...]
Compiling of SpeedKernel failed.
Have a look at 'SpeedKernel/make.log' for the reasons.
~/speedsim-code/QtSim$ cat ../SpeedKernel/make.log
g++ -c -pipe -O0 -g3 -fPIC -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o CIniFile.o CIniFile.cpp
In file included from CIniFile.cpp:21:0:
CIniFile.h:24:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
CIniFile.cpp: In member function ‘genstr CIniFile::GetNextLine(FILE)’:
CIniFile.cpp:152:9: warning: the address of ‘str’ will always evaluate as ‘true’ [-Waddress]
CIniFile.cpp: In member function ‘void CIniFile::SetLong(long int, genstr, genstr, bool)’:
CIniFile.cpp:291:38: error: ‘_snprintf’ was not declared in this scope
In file included from CIniFile.h:35:0,
from CIniFile.cpp:21:
utf8.h: In instantiation of ‘octet_iterator utf8::append(utf8::uint32_t, octet_iterator&) [with octet_iterator = std::back_insert_iterator<std::vector<char> >; utf8::uint32_t = unsigned int]’:
utf8.h:400:13: required from ‘octet_iterator utf8::utf16to8(u16bit_iterator, u16bit_iterator, octet_iterator) [with u16bit_iterator = gnu_cxx::normal_iterator<wchar_t*, std::basic_string<wchar_t=""> >; octet_iterator = std::back_insert_iterator<std::vector<char> >]
CIniFile.cpp:385:72: required from here
utf8.h:307:13: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
utf8.h:312:13: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
utf8.h:313:13: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
make:
** [CIniFile.o] Error 1

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i486-linux-gnu/4.7/lto-wrapper
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.1-7' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --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.7.1 (Debian 4.7.1-7

Discussion

  • anilatx
    anilatx
    2012-10-19

    Source is probably:
    commit a4ddb6a5316118e0ec8f03476067f9fa1c9f9125
    Author: Wiktor Lawski wiktor.lawski@gmail.com
    Date: Sat Sep 22 13:31:35 2012 +0200

    SpeedKernel: Fix VS compilation issue
    
    snprintf function is not available by default (it is deprecated). It is
    possible to use _snprintf function.
    

    I suggest at least:
    $diff CIniFile.h CIniFile.h.org
    55d54
    < #define _snprintf(x1,x2,x3,x4) snprintf(x1,x2,x3,x4)

    It works, but from what I've found in the internet they are not 100% compatible(can differ in null-terminating)

     
    Last edit: anilatx 2012-10-19
  • anilatx
    anilatx
    2013-01-19

    That's my patch proposition to fix gcc behaviour

     
    Attachments