Visual C ++错误的切入点 [英] Visual C++ wrong entry point
问题描述
我遇到一个问题,启动使用
编译的应用程序Visual C ++ 6 SP5不执行函数main(int argc,char
** argv)并退出立即使用代码1(0x1)。
将main作为项目中的入口点 - >设置 - >
链接 - >输出 - >入口点符号,使程序调用main
但我的argc和argv参数都等于0.
有人有想法吗?>
I experience a problem where starting an application compiled with
visual C++ 6 SP5 does not execute the function main(int argc, char
**argv) and exit immediately with code 1 (0x1).
Putting main as an entry point in the section Project -> settings ->
link -> output -> entry-point symbol, makes the program calling main
but my argc and argv arguments are both equal to 0.
Has anyone an idea ?
推荐答案
" Laurent Schall" < SC ****** @ yahoo.fr>在消息中写道
新闻:a9 ************************** @ posting.google.c om ...
"Laurent Schall" <sc******@yahoo.fr> wrote in message
news:a9**************************@posting.google.c om...
我遇到一个问题,启动使用Visual C ++ 6 SP5编译的应用程序不执行函数main(int argc,char
** argv)并立即退出代码1(0x1)。
将main作为入口点放在Project - >中。设置 - >
链接 - >输出 - >入口点符号,使程序调用main
但我的argc和argv参数都等于0.
有人有想法吗?
I experience a problem where starting an application compiled with
visual C++ 6 SP5 does not execute the function main(int argc, char
**argv) and exit immediately with code 1 (0x1).
Putting main as an entry point in the section Project -> settings ->
link -> output -> entry-point symbol, makes the program calling main
but my argc and argv arguments are both equal to 0.
Has anyone an idea ?
>
也许你的程序包含构造函数失败的全局对象。这个听起来有点合理吗?
设置项目设置下的入口点听起来真的很糟糕
想法,你只是弄乱你不理解的东西。
john
Maybe your program contains global objects whose constructors fail. Does
this sound plausible?
Setting the entry point under project settings sounds like a really bad
idea, you were just messing with something you didn''t understand.
john
* sc ****** @ yahoo.fr (Laurent Schall)schriebt:
* sc******@yahoo.fr (Laurent Schall) schriebt:
我遇到启动应用程序的问题使用Visual C ++编译的SP5不执行函数main(int argc,char
** argv)并立即退出代码1(0x1)。
正如John Harrison回应的那样,也许你的程序包含全局对象
,其构造函数失败。
另一种可能性可能是你使用了那个编译器的非标准的
功能而不是''main''''WinMain''或者其他一些(实际上是
执行几种可能性;在这种情况下,更改项目设置
或适当修改编译器/链接器参数;请参阅您的文档。
将main作为项目中的入口点 - >设置 - >
链接 - >输出 - >入口点符号,使程序调用main
但我的argc和argv参数都等于0.
有人有想法吗?
I experience a problem where starting an application compiled with
visual C++ 6 SP5 does not execute the function main(int argc, char
**argv) and exit immediately with code 1 (0x1).
As John Harrison responded, perhaps your program contains global objects
whose constructors fail.
Another possibility might be that you have used that compiler''s non-standard
feature where instead of ''main'' a ''WinMain'' or some such (there are actually
several possibilities) is executed; in that case change the project settings
or modify the compiler/linker arguments appropriately; see your documentation.
Putting main as an entry point in the section Project -> settings ->
link -> output -> entry-point symbol, makes the program calling main
but my argc and argv arguments are both equal to 0.
Has anyone an idea?
>
是的,这是该组中的偏离主题,但是为了让你回到
track:你指定给链接器的入口点,几乎无论
哪个C ++实现,不是''main''函数,但是在C ++实现的运行时库中有些函数是b $ b,而后者又调用''main''。 />
Yes, that is off-topic in this group, but in order to get you back on
track: the entry point you specify to the linker, almost regardless of
which C++ implementation, is _not_ the ''main'' function, but some function
in that C++ implementation''s runtime library that in turn calls ''main''.
Laurent Schall写道:
Laurent Schall wrote:
我遇到了启动使用Visual C ++编译的应用程序的问题6 SP5不执行函数main(int argc,char
** argv)并立即退出代码1(0x1)。
将main作为入口点放在Project - >中;设置 - >
链接 - >输出 - >入口点符号,使程序调用main
但我的argc和argv参数都等于0.
有人有想法吗?
I experience a problem where starting an application compiled with
visual C++ 6 SP5 does not execute the function main(int argc, char
**argv) and exit immediately with code 1 (0x1).
Putting main as an entry point in the section Project -> settings ->
link -> output -> entry-point symbol, makes the program calling main
but my argc and argv arguments are both equal to 0.
Has anyone an idea ?
>
Main定义为:
int main(int argc,char * argv [])
我不喜欢知道这是否能解决你的问题,但这是一个开始。
Main is defined as:
int main(int argc, char * argv[])
I don''t know if that will solve your problem or not, but it is a start.
这篇关于Visual C ++错误的切入点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!