C-Free (C)中 Process32First 和 Process32Next 运行

soft_engineer 2011-11-02 10:23:05
头定义了
#include <windows.h>
#include <tlhelp32.h>
#include <stdio.h>
当运行到Process32First()和Process32Next( )时

if ( Process32First(CreateToolhelp32Snapshot ( TH32CS_SNAPPROCESS, 0 ),&proc))

报错[Error]


F:\Program Files\C-Free Standard\temp\未命名12.cpp:14: undefined reference to `Process32First@8'
F:\Program Files\C-Free Standard\temp\未命名12.cpp:14: undefined reference to `Process32Next@8'
不知道是怎么回事,头文件都定义,有没有那个高手帮忙解决一下
...全文
122 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
soft_engineer 2011-11-02
  • 打赏
  • 举报
回复
加了还是有错,还是不行啊,你是用什么工具
luciferisnotsatan 2011-11-02
  • 打赏
  • 举报
回复
没用过C-Free
这两个函数需要的库

Library Link to Kernel32.lib.
DLL Requires Kernel32.dll.


soft_engineer 2011-11-02
  • 打赏
  • 举报
回复
哪个库文件,C-Free 在哪里添加linker搜索路径,C-Free也是没用多久,谢谢
luciferisnotsatan 2011-11-02
  • 打赏
  • 举报
回复
有没有把库所在目录加到linker搜索路径里?
luciferisnotsatan 2011-11-02
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 soft_engineer 的回复:]

加了还是有错,还是不行啊,你是用什么工具
[/Quote]
vs2005
赵4老师 2011-11-02
  • 打赏
  • 举报
回复
换VC
先来先服务算法 #include "stdio.h" #include #define max 100 #define pfree 0 /*process end*/ #define running 1 /*process running status*/ #define aready 2 /*process aready status */ #define blocking 3 /*process aready blocking status*/ typedef struct node { char name; int status; int ax,bx,cx,dx; int pc; int psw; struct node *next; /*pcb define*/ }pcb; pcb *createprocess(pcb *head) { pcb *p,*q; int a,b,c,d,m,n; char ID; q=NULL; printf("input the first seven status pcb:"); scanf("\n%c%d%d%d%d%d%d",&ID,&a,&b,&c,&d,&m,&n); while(1) { p=(pcb*)malloc(sizeof(pcb)); p->name=ID; p->ax=a; p->bx=b; p->cx=c; p->dx=d; p->pc=m; p->psw=n; p->status=aready; if(head==NULL) head=p; else q->next=p; q=p; printf("input the next seven status pcb: "); scanf("\n%c",&ID); if (ID == '*') break; scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&m,&n); } if(q!=NULL) q->next=NULL; q=head; while(q) { printf("\n process name. status.ax. bx. cx. dx. pc. psw.\n "); printf("%10c%5d%5d%5d%5d%5d%5d%5d",q->name,q->status,q->ax,q->bx,q->cx,q->dx,q->pc,q->psw); q=q->next; } return head;/*createprocess end*/ } void processfcfs(pcb *head) /*use fifo */ { pcb *p; p=head; printf("\n the process use fcfs method.\n"); printf("running the frist process:\n"); while(p!=NULL) { p->status=running; printf("\nprocess name status. ax. bx. cx. dx. pc. psw."); printf("\n%10c%5d%8d%5d%5d%5d%5d%5d",p->name,p->status,p->ax,p->bx,p->cx,p->dx,p->pc,p->psw); /*check process running status */ p->status=0; p=p->next; } printf("\n检查进程是否结束:"); p=head; while(p) { printf("\n%3c%3d",p->name,p->status); p=p->next; } printf("\ngame is over!\n"); } main() { pcb *head; head=NULL; head=createprocess(head); processfcfs(head); }
Optimize Windows system reliability and performance with Sysinternals IT pros and power users consider the free Windows Sysinternals tools indispensable for diagnosing, troubleshooting, and deeply understanding the Windows platform. In this extensively updated guide, Sysinternals creator Mark Russinovich and Windows expert Aaron Margosis help you use these powerful tools to optimize any Windows system’s reliability, efficiency, performance, and security. The authors first explain Sysinternals’ capabilities and help you get started fast. Next, they offer in-depth coverage of each major tool, from Process Explorer and Process Monitor to Sysinternals’ security and file utilities. Then, building on this knowledge, they show the tools being used to solve real-world cases involving error messages, hangs, sluggishness, malware infections, and much more. Windows Sysinternals creator Mark Russinovich and Aaron Margosis show you how to: Use Process Explorer to display detailed process and system information Use Process Monitor to capture low-level system events, and quickly filter the output to narrow down root causes List, categorize, and manage software that starts when you start or sign in to your computer, or when you run Microsoft Office or Internet Explorer Verify digital signatures of files, of running programs, and of the modules loaded in those programs Use Autoruns, Process Explorer, Sigcheck, and Process Monitor features that can identify and clean malware infestations Inspect permissions on files, keys, services, shares, and other objects Use Sysmon to monitor security-relevant events across your network Generate memory dumps when a process meets specified criteria Execute processes remotely, and close files that were opened remotely Manage Active Directory objects and trace LDAP API calls Capture detailed data about processors, memory, and clocks Troubleshoot unbootable devices, file-in-use errors, unexplained communication, and many other problems Understand Windows core concepts that aren’t well-documented elsewhere Table of Contents PART I: GETTING STARTED Chapter 1 Getting started with the Sysinternals utilities Chapter 2 Windows core concepts Chapter 3 Process Explorer Chapter 4 Autoruns PART II: USAGE GUIDE Chapter 5 Process Monitor Chapter 6 ProcDump Chapter 7 PsTools Chapter 8 Process and diagnostic utilities Chapter 9 Security utilities Chapter 10 Active Directory utilities Chapter 11 Desktop utilities Chapter 12 File utilities Chapter 13 Disk utilities Chapter 14 Network and communication utilities Chapter 15 System information utilities Chapter 16 Miscellaneous utilities PART III: TROUBLESHOOTING—“THE CASE OF THE UNEXPLAINED…” Chapter 17 Error messages Chapter 18 Crashes Chapter 19 Hangs and sluggish performance Chapter 20 Malware Chapter 21 Understanding system behavior Chapter 22 Developer troubleshooting
A tutorial about effectively building Scala projects, sbt in Action introduces the sbt tool with a simple project that establishes the fundamentals of running commands and tasks. Next, it shows you how to use the peripheral libraries in sbt to make common tasks simpler. Finally, it covers how to deploy software effectively. You’ll learn to appreciate how sbt improves the process of developing software, not just running builds. Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications. About the Technology sbt is a build tool native to Scala that can transform any build scenario into a streamlined, automated, and repeatable process. Its interactive shell lets you customize your builds on the fly, and with sbt’s unique incremental compilation feature, you can update only the parts of your project that change, without having to rebuild everything. Mastering sbt, along with the right patterns and best practices, is guaranteed to save you time and trouble on every project. About the Book sbt in Action, first and foremost, teaches you how to build Scala projects effectively. It introduces the sbt tool with a simple project that establishes the fundamentals of running commands and tasks. Next, it shows you how to use the peripheral libraries in sbt to make common tasks simpler. Along the way, you’ll work through real projects that demonstrate how to build and deploy your projects regardless of development methodology or process.

69,381

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧