Advertisement

07.08.2008 at 10:57AM PDT, ID: 23547598
[x]
Attachment Details

Debugging errors

Asked by rishab2905 in Windows 64-bit, C++ Programming Language, Windows XP Operating System

Hi all, i am writing a windows service and i am able to run the code because of the following errors in DEV-C++ Compiler
 C:\Dev-Cpp\Install Service.cpp In function `void ShowErr()':
35 C:\Dev-Cpp\Install Service.cpp `cout' undeclared (first use this function)
                                                                (Each undeclared identifier is reported only once for each function it appears in.)
  C:\Dev-Cpp\Makefile.win [Build Error]  ["Install Service.o"] Error 1
 The code goes like this:

//#include <iostream.h>
#include <windows.h>
#include <winsvc.h>

void ShowErr();

int main(int argc, char* argv[])
{
      SC_HANDLE AbhiService,scm;
      scm=OpenSCManager(0,0,SC_MANAGER_CREATE_SERVICE);
      if(!scm)
      {
            ShowErr();
            return 1;
      }
      AbhiService=CreateService(scm,"AbhiService",
            "Beeper's first service",
            SERVICE_ALL_ACCESS,SERVICE_WIN32_OWN_PROCESS,SERVICE_DEMAND_START,
            SERVICE_ERROR_NORMAL,
            "D:\\Abhi\\FirstService\\Debug\\FirstService.exe",
            0,0,0,0,0);
      if(!AbhiService)
      {
            CloseServiceHandle(scm);
            ShowErr();
            return 1;
      }
      CloseServiceHandle(AbhiService);
      CloseServiceHandle(scm);
      return 0;
}

void ShowErr()
{
      cout << "Error" << "\r\n";
}




can anyone please clarify what can be done?
Start Free Trial
[+][-]07.08.2008 at 11:05AM PDT, ID: 21956363

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 11:06AM PDT, ID: 21956377

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 11:35AM PDT, ID: 21956669

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 11:41AM PDT, ID: 21956727

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 11:49AM PDT, ID: 21956807

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 11:54AM PDT, ID: 21956867

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 12:00PM PDT, ID: 21956926

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 12:26PM PDT, ID: 21957232

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 12:35PM PDT, ID: 21957342

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 12:39PM PDT, ID: 21957377

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 01:00PM PDT, ID: 21957620

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 01:13PM PDT, ID: 21957765

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 01:37PM PDT, ID: 21958001

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 02:05PM PDT, ID: 21958248

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 03:55PM PDT, ID: 21959112

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 03:58PM PDT, ID: 21959145

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 04:03PM PDT, ID: 21959182

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.09.2008 at 12:16AM PDT, ID: 21961205

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Windows 64-bit, C++ Programming Language, Windows XP Operating System
Sign Up Now!
Solution Provided By: Infinity08
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906