我下载了那个BCB整多线程例子,用bcb6编译,通不过,帮我看看谢谢

cppkiller 2003-12-24 02:14:39
我下载了那个BCB整多线程例子,用bcb6编译,通不过。
错误信息是:
[C++ Warning] _prolog.h(47): W8059 Structure packing size has changed
[C++ Warning] _prolog.h(19): W8059 Structure packing size has changed
[C++ Warning] _epilog.h(32): W8059 Structure packing size has changed
[C++ Warning] _epilog.h(3: W8059 Structure packing size has changed
[C++ Error] SynchedThreads.cpp(63): E2268 Call to undefined function 'assert'
[C++ Error] SynchedThreads.cpp(100): E2268 Call to undefined function 'assert'
[C++ Error] SynchedThreads.cpp(128): E2268 Call to undefined function 'assert'
===========
其中,
[C++ Warning] _prolog.h(47): W8059 Structure packing size has changed

对应的是:


#if defined (_STLP_MSVC) || defined (__ICL) || defined (__BORLANDC__)

# if !(defined (_STLP_MSVC) && (_STLP_MSVC < 1200))
# pragma warning(push)
# endif

# if defined (__BORLANDC__)
# pragma option push -Vx- -Ve- -a8 -b -pc -w-inl -w-aus -w-sig -w-8062 -w-8041 -w-8008 -w-8012 -w-8027 -w-8057 -w-8091 -w-8092 -w-8066 /* P_O_1 */
//# pragma option push -w-inl -w-aus -w-sig -w-8062 -w-8041 -w-8008 -w-8012 -w-8027 -w-8057 -w-8091 -w-8092 /* P_O_1 */
# else
# include <config/_msvc_warnings_off.h>
# endif


#elif defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)

#pragma set woff 1209
#pragma set woff 1174
#pragma set woff 1375
// from iterator_base.h
#pragma set woff 1183

#elif defined(__DECCXX)

# ifdef __PRAGMA_ENVIRONMENT
# pragma __environment __save
# pragma __environment __header_defaults
# endif

#elif defined(__IBMCPP__)
// supress EDC3130: A constant is being used as a conditional expression
#pragma info(nocnd)

#elif defined (__HP_aCC)
/* _REENTRANT selects Posix 1c threads unless draft4 selected.
* * This usage is obsolescent, "-D_POSIX_C_SOURCE=199506" is preferred */
# if 0 /* defined (_REENTRANT) && ! defined (_POSIX_C_SOURCE) */
# define _POSIX_C_SOURCE 199506
# endif
#elif defined (__WATCOMCPLUSPLUS__)
# pragma warning 604 10 // must lookahead to determine...
# pragma warning 594 10 // resolved as declaration/type
# pragma warning 595 10 // resolved as an expression
#endif

==============
[C++ Error] SynchedThreads.cpp(100): E2268 Call to undefined function 'assert'

对应的是:

TStopStartThread::TStopStartThread()
: TSimpleThread((TThreadFunction) NULL, NULL, false)
{
Event = CreateEvent(NULL, true, false, NULL);
// API call is smaller and simpler than VCL wrapper
assert(Event != NULL);
Waiting = Aborted = false;
} // TStopStartThread::TStopStartThread
=================
如何理解和解决?谢谢

那个例子的下载地址在:
http://www.ccrun.com/sour/
...全文
108 点赞 收藏 6
写回复
6 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
cppkiller 2003-12-29
照上面的朋友的话,改了,可以运行了,但要死。
这是老外写的例子,不好用。我想我还是自己试试写个来教育自己算了。
回复
javagems 2003-12-26
新建立窗口,把代码拷贝进去。
我上次也碰到过!
回复
用写字板把这个文档打开。MsgWaits.bpr
这到下面的部分,然后在改为这样了。
<LIBRARIES value="Vcl50.lib"/>
<SPARELIBS value="Vcl50.lib"/>
保存就行了。
回复
叶子哟 2003-12-24
在项目中删除它
回复
cppkiller 2003-12-24
试着改了改,结果:
[C++ Warning] _prolog.h(47): W8059 Structure packing size has changed
[C++ Warning] _prolog.h(19): W8059 Structure packing size has changed
[C++ Warning] _epilog.h(33): W8059 Structure packing size has changed
[C++ Warning] _epilog.h(39): W8059 Structure packing size has changed
[C++ Warning] _prolog.h(47): W8059 Structure packing size has changed
[C++ Warning] _prolog.h(19): W8059 Structure packing size has changed
[C++ Warning] _epilog.h(33): W8059 Structure packing size has changed
[C++ Warning] _epilog.h(39): W8059 Structure packing size has changed
[C++ Warning] _prolog.h(47): W8059 Structure packing size has changed
[C++ Warning] _prolog.h(19): W8059 Structure packing size has changed
[C++ Warning] _epilog.h(33): W8059 Structure packing size has changed
[C++ Warning] _epilog.h(39): W8059 Structure packing size has changed
[Linker Fatal Error] Fatal: Unable to open file 'DCLUSR30.LIB'

还是不行。
Structure packing size has changed是什么东西?
哪里有dclusr30?
回复
做以下修改:
// 头文件 CppTestForm.h

#include <memory>
#include <iostream>

#include "SynchedThreads.h"
#include <syncobjs.hpp>
using namespace std;

// 头文件 CppTestForm.cpp
void __fastcall TCppTest::FormCreate(TObject *Sender)
{
//Thread = std::auto_ptr<TStopStartThread>(new TStopStartThread);
//UntilFlag =
// std::auto_ptr<TEvent>(new TEvent(NULL, true, false, NULL));
WaitThread = NULL;
} // TCppTest::FormCreate

//头文件 SynchedThreads.h

#include <stdexcept>
#include <assert.h>
回复
发动态
发帖子
Windows SDK/API
创建于2007-08-02

1202

社区成员

C++ Builder Windows SDK/API
申请成为版主
社区公告
暂无公告