问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

在VC++6.0中,总是出现一个叫error spawning c1.exe的错误,怎么回事呢...

发布网友 发布时间:2022-04-24 07:32

我来回答

3个回答

热心网友 时间:2022-04-13 08:02

楼上正解
我这里有基本错误的解决办法
以后一定会用到:

在创建项目时, 不使用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 2005-06-03 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 information

This 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 directive

If 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 directory

This 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 constant

This error is usually caused by a string or character constant that is missing its closing ' or " symbol.

--------------------------------------------------------------------------------

C2065: '<data-member name>' : undeclared identifier

If 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 *pObject;

will 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 { or use of a ; 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 (.* 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 available

This 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 type
C2371: '<function-name>' : redefinition; different basic types

These 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 illegal

This 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 name

This 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 parameters

This 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.lib

This 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 writing

This 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 __endthreadex
LNK2001: unresolved external symbol __beginthreadex

These 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 _main

Your 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.

热心网友 时间:2022-04-13 09:20

可能很多人在安装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了。
参考资料:http://www.mscenter.e.cn/blog/k_eckel/articles/3016.html

热心网友 时间:2022-04-13 10:55

付费内容限时免费查看回答、首先我们的查看VC++6.0的安装路径,一般默认安装都是安装在C:\Program Files\Microsoft Visual Studio目录下的,但是有可能你安装时时安装在其他目录中,一定要知道安装目录的路径。我这里是安装在D:\Microsoft Visual Studio6.0目录中。

打开VC++6.0程序,点击菜单栏上的“工具(T)”,在出现的下拉列表中选择“选项

弹出一个“选项”窗口,点击窗口菜单栏上的“目录”选项,点击目录(S)对应的下拉框会看到有可执行文件(executatble files)、include files、library files、source files四个选项。

4、首先,我们在“目录(S)”对应的下拉框中选择“可执行文件(executatble files)”,在"路径(D)"(也就是红线框)中可以看到一共有四行路径,黄线框中的代表的是VC++6.0的安装路径,如果不是你的安装路径,请改为安装路径。

、然后,再在“目录(S)”对应的下拉框中选择“include files”,在"路径(D)"(也就是红线框)中可以看到一共有三行路径,黄线框中依然代表VC++6.0的安装路径,如果不是请改为安装路径。

6、然后,再在“目录(S)”对应的下拉框中选择“library files”,在"路径(D)"(也就是红线框)中可以看到一共有两行路径,黄线框中依然代表VC++6.0的安装路径,如果不是请改为安装路径。

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
2024年高考多少分能上武汉商贸职业学院 武汉商贸职业学院是一本吗 武汉商贸职业学院的学费是多少 凉台沟风景区路好走吗 凉台沟游玩攻略 三星S4怎样卸载关云藏手机防查 三星。s4上的360手机卫生 如何删除 手机s4想卸载360安全卫士,怎么也卸载不了,连带其它软件卸载和安装都不... 度小满金融平安金通定期90天交了 8500元,确认份额是7800元是怎么... 7800元,你会选择买苹果笔记本电脑还是学英语口语? 7800元高配电脑配置如何? .net网站调试求助Compiler Error Message: CS0246 安装scrapy 报错error: Setup script exited with error: Unable to find vcvarsall.bat 我在AIX6.1上安装的是gcc4.2.0的版本,在编译一段程序的时候报g++: Internal error: Segmentation fault windows下编译openssl出现fatal error U1077怎么解决? jspmyadmin的问题.....(http 500) IAR中(Error while running C/C++ Compiler0) ,为什么 HTTP Status 500 刚学FPGA,要用到DDR3,用qsys生成DDR3 SDRAM controller with UniPHY的时候出现下面的问题,求解,多谢 unity中运行时all compiler unity all compiler errors怎么解决? all compiler errors to be fixed before you can enter playmode unity3d 运行时出现all compiler errors ……怎么解决 unity3d导入官网示例测试游戏时显示 all compiler errors to be fixed before you can enter playmode 我在上海火车站丢东西了,请问我应该打什么电话问问,求电话 下了火车发现钱包丢到火车上应该往哪报警 在 火车站传送带弄丢东西该打什么号码? 火车g1302 遗失东西 拨打什么电话 乘客在k118次火车上掉了东西打那个电话? 蛋挞皮在冰箱里拿出来多久可以用 在动车上丢了东西,怎么找回?铁道部门有客服电话吗? fatal error C1060: compiler is out of heap space 是什么错误 如何使用word手机版 ☆什么是专注力训练课程 还完贷款才能拿到房产证吗 有哪些效果好的儿童专注力训练课程? 房贷还完,直接去银行拿房产证就可以吗? 可以提高专注力的课程是什么 有谁参加过注意力训练课程,这个注意力训练有用吗? 天津注意力训练培训班哪家好? 如果贷款买房的话,是不是房贷还完了才能拿回房产证? 如何提高企业培训时学员注意力? 很多学习机构锻炼孩子的专注力课程,真的有用吗? 贷款买房子是否是还完才可以拿到房产证? 思维科学研究所的注意力培训课程怎么样? 如何训练注意力?有哪些注意力培训机构好? 贷款还完了怎么拿房产证 哪里有注意力训练的辅导班? 按揭贷款买房是不是贷款还完以后才能拿到房产证? 集中注意力培训班哪个好 心远是什么意思,&quot;心远&quot;的汉语解释