打扰:谁能解决Error directive: unknown compiler问题?请速回!

maxent 2007-04-07 04:31:40
在网上下了maxent的工具包,在Borland5.5和STLPort4.5.3的环境下调了一个星期,到最后碰到了最大的一个拦路虎,即Error directive: unknown compiler错误!
在maxent原代码中有hash_map.hpp和ext_algorithm.hpp 两个文件!在执行make时出现如下错误:
...failed C++ src\trainer.obj ...
C++ src\gistrainer.obj
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
src\gistrainer.cpp:
Fatal F1003 src\ext_algorithm.hpp 87: Error directive: unknown compiler
*** 1 errors in Compile ***
//***********************************************************************//******************************************************************
...failed C++ src\gistrainer.obj ...
C++ src\maxentmodel.obj
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
src\maxentmodel.cpp:
Fatal F1003 src\hash_map.hpp 101: Error directive: unknown compiler
*** 1 errors in Compile ***
该如何解决?望各位大虾指点,感激不尽!
...全文
2173 13 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
maxent 2007-04-10
  • 打赏
  • 举报
回复
我重新修改了bcc32.cfg,去遇到了以上问题,请大侠指点如何解决!再此保证:原代码没有问题,我想可能是STLPORT和BOOST的配置有问题,希望高人赐教!
maxent 2007-04-10
  • 打赏
  • 举报
回复
I think it is the result of the namespaces’ confusion between std
and STL. And I tried to modify the contents of bcc32.cfg and ilink32.cfg.
The contents are listed as follows.

·bcc32.cfg
-I"D:\STLport\stlport";"D:\Borland\BCC55\Include";"D:\boost";
-L"D:\Borland\BCC55\Lib";"D:\STLport\lib";"D:\boost";
·ilink32.cfg
-L"D:\Borland\BCC55\Lib";"D:\STLport\lib";"D:\boost";

But compiler were not successful, following with two errors:

Building with Borland C++ Tool Chain
[Warning] Fortran compiler not available, LBFGS module will not be
built.
...found 328 target(s)...
...updating 4 target(s)...
C++ src\trainer.obj
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
src\trainer.cpp:
Error E2439 src\itemmap.hpp 107: 'typename' is only allowed in
template declarations
*** 1 errors in Compile ***

bcc32 -c -osrc\trainer.obj -w- -tWC -DWIN32 -DHAVE_CONFIG_H -DNDEBUG
-DBOOST_DISABLE_THREADS -DBOOST_DISABLE_ASSERTS -O2 -6 -DNDEBUG /Isrc
/I. /Ilib src\trainer.cpp

...failed C++ src\trainer.obj ...
C++ src\maxentmodel.obj
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
src\maxentmodel.cpp:
Error E2439 src\itemmap.hpp 107: 'typename' is only allowed in
template declarations
*** 1 errors in Compile ***

bcc32 -c -osrc\maxentmodel.obj -w- -tWC -DWIN32 -DHAVE_CONFIG_H
-DNDEBUG -DBOOST_DISABLE_THREADS -DBOOST_DISABLE_ASSERTS -O2 -6 -DNDEBUG
/Isrc /I. /Ilib src\maxentmodel.cpp

...failed C++ src\maxentmodel.obj ...
...skipped libmaxent.lib for lack of <src>trainer.obj...
...skipped maxent.exe for lack of libmaxent.lib...
...failed updating 2 target(s)...
...skipped 2 target(s)...
liuyaoyou 2007-04-09
  • 打赏
  • 举报
回复
帮顶。
daily66 2007-04-08
  • 打赏
  • 举报
回复
你仔细检查一下头文件和CPP文件是否对照,
maxent 2007-04-08
  • 打赏
  • 举报
回复
在该代码包所带的pdf 文档中明确指出,环境可为:borland c++ 5.5和STLport 4.5.3
daily66 2007-04-08
  • 打赏
  • 举报
回复
好像是少包含哪个文件了,只是猜测而已
maxent 2007-04-08
  • 打赏
  • 举报
回复
bcc32 -c -osrc\trainer.obj -w- -tWC -DWIN32 -DHAVE_CONFIG_H -DNDEBUG -DBOOST_DISABLE_THREADS -DBOOST_DISABLE_ASSERTS -O2 -6 -DNDEBUG /Isrc /I. /Ilib src\trainer.cpp

...failed C++ src\trainer.obj ...
C++ src\gistrainer.obj
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
src\gistrainer.cpp:
Error E2316 D:\Borland\BCC55\Include\stdlib.h 505: '_argc' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\stdlib.h 505: Identifier expected
Error E2316 D:\Borland\BCC55\Include\stdlib.h 506: '_argv' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\stdlib.h 506: Identifier expected
Error E2316 D:\Borland\BCC55\Include\stdlib.h 511: '_doserrno' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\stdlib.h 511: Identifier expected
Error E2316 D:\Borland\BCC55\Include\stdlib.h 512: 'errno' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\stdlib.h 512: Identifier expected
Error E2316 D:\Borland\BCC55\Include\stdlib.h 514: '__mb_cur_max' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\stdlib.h 514: Identifier expected
Error E2316 D:\Borland\BCC55\Include\stdlib.h 516: '_ecvt' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\stdlib.h 516: Identifier expected
Error E2316 D:\Borland\BCC55\Include\stdlib.h 517: '_atold' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\stdlib.h 517: Identifier expected
Error E2316 D:\Borland\BCC55\Include\stdlib.h 518: '_cmdline_escapes' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\stdlib.h 518: Identifier expected
Error E2316 D:\Borland\BCC55\Include\stdlib.h 519: '_environ' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\stdlib.h 519: Identifier expected
Error E2316 D:\Borland\BCC55\Include\stdlib.h 520: '_exit' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\stdlib.h 520: Identifier expected
Error E2316 D:\Borland\BCC55\Include\stdlib.h 521: '_fileinfo' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\stdlib.h 521: Identifier expected
Error E2316 D:\Borland\BCC55\Include\stdlib.h 522: '_fmode' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\stdlib.h 522: Identifier expected
Error E2316 D:\Borland\BCC55\Include\stdlib.h 523: '_fullpath' is not a member of '_STL'
Error E2228 D:\Borland\BCC55\Include\stdlib.h 523: Too many error or warning messages
*** 26 errors in Compile ***

bcc32 -c -osrc\gistrainer.obj -w- -tWC -DWIN32 -DHAVE_CONFIG_H -DNDEBUG -DBOOST_DISABLE_THREADS -DBOOST_DISABLE_ASSERTS -O2 -6 -DNDEBUG /Isrc /I. /Ilib src\gistrainer.cpp

...failed C++ src\gistrainer.obj ...
C++ src\maxentmodel.obj
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
src\maxentmodel.cpp:
Error E2316 D:\Borland\BCC55\Include\math.h 257: '_huge_dble' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 257: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 258: '_huge_ldble' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 258: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 279: 'acosl' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 279: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 280: 'asinl' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 280: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 281: 'atan2l' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 281: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 282: 'atanl' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 282: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 283: 'ceill' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 283: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 284: 'coshl' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 284: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 285: 'expl' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 285: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 286: 'fabsl' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 286: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 287: 'floorl' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 287: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 288: 'fmodl' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 288: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 289: 'frexpl' is not a member of '_STL'
Error E2228 D:\Borland\BCC55\Include\math.h 289: Too many error or warning messages
*** 26 errors in Compile ***

bcc32 -c -osrc\maxentmodel.obj -w- -tWC -DWIN32 -DHAVE_CONFIG_H -DNDEBUG -DBOOST_DISABLE_THREADS -DBOOST_DISABLE_ASSERTS -O2 -6 -DNDEBUG /Isrc /I. /Ilib src\maxentmodel.cpp

...failed C++ src\maxentmodel.obj ...
...skipped libmaxent.lib for lack of <src>modelfile.obj...
C++ src\maxent.obj
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
src\maxent.cpp:
Error E2316 D:\Borland\BCC55\Include\ctype.h 204: '_chartype' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\ctype.h 204: Identifier expected
Error E2316 D:\Borland\BCC55\Include\ctype.h 205: '_lower' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\ctype.h 205: Identifier expected
Error E2316 D:\Borland\BCC55\Include\ctype.h 206: '_upper' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\ctype.h 206: Identifier expected
Error E2316 D:\Borland\BCC55\Include\ctype.h 218: 'isascii' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\ctype.h 218: Identifier expected
Error E2316 D:\Borland\BCC55\Include\ctype.h 219: 'iswalnum' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\ctype.h 219: Identifier expected
Error E2316 D:\Borland\BCC55\Include\ctype.h 220: 'iswalpha' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\ctype.h 220: Identifier expected
Error E2316 D:\Borland\BCC55\Include\ctype.h 221: 'iswcntrl' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\ctype.h 221: Identifier expected
Error E2316 D:\Borland\BCC55\Include\ctype.h 222: 'iswdigit' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\ctype.h 222: Identifier expected
Error E2316 D:\Borland\BCC55\Include\ctype.h 223: 'iswgraph' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\ctype.h 223: Identifier expected
Error E2316 D:\Borland\BCC55\Include\ctype.h 224: 'iswlower' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\ctype.h 224: Identifier expected
Error E2316 D:\Borland\BCC55\Include\ctype.h 225: 'iswprint' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\ctype.h 225: Identifier expected
Error E2316 D:\Borland\BCC55\Include\ctype.h 226: 'iswpunct' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\ctype.h 226: Identifier expected
Error E2316 D:\Borland\BCC55\Include\ctype.h 227: 'iswspace' is not a member of '_STL'
Error E2228 D:\Borland\BCC55\Include\ctype.h 227: Too many error or warning messages
*** 26 errors in Compile ***

bcc32 -c -osrc\maxent.obj -w- -tWC -DWIN32 -DHAVE_CONFIG_H -DNDEBUG -DBOOST_DISABLE_THREADS -DBOOST_DISABLE_ASSERTS -O2 -6 -DNDEBUG /Isrc /I. /Ilib src\maxent.cpp

...failed C++ src\maxent.obj ...
...skipped maxent.exe for lack of <src>maxent.obj...
...failed updating 5 target(s)...
...skipped 2 target(s)...


我知道肯定是borland 中的名字空间std::和STLPort 4.5.3 中的名字空间_STL冲突,可是我不知道怎样做,才能消除这种冲突,希望各位帮助,比较急,能解决问题的悬分:100~!

如果需要细节方面的请邮箱联系:notice0203note@yahoo.com.cn
maxent 2007-04-08
  • 打赏
  • 举报
回复
Error E2272 D:\Borland\BCC55\Include\_str.h 287: Identifier expected
Error E2316 D:\Borland\BCC55\Include\_str.h 288: 'strnicmp' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\_str.h 288: Identifier expected
Error E2316 D:\Borland\BCC55\Include\_str.h 289: 'strrev' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\_str.h 289: Identifier expected
Error E2316 D:\Borland\BCC55\Include\_str.h 290: '_lstrupr' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\_str.h 290: Identifier expected
Error E2316 D:\Borland\BCC55\Include\_str.h 306: '_lstricoll' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\_str.h 306: Identifier expected
Error E2316 D:\Borland\BCC55\Include\_str.h 307: '_lstrncoll' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\_str.h 307: Identifier expected
Error E2316 D:\Borland\BCC55\Include\_str.h 308: '_lstrnicoll' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\_str.h 308: Identifier expected
Error E2316 D:\Borland\BCC55\Include\_str.h 310: '_lwcscoll' is not a member of '_STL'
Error E2228 D:\Borland\BCC55\Include\_str.h 310: Too many error or warning messages
*** 26 errors in Compile ***

bcc32 -c -osrc\modelfile.obj -w- -tWC -DWIN32 -DHAVE_CONFIG_H -DNDEBUG -DBOOST_DISABLE_THREADS -DBOOST_DISABLE_ASSERTS -O2 -6 -DNDEBUG /Isrc /I. /Ilib src\modelfile.cpp

...failed C++ src\modelfile.obj ...
C++ src\trainer.obj
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
src\trainer.cpp:
Error E2316 D:\Borland\BCC55\Include\math.h 257: '_huge_dble' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 257: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 258: '_huge_ldble' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 258: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 279: 'acosl' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 279: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 280: 'asinl' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 280: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 281: 'atan2l' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 281: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 282: 'atanl' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 282: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 283: 'ceill' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 283: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 284: 'coshl' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 284: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 285: 'expl' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 285: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 286: 'fabsl' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 286: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 287: 'floorl' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 287: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 288: 'fmodl' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\math.h 288: Identifier expected
Error E2316 D:\Borland\BCC55\Include\math.h 289: 'frexpl' is not a member of '_STL'
Error E2228 D:\Borland\BCC55\Include\math.h 289: Too many error or warning messages
*** 26 errors in Compile ***

maxent 2007-04-08
  • 打赏
  • 举报
回复
我用的是Borland C++ compiler 5.5 然后配置 stlport4.5.3
bcc32.cfg为:
-"D:\Borland\BCC55Include";"D:\STLport\stlport\BC50";"D:\STLport\stlport";"D:\boost"
-L"D:\Borland\BCC55\Lib";"D:\STLport\lib";"D:\boost";

然后编译jam成功,在jam编译源文件时却出现了以下错误:
Building with Borland C++ Tool Chain
[Warning] Fortran compiler not available, LBFGS module will not be built.
...found 328 target(s)...
...updating 7 target(s)...
C++ src\modelfile.obj
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
src\modelfile.cpp:
Error E2316 D:\Borland\BCC55\Include\_str.h 282: '_lstrlwr' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\_str.h 282: Identifier expected
Error E2316 D:\Borland\BCC55\Include\_str.h 283: '_lstrupr' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\_str.h 283: Identifier expected
Error E2316 D:\Borland\BCC55\Include\_str.h 284: '_stpcpy' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\_str.h 284: Identifier expected
Error E2316 D:\Borland\BCC55\Include\_str.h 285: 'strdup' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\_str.h 285: Identifier expected
Error E2316 D:\Borland\BCC55\Include\_str.h 286: 'stricmp' is not a member of '_STL'
Error E2272 D:\Borland\BCC55\Include\_str.h 286: Identifier expected
Error E2316 D:\Borland\BCC55\Include\_str.h 287: '_lstrlwr' is not a member of '_STL'
huzhangyou 2007-04-08
  • 打赏
  • 举报
回复
这应该是命名冲突的问题
maxent 2007-04-08
  • 打赏
  • 举报
回复
此问题已经解决,但是现在遇到了一个新的问题,错误代码为
D:\borland\include\_str.h:'_str'is not a member of '_STL'
chenxidu 2007-04-08
  • 打赏
  • 举报
回复
工程-选项-compile->filename 全部空,下面一行也空
看看可以吗?
kangji 2007-04-07
  • 打赏
  • 举报
回复
也许人家就不支持Borland的编译器,换其他编译器试试

13,871

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧