(C++) Assertion failed: !"Bad error code", file VMem.c, line 715
2015-05-11 10:31
851 查看
(C++) Assertion failed: !"Bad error code", file VMem.c, line 715
Misc error.myInterface
Full error message
Assertion failed: !"Bad error code", file VMem.c, line 715 |
Cause
IDE: C++ Builder 6.0Project type: VCL
Appears when linking the following code:
#define ARRAY_SIZE 10000000 int main() { int array[ARRAY_SIZE]; } |
Solutions
When this error occurs, restart C++ Builder and nothing has been lost. Do change the code as in one of the examples below.Decrease the value of the array size
#define ARRAY_SIZE 1000000 int main() { int array[ARRAY_SIZE]; } |
Create the array dynamically
#define ARRAY_SIZE 10000000 int main() { int * const array = new int(ARRAY_SIZE); } |
Use a std::vector (preferred)
#include <vector> int main() { const int sz = 10000000; std::vector<int> v(sz); } |
Go back to Richel Bilderbeek's homepage.
相关文章推荐
- Error Domain=ASIHTTPRequestErrorDomain Code=8 "Failed to move file from"xxx/xxx"to"xxx/xxx"
- cocos2d-x3.x连接CSV文件Get data from file("Tower.csv")failed,error code is 32 问题及解决方案
- “Internal Error File: /SourceCache/IndigoDebuggingPlugin/IndigoDebuggingPlugin-31/IndigoDevice/XCiPhoneSimulatorDevice.m Line: 265 Object: Method: _launchSimulatedExecutable: Assertion failed: nil == _currentSimulatorSession"
- java.lang.instrument ASSERTION FAILED ***: "error == JVMTI_ERROR_NONE" at Reentrancy.c line: 161
- 解决"python setup.py egg_info" failed with error code 1以及error: Microsoft Visual C++ 14.0 is required
- 关于 debug assertion failed, file:dlgdata.cpp,line"44 错误
- debug assertion failed, file:dlgdata.cpp,line"43
- 关于 debug assertion failed, file:dlgdata.cpp,line"44 错误收藏
- 解决 win10 pycurl安装出错 Command "python setup.py egg_info" failed with error code 10
- android模拟器 报错:X Error of failed request: BadRequest (invalid request code or no such operation)
- 报错:OpenCV Error: Assertion failed (src.size() == dst.size() && src.type() == dst.ty pe()) in unknown function, file ..……
- Jenkins 安装启动提示“iJob for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details.”
- nginx: [error] open() "/run/nginx.pid" failed (2: No such file or directory)
- pip安装软件时出现Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build*的解决方案
- Git Clone时报 "fatal: index-pack failed error: RPC failed; result=18, HTTP code = 200"原因文件过大需要服务端配置一下
- android数据库操作 sqlite returned: error code = 14, msg = cannot open file at source line 25502
- "fatal: protocol error: bad line length character: No s"原因
- mysql导入sql脚本时错误指令:Failed to open file "file_name" error 2/error 22
- 解决Job for docker.service failed because the control process exited with error code. See "systemctl s
- Job for postfix.service failed because the control process exited with error code. See "systemctl st