JackieXie168 / logkeys

Automatically exported from code.google.com/p/logkeys
Other
0 stars 0 forks source link

Compiling problem - g++ doesn't recognize 0bXXXX binary notation #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compiling

cd build
../configure
make

imerelli@rambo:~/logkeys-0.1.1a/build$ make
make  all-recursive
make[1]: Entering directory `/ldaphome/imerelli/logkeys-0.1.1a/build'
Making all in src
make[2]: Entering directory `/ldaphome/imerelli/logkeys-0.1.1a/build/src'
g++ -DHAVE_CONFIG_H -I. -I../../src -I..     -Wall -O3 
-DSYS_CONF_DIR=\"/usr/local/etc\" -MT logkeys.o -MD -MP -MF .deps/logkeys.Tpo 
-c -o logkeys.o ../../src/logkeys.cc
In file included from ../../src/logkeys.cc:58:
../../src/args.cc:49:50: error: invalid suffix "b1" on integer constant
../../src/args.cc:50:50: error: invalid suffix "b10" on integer constant
../../src/args.cc:51:50: error: invalid suffix "b100" on integer constant
../../src/args.cc:52:50: error: invalid suffix "b1000" on integer constant
../../src/args.cc:53:50: error: invalid suffix "b10000" on integer constant
../../src/args.cc:54:50: error: invalid suffix "b100000" on integer constant
../../src/args.cc:76:16: error: invalid suffix "b1" on integer constant
../../src/args.cc:78:16: error: invalid suffix "b1000" on integer constant
../../src/args.cc:84:16: error: invalid suffix "b10000" on integer constant
../../src/args.cc:98:16: error: invalid suffix "b100000" on integer constant
../../src/logkeys.cc:370:37: error: invalid suffix "b1" on integer constant
../../src/logkeys.cc:384:51: error: invalid suffix "b1" on integer constant
../../src/logkeys.cc:388:61: error: invalid suffix "b1" on integer constant
../../src/logkeys.cc:393:23: error: invalid suffix "b1" on integer constant
../../src/logkeys.cc:459:20: error: invalid suffix "b100" on integer constant
../../src/logkeys.cc:523:27: error: invalid suffix "b10" on integer constant
../../src/logkeys.cc:537:26: error: invalid suffix "b100" on integer constant
../../src/logkeys.cc:577:28: error: invalid suffix "b10" on integer constant
make[2]: *** [logkeys.o] Error 1
make[2]: Leaving directory `/ldaphome/imerelli/logkeys-0.1.1a/build/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/ldaphome/imerelli/logkeys-0.1.1a/build'
make: *** [all] Error 2

What version of the product are you using (`logkeys --help`)?

logkeys-0.1.1a

On what operating system?

Ubuntu 8.04

Original issue reported on code.google.com by ivan.mer...@gmail.com on 13 Jul 2010 at 7:19

GoogleCodeExporter commented 9 years ago
Hi,

It seems Ubuntu 8.04 came with too old g++ compiler, which does not yet 
recognize 0bXXXX as static binary notation (compared to 0xXXXX hexadecimal, 
which it does).

To solve your problem, you should either update your Ubuntu: latest stable is 
Ubuntu 10.04 (Lucid Lynx) ← recommended ;)

If that is not an option, you can open src/args.cc and starting on line 28
http://code.google.com/p/logkeys/source/browse/trunk/src/args.cc?r=43#28
you should see these binary definitions, which you should change to hexadecimal 
in the following manner:
0b1      → 0x1
0b10     → 0x2
0b100    → 0x4
0b1000   → 0x8
0b10000  → 0x10
0b100000 → 0x20
(fixed: 
http://code.google.com/p/logkeys/source/browse/trunk/src/args.cc?r=67#28)
Then, I belive, it should compile fine.

I have already fixed it in the repository (r67), so the fix will become common 
with the next release.

Thanks for the report!

Original comment by kernc...@gmail.com on 13 Jul 2010 at 3:39

GoogleCodeExporter commented 9 years ago
Issue 39 has been merged into this issue.

Original comment by kernc...@gmail.com on 12 Aug 2010 at 7:41

GoogleCodeExporter commented 9 years ago
cool... when will the next release be out? 
thanks!!

Original comment by jove...@gmail.com on 13 Aug 2010 at 6:03

GoogleCodeExporter commented 9 years ago
managed to fix it by doing the suggested changes.. works fine now!

Original comment by jove...@gmail.com on 13 Aug 2010 at 4:51

GoogleCodeExporter commented 9 years ago
Issue 52 has been merged into this issue.

Original comment by kernc...@gmail.com on 18 Jan 2011 at 2:14