MikaTake / xbt

xbt
0 stars 0 forks source link

Errors while installing on FreeBSD 9.0 #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Working command line in make.sh:
g++ $@ -DNDEBUG -I ../misc -I . -O3 -o xbt_tracker -I /usr/local/include 
-std=c++0x \

Tried 48(latest) and 44 versions of gcc, got this thing on gcc48:

# ./make.sh
cc1plus: error: unrecognized command line option "-std=c++0x"
cc1plus: error: unrecognized command line option "-std=c++0x"
cc1plus: error: unrecognized command line option "-std=c++0x"
cc1plus: error: unrecognized command line option "-std=c++0x"
cc1plus: error: unrecognized command line option "-std=c++0x"
cc1plus: error: unrecognized command line option "-std=c++0x"
cc1plus: error: unrecognized command line option "-std=c++0x"
cc1plus: error: unrecognized command line option "-std=c++0x"
cc1plus: error: unrecognized command line option "-std=c++0x"
cc1plus: error: unrecognized command line option "-std=c++0x"
cc1plus: error: unrecognized command line option "-std=c++0x"
cc1plus: error: unrecognized command line option "-std=c++0x"
cc1plus: error: unrecognized command line option "-std=c++0x"
cc1plus: error: unrecognized command line option "-std=c++0x"
cc1plus: error: unrecognized command line option "-std=c++0x"
cc1plus: error: unrecognized command line option "-std=c++0x"
cc1plus: error: unrecognized command line option "-std=c++0x"

When edited line to use gcc44, got that:

# ./make.sh
../misc/bvalue.cpp: In member function 'int Cbvalue::write(const char*&, const 
char*)':
../misc/bvalue.cpp:166: error: 'atoll' was not declared in this scope
tracker_input.cpp: In member function 'void Ctracker_input::set(const 
std::string&, const std::string&)':
tracker_input.cpp:28: error: 'atoll' was not declared in this scope
tracker_input.cpp:54: error: 'atoll' was not declared in this scope
tracker_input.cpp:68: error: 'atoll' was not declared in this scope

Original issue reported on code.google.com by duelis...@gmail.com on 24 Apr 2012 at 11:19

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
here we go =(

# ./make.sh
../misc/sql/sql_query.cpp:21:26: warning: using the result of an assignment as 
a condition without
      parentheses [-Wparentheses]
        for (size_t i = 0, j; j = v.find('@', i); )
                              ~~^~~~~~~~~~~~~~~~
../misc/sql/sql_query.cpp:21:26: note: place parentheses around the assignment 
to silence this
      warning
        for (size_t i = 0, j; j = v.find('@', i); )
                                ^
                              (                 )
../misc/sql/sql_query.cpp:21:26: note: use '==' to turn this assignment into an 
equality comparison
        for (size_t i = 0, j; j = v.find('@', i); )
                                ^
                                ==
1 warning generated.
In file included from ../misc/bvalue.cpp:1:
./stdafx.h:6:10: fatal error: 'array' file not found
#include <array>
         ^
1 error generated.

Original comment by duelis...@gmail.com on 27 Apr 2012 at 5:36

GoogleCodeExporter commented 9 years ago
Did you enable C++11 mode?

Original comment by olafvdspek on 27 Apr 2012 at 7:12

GoogleCodeExporter commented 9 years ago
http://www.freebsd.org/doc/en_US.ISO8859-1/articles/custom-gcc/article.html

RU: http://www.freebsd.org/doc/ru/articles/custom-gcc/article.html

g++44 $@ -DNDEBUG -I ../misc -I . -O3 -o xbt_tracker -I /usr/local/include 
-std=c++0x \

Error:

./make.sh
../misc/bvalue.cpp: In member function 'int Cbvalue::write(const char*&, const 
char*)':
../misc/bvalue.cpp:166: error: 'atoll' was not declared in this scope
server.cpp: In member function 'int Cserver::run()':
server.cpp:180: error: 't_udp_sockets' has not been declared
server.cpp:180: error: expected ';' before 'i'
server.cpp:182: error: 'i' was not declared in this scope
tracker_input.cpp: In member function 'void Ctracker_input::set(const 
std::string&, const std::string&)':
tracker_input.cpp:28: error: 'atoll' was not declared in this scope
tracker_input.cpp:54: error: 'atoll' was not declared in this scope
tracker_input.cpp:68: error: 'atoll' was not declared in this scope

Original comment by M.Sergi...@gmail.com on 27 Apr 2012 at 9:55

GoogleCodeExporter commented 9 years ago
What revision of misc and Tracker dirs is this?

Original comment by olafvdspek on 27 Apr 2012 at 10:18

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
r2289

../misc/bvalue.cpp: In member function 'int Cbvalue::write(const char*&, const 
char*)':
../misc/bvalue.cpp:166: error: 'atoll' was not declared in this scope
tracker_input.cpp: In member function 'void Ctracker_input::set(const 
std::string&, const std::string&)':
tracker_input.cpp:28: error: 'atoll' was not declared in this scope
tracker_input.cpp:54: error: 'atoll' was not declared in this scope
tracker_input.cpp:68: error: 'atoll' was not declared in this scope

Original comment by M.Sergi...@gmail.com on 28 Apr 2012 at 5:25

GoogleCodeExporter commented 9 years ago
In what header is atoll declared on your platform?

Original comment by olafvdspek on 28 Apr 2012 at 2:44

GoogleCodeExporter commented 9 years ago
r2293

g++48 $@ -DNDEBUG -I ../misc -I . -O3 -o xbt_tracker -I /usr/local/include 
-std=c++0x \

# ./make.sh
tracker_input.cpp: In member function 'void Ctracker_input::set(const string&, 
const string&)':
tracker_input.cpp:28:38: error: 'atoll' was not declared in this scope
tracker_input.cpp:54:32: error: 'atoll' was not declared in this scope
tracker_input.cpp:68:36: error: 'atoll' was not declared in this scope

help please...

Original comment by M.Sergi...@gmail.com on 30 Apr 2012 at 8:52

GoogleCodeExporter commented 9 years ago
In what header is atoll declared on your platform?

Original comment by olafvdspek on 30 Apr 2012 at 10:44

GoogleCodeExporter commented 9 years ago
stdlib.h

Original comment by M.Sergi...@gmail.com on 30 Apr 2012 at 11:03

GoogleCodeExporter commented 9 years ago
Try to add #include <cstdlib> to stdafx.h

Original comment by olafvdspek on 30 Apr 2012 at 11:04

GoogleCodeExporter commented 9 years ago
#include <cstdlib>

or

#include <stdlib.h>

did not help

Original comment by M.Sergi...@gmail.com on 30 Apr 2012 at 11:15

GoogleCodeExporter commented 9 years ago
So atoll is *not* declared in stdlib.h?
In that case you'll have to find the right header.

Original comment by olafvdspek on 30 Apr 2012 at 12:20

GoogleCodeExporter commented 9 years ago
r2303

g++48 $@ -DNDEBUG -I ../misc -I . -O3 -o xbt_tracker -I /usr/local/include 
-std=c++0x \

# ./make.sh
tracker_input.cpp: In member function 'void Ctracker_input::set(const string&, 
const string&)':
tracker_input.cpp:28:38: error: 'atoll' was not declared in this scope
    m_downloaded = atoll(value.c_str());
                                      ^
tracker_input.cpp:54:32: error: 'atoll' was not declared in this scope
    m_left = atoll(value.c_str());
                                ^
tracker_input.cpp:68:36: error: 'atoll' was not declared in this scope
    m_uploaded = atoll(value.c_str());
                                    ^

Original comment by M.Sergi...@gmail.com on 2 May 2012 at 5:32

GoogleCodeExporter commented 9 years ago
Found the right header yet?

Original comment by olafvdspek on 2 May 2012 at 5:34

GoogleCodeExporter commented 9 years ago
http://en.cppreference.com/w/cpp/string/byte/atoi

long long atoll( const char *str ); (since C++11)

Original comment by M.Sergi...@gmail.com on 2 May 2012 at 5:44

GoogleCodeExporter commented 9 years ago
I have tried various connection options, different versions of g++(4.4 - 4.6 - 
4.8)

all write that the atoll is registered in stdlib.h, and are placed it in:
/usr/include/
and
/usr/local/lib/gcc44/include/c++/tr1
and
/usr/local/lib/gcc44/gcc/x86_64-portbld-freebsd8.2/4.4.7/include-fixed
and
/usr/ports/lang/gcc44/work/build/gcc/include-fixed 
and
/usr/ports/lang/gcc48/work/build/gcc/include-fixed 
and
/usr/ports/lang/gcc46/work/build/gcc/include-fixed

I have no idea what to do and how to compile in the xbt freebsd :(

Original comment by M.Sergi...@gmail.com on 2 May 2012 at 7:50

GoogleCodeExporter commented 9 years ago
If you give me shell access I'll have a look.

Original comment by olafvdspek on 2 May 2012 at 7:56

GoogleCodeExporter commented 9 years ago

Original comment by olafvdspek on 3 May 2012 at 9:18

GoogleCodeExporter commented 9 years ago
may be replace atoll to my_atoll? ))

long long my_atoll(char *instr)
{
  long long retval;
  int i;

  retval = 0;
  for (; *instr; instr++) {
    retval = 10*retval + (*instr - '0');
  }
  return retval;
}

Original comment by M.Sergi...@gmail.com on 6 May 2012 at 8:20

GoogleCodeExporter commented 9 years ago
Why? You should just fix your platform.

Original comment by olafvdspek on 6 May 2012 at 9:59

GoogleCodeExporter commented 9 years ago
# ./make.sh
In file included from connection.cpp:5:0:
stdafx.h:3:0: warning: "FD_SETSIZE" redefined [enabled by default]
 #define FD_SETSIZE 1024
 ^
In file included from 
/usr/local/lib/gcc48/gcc/x86_64-portbld-freebsd9.0/4.8.1/include-fixed/sys/types
.h:287:0,
                 from connection.cpp:2:
/usr/include/sys/select.h:59:0: note: this is the location of the previous 
definition
 #define FD_SETSIZE 1024U
 ^
In file included from server.cpp:4:0:
stdafx.h:3:0: warning: "FD_SETSIZE" redefined [enabled by default]
 #define FD_SETSIZE 1024
 ^
In file included from 
/usr/local/lib/gcc48/gcc/x86_64-portbld-freebsd9.0/4.8.1/include-fixed/sys/types
.h:287:0,
                 from server.cpp:1:
/usr/include/sys/select.h:59:0: note: this is the location of the previous 
definition
 #define FD_SETSIZE 1024U
 ^

# uname -a
FreeBSD torrents.berislav.net.ua 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Fri Nov  2 
15:44:15 EET 2012     user@torrents.berislav.net.ua:/usr/obj/usr/src/sys/CS  
amd64

Original comment by M.Sergi...@gmail.com on 9 Jun 2013 at 7:41