怎么编写exe程序C语言程序是老是出现,执行c1.exe时出错

初学C,编好后为什么总是执行c1.exe时出错_百度知道
初学C,编好后为什么总是执行c1.exe时出错
初学C,编出来的程序总是执行c1.exe时出错,搞不明白...
我有更好的答案
意思是反括号配对错误,有反括号没找到配对的正括号,修改:area=(int)(3,语法错误‘)’第1个图area=(int)(3.14159)*radius*radius);提示:错误:#define&false0#define&nbsp.14159*radius*radius);第2图,定义在stdbool.h中,如果没有这个头文件,可以自己定义一下
采纳率:82%
来自团队:
3.1415926后面的括号去掉
为您推荐:
其他类似问题
换一换
回答问题,赢新手礼包执行c1.exe出错!在线等_百度知道
执行c1.exe出错!在线等
我有更好的答案
不用看了!貌似是你少了wspiapi.h 头文件!
采纳率:10%
是不是绿色免安装的vc啊?找到安装路径里面的bin再说吧
是啊 是绿色安装的
好像是改一个clxxx.dll的名字吧
怎么改对同一回答者追问超过3条后每次将消耗5个财富值
进入VC98\bin,把里面的clxx.exe改名为cl.exe。不行的百度我啊。
没有这个 clxx.exe找不到
请亲别浪费财富值了,指着我的名字,点击hi
是不是得把代码和完整的错误信息粘上来才能看到怎么出错的啊。。。这怎么看。。。
你的扣扣号
把代码和完整错误信息贴上来大家一块帮你解决好了
不会弄啊&&怎么找错误信息啊&&双击没用&&
好像是wspiapi.h 那里面有问题。。。去那里仔细看看呢?
你帮我看看
让大家帮着看看吧。。。我也不会了。。。
为您推荐:
其他类似问题
换一换
回答问题,赢新手礼包在VC++6.0中,总是出现一个叫error spawning c1.exe的错误,怎么回事呢?_百度知道
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。
在VC++6.0中,总是出现一个叫error spawning c1.exe的错误,怎么回事呢?
楼上正解我这里有基本错误的解决办法以后一定会用到:在创建项目时, 不使用MFC AppWizard向导, 如果没有设置好项目参数, 就会在编译时产生很多连接错误, 如error LNK2001错误, 典型的错误提示有: libcmtd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 msvcrtd.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16 nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex 下面介绍解决的方法: 1. Windows子系统设置错误, 提示: libcmtd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Windows项目要使用Windows子系统, 而不是Console, 可以这样设置: [Project] --& [Settings] --& 选择&Link&属性页, 在Project Options中将/subsystem:console改成/subsystem:windows 2. Console子系统设置错误, 提示: LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 控制台项目要使用Console子系统, 而不是Windows, 设置: [Project] --& [Settings] --& 选择&Link&属性页, 在Project Options中将/subsystem:windows改成/subsystem:console 3. 程序入口设置错误, 提示: msvcrtd.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16 通常, MFC项目的程序入口函数是WinMain, 如果编译项目的Unicode版本, 程序入口必须改为wWinMainCRTStartup, 所以需要重新设置程序入口: [Project] --& [Settings] --& 选择&C/C++&属性页, 在Category中选择Output, 再在Entry-point symbol中填入wWinMainCRTStartup, 即可 4. 线程运行时库设置错误, 提示: nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex 这是因为MFC要使用多线程时库, 需要更改设置: [Project] --& [Settings] --& 选择&C/C++&属性页, 在Category中选择Code Generation, 再在Use run-time library中选择Debug Multithreaded或者multithreaded 其中, Single-Threaded 单线程静态链接库(release版本) Multithreaded 多线程静态链接库(release版本) multithreaded DLL 多线程动态链接库(release版本) Debug Single-Threaded 单线程静态链接库(debug版本) Debug Multithreaded 多线程静态链接库(debug版本) Debug Multithreaded DLL 多线程动态链接库(debug版本) 单线程: 不需要多线程调用时, 多用在DOS环境下 多线程: 可以并发运行 静态库: 直接将库与程序Link, 可以脱离MFC库运行 动态库: 需要相应的DLL动态库, 程序才能运行 release版本: 正式发布时使用 debug版本: 调试阶段使用VC 6.0“Compiling... ,Error spawning cl.exe”错误解决 Posted on
19:55 k_eckel 阅读(8862) 评论(100)
可能很多人在安装VC 6.0后有过点击“Compile”或者“Build”后被出现的“Compiling... ,Error spawning cl.exe”错误提示给郁闷过。很多人的选择是重装,实际上这个问题很多情况下是由于路径设置的问题引起的,“CL.exe”是VC使用真正的编译器(编译程序),其路径在“VC根目录\VC98\Bin”下面,你可以到相应的路径下找到这个应用程序。
因此问题可以按照以下方法解决:点击VC“TOOLS(工具)”—&“Option(选择)”—&“Directories(目录)”重新设置“Excutable Fils、Include Files、Library Files、Source Files”的路径。很多情况可能就一个盘符的不同(例如你的VC装在C,但是这些路径全部在D),改过来就OK了。nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv解决方法:在Preprocessor中定义_AFXDLL如果它提示:fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds就这样改:C/C++-&Code Generation-&Multithread DLL (即实现/MD选项)Visual C++ Error MessagesThis page contains a listing of &difficult to diagnose& error messages and possible fixes. I haven't taught a programming class that uses Visual C++ in several years so this list is probably out of date by now.
It was valid for Microsoft Visual C++ version 6.0 service pack 3.--------------------------------------------------------------------------------C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line 1786) Please choose the Technical Support command on the Visual C++ Help menu, or open the Technical Support help file for more informationThis error results from leaving off the parentheses immediately following the function name in a function header.
To correct the error simply add () to the end of the function name.--------------------------------------------------------------------------------C1010: unexpected end of file while looking for precompiled header directiveIf your project is an MFC AppWizard created project then this error results from not #including StdAfx.h as the first #i nclude statement (before any other #i ncludes, data declarations, or executable program code).--------------------------------------------------------------------------------C1083: Cannot open precompiled header file: 'Debug/&Project-Name&.pch': No such file or directoryThis error results from a missing file - the compiled version of StdAfx.cpp. Visual C++ does a poor job of keeping track of this file and frequently &forgets& how to build it. This problem often occurs after restoring a saved workspace from diskette without the Debug directory. To fix the error select StdAfx.cpp from the workspace file list them choose Compile from the Build menu.
If that doesn't work the go to Project -& Settings, select the C/C++ tab, and click the radio button labeled Create Precompiled Headers.--------------------------------------------------------------------------------C2001: newline in constantThis error is usually caused by a string or character constant that is missing its closing ' or & symbol.--------------------------------------------------------------------------------C2065: '&data-member name&' : undeclared identifierIf this error occurs in one of your member functions then it is generally the result of forgetting the class scope operator in front of the function name in your .cpp file.--------------------------------------------------------------------------------C2143: syntax error : missing ';' before 'PCH creation point'Check each of the #i nclude files to ensure that the closing brace of each class declaration is followed by a semicolon.--------------------------------------------------------------------------------C2143: syntax error : missing ';' before '*'If this error is followed by two C2501 errors then the problem is an undeclared class name within a pointer declaration.For example, the declaration:CClass *pOwill generate the above error message followed by a C2501 error message for 'CClass' and another C2501 message for 'pObject'.
The problem is that the compiler isn't recognizing CClass as a valid class/type name.
To correct the problem add a #i nclude of the file containing the declaration of CClass (e.g., #i nclude CClass.h)--------------------------------------------------------------------------------C2447: missing function header (old-style formal list?)This error usually results from a missing { instead of a { following the parameter list of a function header.--------------------------------------------------------------------------------C2511: '&function-name&' : overloaded member function not found in '&class-name&'This error results from a mismatch in the parameter list of a member function declaration (.h file) and definition (.ccp file). Check the forward declaration of the function in the .h file and its definition in the .cpp file and ensure that the number of parameters and the type of each parameter match exactly.--------------------------------------------------------------------------------C2512: '&constructor-function-name&' : no appropriate default constructor availableThis error usually occurs when you implement the constructor function of a derived class and forget to include parameter passing to the base class constructor function.
For example assume that CDerived is derived from CBase and that the CBase constructor function requires one parameter (e.g., int A).
If you define the CDerived constructor function as:CDerived::CDerived(int A, int B) { ... }the compiler will issue the above error message on the line containing the function header of CDerived::CDerived() because you haven't provided instructions for routing the parameter A to CBase::CBase().
Because you didn't provide instructions the compiler assumes that CBase::CBase() requires no arguments and it complains because no version of CBase::CBase() has been defined that accepts zero arguments.If you intended to provide a version of CBase::CBase() that requires no arguments then the error message indicates that you forgot to declare that function in your base class declaration (e.g., in CBase.h).If CBase::CBase() does require one or more arguments then you must correct the problem by including explicit instructions for passing parameters from the derived class constructor function to the base class constructor function.
The correction for the example above is:CDerived::CDerived(int A, int B) : CBase(A) { ... }--------------------------------------------------------------------------------C2556: '&function-name&' : overloaded functions only differ by return typeC2371: '&function-name&' : different basic typesThese errors usually result from a mismatch of function type between a .h and .cpp file. Check the forward declaration of the function in the .h file and its definition in the .cpp file and make the function return type identical in both files.--------------------------------------------------------------------------------C2601: '&function-name&' : local function definitions are illegalThis error results from defining one function inside the body of another function.
It usually means that you omitted one or more } symbols in the function just before the function named in the error message.--------------------------------------------------------------------------------C2653: '&Class-Name&' : is not a class or namespace nameThis error usually results from not having #i nclude &StdAfx.h& as the first #i nclude statement in your class.cpp file.
It can also occur if your class definition is in a .h file and you forget to #i nclude that .h file in another file that refers to the class name.--------------------------------------------------------------------------------C2661: '&Class-Name&::&Function-Name&' : no overloaded function takes n parametersThis error indicates a mismatch between the parameters used in a function call (e.g., from main.cpp) and the declaration of the function.
The function call is passing n parameters and there is no function declaration that uses that number of parameters.--------------------------------------------------------------------------------LNK1104: Cannot open file nafxcwd.libThis error sometimes occurs when a project uses a class from the MFC but the project settings don't explicitly tell the link editor to look in the MFC libraries.
Go to Project --& Settings (Build --& Settings in Visual C++ 4.0). On the General tab check the box that says &Use MFC in a Shared DLL&. --------------------------------------------------------------------------------LNK1168: cannot open Debug\&Project-Name&.exe for writingThis error occurs when the link editor attempts to write to a .exe file that is currently in use. The .exe file of an executing program is write protected until the program is terminated. Look at the status bar at the bottom of your screen and find the icon representing your executable application. Open the application and exit from it. Then select Build.--------------------------------------------------------------------------------LNK2001: unresolved external symbol __endthreadexLNK2001: unresolved external symbol __beginthreadexThese errors result from using an MFC object or function without telling the link editor to search the MFC libraries.Go to Project --& Settings (Build --& Settings in Visual C++ 4.0). On the General tab check the box that says &Use MFC in a Shared DLL&. --------------------------------------------------------------------------------LNK2001: unresolved external symbol _mainYour project doesn't contain a function called main().
The error usually results from forgeting to add main.cpp to the project workspace.--------------------------------------------------------------------------------&File&.obj : error LNK2001: unresolved external symbol &public: void __thiscall &Class1&::&Function1&(&Type&)&This a generic form of a LNK2001 error where &File&.obj can be any object file in your project and &Class1&::&Function1&(&Type&) can be any function in any class.
Substitute the specific &File&, &Class&, &Function&, and &Type& in your message into the instructions below to diagnose and correct the problem.An LNK2001 error means that the link editor is looking for a compiled function and can't find it.
The call to the &missing function& is somewhere in &File&.cpp. Unfortunately, double-clicking on the error message won't take you to the point in &File.cpp& where the function is called but you can search for it with Find or Find In Files.
The function the link editor can't find is a member of &Class&, its name is &Function1&, and its return type is &Type&.There are two common reasons for a LNK2001 error: The call in &File&.cpp doesn't match the function prototype in &Class&.h and/or the implementation in &Class&.cpp.
The mismatch may be in the function name, return type, or number and/or type of parameters.
Correction strategies include: Check that the function name is spelled the same (case sensitive) in all three files (File.cpp, Class.h, and Class.cpp). Check that the function is actually declared and defined within &Class& - perhaps you defined it as a member of a different class or perhaps you tried to call the function (in &File&.cpp) using an object or object pointer of a different class. Check that the number and type of parameters in the function implementation (in &Class&.cpp) matches the number and type of parameters declared in the function declaration in &Class&.h. Check that the number and type of parameters in the function call (in &File&.cpp) matches the number and type of parameters declared in the function header in &Class&.cpp. The function was never declared or was declared but never defined.
To see if either is the case go to the ClassView window of the Workspace view.
Click the + next to &Class& and find &Function& in the list of member functions. If &Function& is NOT in the list then it was never declared or defined - add a declaration to the class declaraion in &Class&.h and implement the function in &Class&.cpp. If &Function& is in the list then right click on it and select Go To Definition from the pop-up menu.
If you get the error message Cannot find definition (implementation) of this function then the function was declared but never defined (implemented).
Implement the function to &Class&.cpp. --------------------------------------------------------------------------------LNK2005: &some-long-string-of-mostly-garbage& already defined in &name&.lib(&name&.obj)This error usually results from including a source code file multiple times. If you recognize any of the names in the message then it probably results from multiple inclusion of one of your own header files. Check to be sure that you've used #ifndef/#define/#endif properly your header files. If you don't recognize the name then it's probably multiple inclusion of a system file (e.g., afxwin.h). Make sure that you haven't explicitly included something in main.cpp that is already included in one of your own header files.
Also check that you haven't #i ncluded a .cpp file where you should have #i ncluded a .h file.
采纳率:32%
0后有过点击“Compile”或者“Build”后被出现的“Compiling://www:http,你可以到相应的路径下找到这个应用程序。 因此问题可以按照以下方法解决:点击VC“TOOLS(工具)”—&“Option(选择)”—&gt... ;VC98\Bin”下面://www,Error spawning cl可能很多人在安装VC 6;“Directories(目录)”重新设置“Excutable Fils、Include Files、Library Files、Source Files”的路径.exe”错误提示给郁闷过。很多人的选择是重装,实际上这个问题很多情况下是由于路径设置的问题引起的,“CL.exe”是VC使用真正的编译器(编译程序),其路径在“VC根目录&#92
为您推荐:
其他类似问题
spawning的相关知识
换一换
回答问题,赢新手礼包VC++6.0中出现spawning c1.exe的错误应当怎么办?能一对一的告诉我吗?_百度知道
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。
VC++6.0中出现spawning c1.exe的错误应当怎么办?能一对一的告诉我吗?
我有更好的答案
这个一般是链接错误,可能是工程引用文件不对。哥们把你的程序发给我看看
程序本身没问题,在我电脑上OK,看你的环境是VC6 吧
,你是什么工程?可能是选的windows工程 ,然后写上控制台的了 。尝试把 int
main() 换成int WINAPI WinMain(HINSTANCE hI, HINSTANCE, LPCTSTR cmdLine, int nCmdShow)或者重建一个Win32控制台项目。
发规划法规和发给法规和
是执行程序出现的》?
为您推荐:
其他类似问题
spawning的相关知识
换一换
回答问题,赢新手礼包svchost.exe 应用程序错误 0x7c93103c指令引用的0x010b01c1内存不能为written_百度知道
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。
svchost.exe 应用程序错误 0x7c93103c指令引用的0x010b01c1内存不能为written
是什么问题怎么解决?
我有更好的答案
系统本身有问题,及时安装官方发行的补丁,必要时重装系统。 病毒问题:杀毒 。杀毒软件与其它软件冲突:卸载有问题的软件;Microsoft&#92: 完全注册dll:打开“运行”输入→cmd→回车 然后把下面这行字符复制到黑色cmd框里面去回车等待dll文件全部注册完成就关闭可以了;*.dll) do regsvr32.exe &#47。 3.浏览器出现内存不能读.ocx) do regsvr32.exe &#47、写的提示: (1)运行→regedit→进入注册表, 在→ HKEY_LOCAL_MACHINE\SOFTWARE&#92,更换内存。显卡驱动是否正确按装或者是否被恶意覆盖否1.如果能排除硬件上的原因(内存条不兼容.exe /s %i 回车 for %i in (%windir%\system32&#92,然后在命令提示符后击鼠标右键→粘贴→回车,耐心等待;*;s %i 回车 两条分别运行完成后重启机器;s %1 完成后重新启动机器。 卸载游戏重新启动电脑,关闭杀毒软件以后重新安装。 4.如果以上方法无法解决只能使用最后一招,为防止输入错误可以复制这条指令,直到屏幕滚动停止。 (下面是要运行的代码);CurrentVersion\Explorer&#92?)往下看: 2;ShellExecuteHooks 这个位置有一个正常的键值{AEB-11d0-97EE-00C04FD91972}, 将其他的删除。 (2)打开CMD窗口输入如下命令: for %i in (%windir%&#92.系统或其它软件引起的,可用下述方法处理;system32\*.dll) do regsvr32: for %1 in (%windir%\system32\Windows&#92
采纳率:29%
将它们关闭可以节省不小的内存空间,从而能够有效避免内存读写错误现象的发生。当然;scannow”,单击回车键后。
手工修复系统服务
与系统内存读写操作有关的Windows Management Instrumentation服务要是发生错误的话,也会导致系统弹出内存读写错误的提示,所以当我们遇到这种错误现象时,按前面操作打开Windows Management Instrumentation服务的属性设置界面,单击该界面中的“启动”按钮,相信这么一来Windows Management Instrumentation服务就能正常运行了。 修复系统损坏文件
如果计算机系统不小心感染了病毒或者发生了误删除操作,那么与系统内存读写操作有关的系统文件很可能受到损坏,而这些系统文件一旦受到损坏的话,那么我们就很容易遭遇内存读写故障提示了。所以,因为计算机系统一旦感染了病毒而不进行清除的话,我们即使修复了系统文件,病毒仍然有可能会继续破坏系统文件当我们在计算机系统中运行一些容量较大的程序或者游戏时,找到Windows Management Instrumentation服务,并用鼠标右键单击该服务选项,从弹出的快捷菜单中执行“属性”命令,打开如图所示的服务属性设置界面;
其次在该设置界面的“常规”标签页面中,单击“停止”按钮,它就能自动弹出提示界面,而不少插件程序往往都有防删除的功能,一旦发现的话,那可以直接将它们从系统中及时卸载干净,我们该如何才能将它有效排除,因此这些插件很容易与其他的应用程序发生冲突,可以确保系统文件不会继续受到病毒的威胁,同时确保下次运行容量较大的程序或者游戏时,系统不会再次出现系统内存读写错误呢?事实上,当我们不幸遭遇上面的故障信息时,我们可以尝试按照如下步骤进行依次排查:
移除无效插件程序
在上网冲浪的过程中。
及时释放系统内存
我们知道,在运行一些容量较大的程序或者游戏时,需要消耗相当的系统内存资源,要是此时内存空间不够时,那么系统内存读写错误的故障提示很有可能就会发生。为了有效避免这种错误提示,备份完成后将该文件夹中的所有内容全部清除掉,许多插件程序会偷偷地安装到计算机系统中,从弹出的快捷菜单中执行“管理”命令。
其次使用系统自带的“sfc”命令,看看系统是否存在损坏的文件,可以尝试手工修复一下Windows Management Instrumentation服务,下面就是具体的修复步骤:
首先用鼠标右键单击系统桌面中的“我的电脑”图标,从而间接地引起系统内存读写错误的现象。为了给那些大容量的应用程序或游戏提供一个干净、稳定的工作环境,我们最好定期使用类似360安全卫士这样的程序,来查看系统是否被偷偷安装了各种无效的垃圾插件程序,在弹出的系统运行对话框中,输入字符串命令“sfc &#47,打开本地系统的计算机管理窗口,在该窗口的左侧显示区域,依次展开“服务和应用程序”/“服务”选项,只要依次单击“开始”/“运行”命令,从而达到修复系统文件的目的,我们最好在运行容量较大的程序或者游戏之前,应该先将计算机系统重新启动一下,这样能够将系统内存空间充分释放出来;如果计算机内存空间本身就比较小的话,那么我们建议各位最好及时升级内存、“wbem”、“repository”文件夹,然后将“repository”文件夹窗口中的所有文件进行一下备份,在对应“服务”选项所在的右侧显示区域中,将Windows Management Instrumentation服务暂时停止运行。之后,打开计算机系统的资源管理器窗口,在该窗口中依次展开“Windows”。
当然,所以及时使用杀毒软件来将计算机中的病毒全部清除干净,我们应该先将那些随机启动的杀毒软件以及相关即时监控的程序暂时关闭掉、“ssystem32”;
接下来,重新启动一下计算机系统,待系统启动成功后,我们一旦碰到内存读写错误的提示时,不妨按照如下步骤修复一下系统:
首先使用最新版本的杀毒软件,来对计算机系统进行彻底地病毒查杀操作,就不会看到有什么不正常的现象了,来尝试将受到损坏的系统文件修复到正常状态。在修复受损系统文件时,以便拓展内存的有效使用空间,在系统自身内存空间不足的情况下,该命令程序就会对系统每个角落处的系统文件进行搜索扫描,一旦发现系统文件的版本不正确或者系统文件已经损坏的话,要求我们插入Windows系统的安装光盘,以便从中提取正常的系统文件来替代不正常的系统文件。要是系统修复操作成功的话,相信我们重新启动计算机系统时,以防止由于系统内存不足而造成系统内存读写错误的发生,之后再尝试运行容量较大的应用程序或者网络游戏,因为杀毒软件及相关监控程序会在一定程度上消耗一些系统内存资源,系统常常会自动弹出“xx内存不能为read或written”的错误提示,遇到这种故障信息时
为您推荐:
其他类似问题
应用程序错误的相关知识
换一换
回答问题,赢新手礼包

我要回帖

更多关于 java如何编写exe程序 的文章

 

随机推荐