[ntl] Greetings - NTL users
sergf
sergf at nyc.rr.com
Sun May 16 20:13:16 CDT 2010
I am a first time poster re: NTL.
I have downloaded the latest NTL and, after much trouble, finally got it
running with Microsoft Visual C++ 2008 using
only a console-based Win32 bare-bones application. I still get numerous
Warnings. It appears that the problems come from
C++ compatibility issues.
However, I am now trying to develop an MFC (Microsoft Foundation Classes)
application which will use the NTL library.
I tried to use the same of similar project settings as the Win32 app, but
nothing worked.
The problem seems to be in: tools.h
The compile errors indicate an undefined type in tools.h
The errors are listed below:
1>Compiling...
1>stdafx.cpp
Compiling...
TestCNPrototype.cpp
\ntl\tools.h(181) : error C2062: type 'int' unexpected
\ntl\tools.h(181) : error C2062: type 'int' unexpected
\ntl\tools.h(181) : error C2059: syntax error : ')'
\ntl\tools.h(182) : error C2062: type 'int' unexpected
\ntl\tools.h(182) : error C2062: type 'int' unexpected
\ntl\tools.h(182) : error C2059: syntax error : ')'
\ntl\tools.h(184) : error C2062: type 'long' unexpected
\ntl\tools.h(184) : error C2062: type 'long' unexpected
\ntl\tools.h(184) : error C2059: syntax error : ')'
\ntl\tools.h(185) : error C2062: type 'long' unexpected
\ntl\tools.h(185) : error C2062: type 'long' unexpected
\ntl\tools.h(185) : error C2059: syntax error : ')'
\ntl\tools.h(187) : error C2062: type 'int' unexpected
\ntl\tools.h(187) : error C2062: type 'long' unexpected
\ntl\tools.h(187) : error C2059: syntax error : ')'
\ntl\tools.h(188) : error C2062: type 'int' unexpected
\ntl\tools.h(188) : error C2062: type 'long' unexpected
\ntl\tools.h(188) : error C2059: syntax error : ')'
\ntl\tools.h(190) : error C2062: type 'long' unexpected
\ntl\tools.h(190) : error C2062: type 'int' unexpected
\ntl\tools.h(190) : error C2059: syntax error : ')'
\ntl\tools.h(191) : error C2062: type 'long' unexpected
\ntl\tools.h(191) : error C2062: type 'int' unexpected
\ntl\tools.h(191) : error C2059: syntax error : ')'
TestCNPrototypeDlg.cpp
\ntl\tools.h(181) : error C2062: type 'int' unexpected
\ntl\tools.h(181) : error C2062: type 'int' unexpected
\ntl\tools.h(181) : error C2059: syntax error : ')'
\ntl\tools.h(182) : error C2062: type 'int' unexpected
\ntl\tools.h(182) : error C2062: type 'int' unexpected
\ntl\tools.h(182) : error C2059: syntax error : ')'
\ntl\tools.h(184) : error C2062: type 'long' unexpected
\ntl\tools.h(184) : error C2062: type 'long' unexpected
\ntl\tools.h(184) : error C2059: syntax error : ')'
\ntl\tools.h(185) : error C2062: type 'long' unexpected
\ntl\tools.h(185) : error C2062: type 'long' unexpected
\ntl\tools.h(185) : error C2059: syntax error : ')'
\ntl\tools.h(187) : error C2062: type 'int' unexpected
\ntl\tools.h(187) : error C2062: type 'long' unexpected
\ntl\tools.h(187) : error C2059: syntax error : ')'
\ntl\tools.h(188) : error C2062: type 'int' unexpected
\ntl\tools.h(188) : error C2062: type 'long' unexpected
\ntl\tools.h(188) : error C2059: syntax error : ')'
\ntl\tools.h(190) : error C2062: type 'long' unexpected
\ntl\tools.h(190) : error C2062: type 'int' unexpected
\ntl\tools.h(190) : error C2059: syntax error : ')'
\ntl\tools.h(191) : error C2062: type 'long' unexpected
\ntl\tools.h(191) : error C2062: type 'int' unexpected
\ntl\tools.h(191) : error C2059: syntax error : ')'
Generating Code...
TestCNPrototype - 48 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
This points to the following NTL_NO_MIN_MAX section in tools.h:
#ifndef NTL_NO_MIN_MAX
inline int min(int a, int b) { return (a < b) ? a : b; }
inline int max(int a, int b) { return (a < b) ? b : a; }
inline long min(long a, long b) { return (a < b) ? a : b; }
inline long max(long a, long b) { return (a < b) ? b : a; }
inline long min(int a, long b) { return (a < b) ? long(a) : b; }
inline long max(int a, long b) { return (a < b) ? b : long(a); }
inline long min(long a, int b) { return (a < b) ? a : long(b); }
inline long max(long a, int b) { return (a < b) ? long(b) : a; }
Any suggestions? Does anyone have NTL working with an MFC application? If
yes, can you let me know your project settings?
Thanks for any help.
Serg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shoup.net/pipermail/ntl_shoup.net/attachments/20100516/b49a91fb/attachment.html>
More information about the ntl
mailing list