相关疑难解决方法(0)

错误C3861:'_ tcsdup':找不到标识符

这是我的第一次,我想使用Windows CreateProcess函数进行并行处理.根据MSDN上的示例,我创建了一个LPTSTR"(非常量)TCHAR字符串" 命令行参数,如下所示

LPTSTR szCmdline[] = _tcsdup(TEXT("\C:\\MyProgram_linux_1.1\\MyProgram.exe") );
Run Code Online (Sandbox Code Playgroud)

这里讨论 LPTSTR和其他char和字符串类型

命令行参数传递给CreateProcess这样

if (!CreateProcess(NULL, szCmdline, /*...*/) ) cout << "ERROR: cannot start CreateProcess" << endl;
Run Code Online (Sandbox Code Playgroud)

并且这些标题存在

#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <strsafe.h>
#include <direct.h>
Run Code Online (Sandbox Code Playgroud)

在编译时这是错误:

error C3861: '_tcsdup': identifier not found
Run Code Online (Sandbox Code Playgroud)

搜索此错误发现相同的错误,但解决方案特定于使用.NET框架而不是解释error C3861: '_tcsdup'

不知道是否有关,但也有一个error C2059: syntax error : ')'if (!CreateProcess(NULL, szCmdline, /*...*/) ) cout << "ERROR: cannot start CreateProcess" << endl;

这个错误是如何修复的?而且,这是怎么回事?

此外,我正在使用CreateProcess学习Linux …

c++ fork createprocess lptstr visual-studio-2008

5
推荐指数
1
解决办法
4520
查看次数

标签 统计

c++ ×1

createprocess ×1

fork ×1

lptstr ×1

visual-studio-2008 ×1