错误C3861:'

编程入门 行业动态 更新时间:2024-10-22 20:34:58
本文介绍了错误C3861:'_tcsdup':未找到标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

这是我第一次,我想使用windows进行并行处理 CreateProcess 函数。根据MSDN上的示例,我创建了一个 LPTSTR (non-const)TCHAR string command line argument like this

This is my first time and I'd like to make a parallel process using the windows CreateProcess function. Based on the example at MSDN I created a LPTSTR "(non-const) TCHAR string" command line argument like this

LPTSTR szCmdline[] = _tcsdup(TEXT("\C:\\MyProgram_linux_1.1\\MyProgram.exe") );

LPTSTR等此处讨论字符和字符串类型

命令行参数传递给 CreateProcess 像这样

The command line argument is passed to CreateProcess like this

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

这些标题存在

#include <stdio.h> #include <stdlib.h> #include <windows.h> #include <strsafe.h> #include <direct.h>

编译时出现错误:

error C3861: '_tcsdup': identifier not found

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

不确定是否相关,但在 if(!CreateProcess(NULL))上还有错误C2059:语法错误:')' ,szCmdline,/*...*/))cout < ERROR:can not start CreateProcess<< endl;

Not sure if it related but there is also an error C2059: syntax error : ')' on the if (!CreateProcess(NULL, szCmdline, /*...*/) ) cout << "ERROR: cannot start CreateProcess" << endl;

此错误如何修复?

此外,我使用的是 fork()的学习步骤 c $ c> 函数 - Visual Studio接口更容易使用,一旦这被调试和工作,我将更改到g ++界面,并更改为 fork()并从那里调试 - 所以一个解决方案,导致 fork(),如果可能,是最有益的。

Also, I am using the CreateProcess as a learning step towards learning the Linux fork() function - the Visual Studio interface is easier for me to use and once this is debugged and works, I will change to the g++ interface and change to fork() and debug from there - so a solution that leads to fork(), if possible, is the most beneficial.

推荐答案

添加以下内容:

#include <tchar.h>

更多推荐

错误C3861:'

本文发布于:2023-10-07 15:24:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1469763.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!