Problem building Crypto++ with C++Builder XE5 - EMBARCADERO - RAD Studio 12.0

179 views
Skip to first unread message

Giuseppe Zagari

unread,
Oct 7, 2017, 3:44:46 AM10/7/17
to Crypto++ Users

Hi, 

I need to build Crypto++ with the compiler C++Builder XE5 - EMBARCADERO - RAD Studio 12.0,
but unfortunately I got errors for all 5.6.5, 5.6.4, 5.6.3, 5.6.2 and 5.6.1 versions.

Do you have some hint for solve the problem?

Thanks in advance, GZ

Giuseppe Zagari

unread,
Oct 7, 2017, 4:10:39 AM10/7/17
to Crypto++ Users

Jeffrey Walton

unread,
Oct 7, 2017, 8:00:11 AM10/7/17
to Crypto++ Users


I need to build Crypto++ with the compiler C++Builder XE5 - EMBARCADERO - RAD Studio 12.0,
but unfortunately I got errors for all 5.6.5, 5.6.4, 5.6.3, 5.6.2 and 5.6.1 versions.

Do you have some hint for solve the problem?

Well, its hard to say because we don't know what the errors are.

You might try using Master. A few compile errors were fixed recently. Also see https://github.com/weidai11/cryptopp/issues?q=is%3Aissue%20label%3Aborland%20

Jeff

Giuseppe Zagari

unread,
Oct 11, 2017, 3:04:18 AM10/11/17
to Crypto++ Users

nbtheory.cpp(1026,90): error E2268: E2268 Call to undefined function 'log'
nbtheory.cpp(1033,90): error E2268: E2268 Call to undefined function 'log' 

  fixed by addinb std::log

[bcc32 Fatal Error] adhoc.cpp(1): F1009 Unable to open input file 'adhoc.cpp'
   
   fixed by excluding from the build

finally I got the .lib 
[TLIB Warning] Warning: library was too large for page size, rebuilt with page size 1024

But I got a lot of errors when I build the .exe

[bcc32 Error] bench1.cpp(64): E2268 Call to undefined function 'log'
[bcc32 Error] bench1.cpp(100): E2268 Call to undefined function 'log'
[bcc32 Warning] bench1.cpp(407): W8012 Comparing signed and unsigned values
[bcc32 Error] factory.h(104): E2040 Declaration terminated incorrectly
[bcc32 Error] factory.h(105): E2451 Undefined symbol 's_registry'
[bcc32 Error] factory.h(105): E2357 Reference initialized with 'undefined', needs lvalue of type 'ObjectFactoryRegistry<RandomNumberGenerator,0>'
[bcc32 Error] factory.h(104): E2040 Declaration terminated incorrectly
[bcc32 Error] factory.h(105): E2451 Undefined symbol 's_registry'
[bcc32 Error] factory.h(105): E2357 Reference initialized with 'undefined', needs lvalue of type 'ObjectFactoryRegistry<NIST_DRBG,0>'
[bcc32 Error] factory.h(104): E2040 Declaration terminated incorrectly
[bcc32 Error] factory.h(105): E2451 Undefined symbol 's_registry'
[bcc32 Error] factory.h(105): E2357 Reference initialized with 'undefined', needs lvalue of type 'ObjectFactoryRegistry<HashTransformation,0>'
[bcc32 Error] factory.h(104): E2040 Declaration terminated incorrectly
[bcc32 Error] factory.h(105): E2451 Undefined symbol 's_registry'
[bcc32 Error] factory.h(105): E2357 Reference initialized with 'undefined', needs lvalue of type 'ObjectFactoryRegistry<AuthenticatedSymmetricCipher,0>'
[bcc32 Error] factory.h(104): E2040 Declaration terminated incorrectly
[bcc32 Error] factory.h(105): E2451 Undefined symbol 's_registry'
[bcc32 Error] factory.h(105): E2357 Reference initialized with 'undefined', needs lvalue of type 'ObjectFactoryRegistry<MessageAuthenticationCode,0>'
[bcc32 Error] factory.h(104): E2040 Declaration terminated incorrectly
[bcc32 Error] factory.h(105): E2451 Undefined symbol 's_registry'
[bcc32 Error] factory.h(105): E2357 Reference initialized with 'undefined', needs lvalue of type 'ObjectFactoryRegistry<SymmetricCipher,0>'

Thank you in advance.
GZ








Jeffrey Walton

unread,
Oct 12, 2017, 1:21:54 PM10/12/17
to Crypto++ Users
> nbtheory.cpp(1026,90): error E2268: E2268 Call to undefined function 'log'
> nbtheory.cpp(1033,90): error E2268: E2268 Call to undefined function 'log'

<math.h> and <cmath> can be tricky. What I have found is, as soon as we change to std::log, then another compiler breaks. In fact, we were trying to use std::log but early Borland compilers had trouble with it.

I'm thinking maybe we need something like:

  #ifdef __BORLANDC__
    using std::log
  #endif



> [bcc32 Error] bench1.cpp(64): E2268 Call to undefined function 'log'
> [bcc32 Error] bench1.cpp(100): E2268 Call to undefined function 'log'

These sound like we are missing an include. Looking at bench1.cpp (https://github.com/weidai11/cryptopp/blob/master/bench1.cpp) we _don't_ include our "stdcpp.h" or <math.h> or <cmath>.



> [bcc32 Error] factory.h(105): E2451 Undefined symbol 's_registry'
> [bcc32 Error] factory.h(105): E2357 Reference initialized with 'undefined', needs lvalue of type 'ObjectFactoryRegistry<RandomNumberGenerator,0>'

What I've found with this one is, inlining make s_registry go missing.

Or sometimes, there are different copies of s_registry under the As-If rule. One copy will register some algorithms, the other copy will register other algorithms, and you will get an occasional exception about "no object factory found".

Usually I try to stop inlining like in https://github.com/weidai11/cryptopp/blob/master/config.h#L648 .

Jeff

Jeffrey Walton

unread,
Oct 12, 2017, 1:42:57 PM10/12/17
to Crypto++ Users


On Thursday, October 12, 2017 at 1:21:54 PM UTC-4, Jeffrey Walton wrote:
> nbtheory.cpp(1026,90): error E2268: E2268 Call to undefined function 'log'
> nbtheory.cpp(1033,90): error E2268: E2268 Call to undefined function 'log'

<math.h> and <cmath> can be tricky. What I have found is, as soon as we change to std::log, then another compiler breaks. In fact, we were trying to use std::log but early Borland compilers had trouble with it.

I'm thinking maybe we need something like:

  #ifdef __BORLANDC__
    using std::log
  #endif


> [bcc32 Error] bench1.cpp(64): E2268 Call to undefined function 'log'
> [bcc32 Error] bench1.cpp(100): E2268 Call to undefined function 'log'

These sound like we are missing an include. Looking at bench1.cpp (https://github.com/weidai11/cryptopp/blob/master/bench1.cpp) we _don't_ include our "stdcpp.h" or <math.h> or <cmath>.


> [bcc32 Error] factory.h(105): E2451 Undefined symbol 's_registry'
> [bcc32 Error] factory.h(105): E2357 Reference initialized with 'undefined', needs lvalue of type 'ObjectFactoryRegistry<RandomNumberGenerator,0>'

What I've found with this one is, inlining make s_registry go missing.

Or sometimes, there are different copies of s_registry under the As-If rule. One copy will register some algorithms, the other copy will register other algorithms, and you will get an occasional exception about "no object factory found".

Usually I try to stop inlining like in https://github.com/weidai11/cryptopp/blob/master/config.h#L648 .


We need the issue because we will probably break another compiler when making the changes. The change control item will (at least) allow us to refer to something.

Jeff

Jeffrey Walton

unread,
Oct 12, 2017, 10:34:36 PM10/12/17
to Crypto++ Users


On Wednesday, October 11, 2017 at 3:04:18 AM UTC-4, Giuseppe Zagari wrote:

nbtheory.cpp(1026,90): error E2268: E2268 Call to undefined function 'log'
nbtheory.cpp(1033,90): error E2268: E2268 Call to undefined function 'log' 

  fixed by addinb std::log

[bcc32 Fatal Error] adhoc.cpp(1): F1009 Unable to open input file 'adhoc.cpp'
   
   fixed by excluding from the build

finally I got the .lib 
[TLIB Warning] Warning: library was too large for page size, rebuilt with page size 1024

But I got a lot of errors when I build the .exe

[bcc32 Error] bench1.cpp(64): E2268 Call to undefined function 'log'
[bcc32 Error] bench1.cpp(100): E2268 Call to undefined function 'log'

GZ,


It tested good under GCC 4.1, GCC 7.2, MSVC, SunCC on Solaris and IBM XL/C on AIX.

Jeff
Reply all
Reply to author
Forward
0 new messages