FellowTraveler / Open-Transactions-old

Open-Transactions democratizes financial and monetary actions. You can use it for issuing currencies/stock, paying dividends, creating asset accounts, sending/receiving digital cash, writing/depositing cheques, cashier's cheques, creating basket currencies, trading on markets, scripting custom agreements, recurring payments, escrow, etc. Open-Transactions uses strong crypto. The balances are unchangeable (even by a malicious server.) The receipt history is destructible. The transactions are unforgeable. The cash is unlinkable. The cheques are non-repudiable. Etc.
http://opentransactions.org
407 stars 84 forks source link

Compilation failed on Linux with G++ 3.8 #192

Closed ovidiusoft closed 11 years ago

ovidiusoft commented 11 years ago

Compiling with G++ 3.8 fails with on src/otlib/OTAsymmetricKey.cpp with:

CXX libot_la-OTAsymmetricKey.lo In file included from ../../include/otlib/stacktrace.h:8:0, from OTAsymmetricKey.cpp:165: /usr/include/c++/4.8.0/cstdlib: In function 'long long int std::abs(long long int)': /usr/include/c++/4.8.0/cstdlib:174:20: error: declaration of C function 'long long int std::abs(long long int)' conflicts with abs(long long x) { return builtin_llabs (x); } ^ /usr/include/c++/4.8.0/cstdlib:166:3: error: previous declaration 'long int std::abs(long int)' here abs(long i) { return builtin_labs(i); } ^ /usr/include/c++/4.8.0/cstdlib: In function 'int128 std::abs(int128)': /usr/include/c++/4.8.0/cstdlib:179:19: error: declaration of C function 'int128 std::abs(int128)' conflicts with abs(int128 x) { return x >= 0 ? x : -x; } ^ /usr/include/c++/4.8.0/cstdlib:174:3: error: previous declaration 'long long int std::abs(long long int)' here abs(long long x) { return builtin_llabs (x); } ^ /usr/include/c++/4.8.0/cstdlib:179:19: error: declaration of C function 'int128 std::abs(int128)' conflicts with abs(int128 x) { return x >= 0 ? x : -x; } ^ /usr/include/c++/4.8.0/cstdlib:166:3: error: previous declaration 'long int std::abs(long int)' here abs(long i) { return __builtin_labs(__i); } ^ make[1]: *\ [libot_la-OTAsymmetricKey.lo] Error 1


The fix is to move #include "stacktrace.h" outside the extern "C":

diff -u OTAsymmetricKey.cpp.bak OTAsymmetricKey.cpp.new
+++ OTAsymmetricKey.cpp.new 2013-05-17 14:39:50.215610468 +0300 @@ -162,11 +162,13 @@

include

endif

-#include "stacktrace.h"

include

}

+#include "stacktrace.h" + +

FellowTraveler commented 11 years ago

Fixed (Thanks!)