Prior to declration error.

I'm pretty sure it has something to do with my global and local settings, but for the life of me, I can't seem to figure out what I'm doing wrong. I'll post my code now.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*This is a CMD installer for the driver for PSPTYPEB for x64 systems.
This was created by Deathscreton for the ease of installation.
This program creation started on 7/25/2010 at 12:28 PM and was completed at
??/??/???? at ??:??. */ 

#include <iostream>
#include <fstream>
#include "os_check.h"
#include "file_check.h"
using namespace std;


void file_check();
void os_check();

                      void file_completion()
{
                                    if (filecheck = 1)
             { cout<<"Program files present...\n";
             system("pause");
             }
             else
             {
                  cout<<"There are one or more files missing. Make sure the files are present in the folder with the installer.\n";
                  system("pause");
                  }

}



int main()
         {
             cout << "Welcome to the PSPTYPEB installer for x64 systems.\n";
             cout << "\n";
             cout << "The program will now check your system for a x64 bit OS.\n";
             cout << "\n";
             system("pause");
             os_check();
             if (oscheck == 1)
             { 
                         cout<< "This program has verified that you have a x64 bit OS running and installation will continue.\n";
                         cout << "\n"; 
                         cout<< "The program will pause for a brief moment....\n";
                         cout << "\n";
                         system("PAUSE");
                         }
                         else if (oscheck == 0)
                         {
                             cout<< "This OS is not x64 bit. Exiting application...\n";
                             system("pause");
                         
                         }
                         else
                         {
                             cout<< "There was a problem verifying your OS system. Please restart\n";
                             cout<< "the program and try again....\n";
                             system("pause");
                         }
             cout<<"The program is now running a self check to ensure that all files are intact....\n";
             file_check();
 
            
            
                    return 0;
}
                         
                         
     
                         
             


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>
#include <string>
#include <io.h> 
using namespace std;

int oscheck = 2;



void os_check()
{
     cout<< "\n";
     cout << "Now checking for x64 bit OS folders....\n";
     cout<< "\n";
if( access( "c:\\windows\\syswow64", F_OK ) != -1 ) {
    oscheck = 1;
} else {
    oscheck = 0;
}


}


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include <iostream>
#include <io.h> 
using namespace std;

int filecheck = 2;


void file_check()
{
     cout<<"Checking program files....\n";
     system("pause");
 if( access( "libusb0.dll", F_OK ) != -1 ) {
    if( access( "libusb0.sys", F_OK ) != -1 ) {
    if( access( "libusb0_x64.dll", F_OK ) != -1 ) {
    if( access( "libusb0_x64.sys", F_OK ) != -1 ) {
    if( access( "psp.cat", F_OK ) != -1 ) {
    if( access( "psp,inf", F_OK ) != -1 ) {
    if( access( "psp_x64.cat", F_OK ) != -1 ) {
    filecheck = 1;
} else {
    cout<<"psp_x64.cat is missing! Please restart or redownload!\n";
    filecheck = 2;
    system("pause");
    file_completion();
}

} else {
    cout<<"psp.inf is missing! Please restart or redownload!\n";
    filecheck = 2;
    system("pause");
    file_completion();
}

} else {
    cout<<"psp.cat is missing! Please restart or redownload!\n";
    filecheck = 2;
    system("pause");
    file_completion();
}

} else {
    cout<<"libusb0_x64.sys is missing! Please restart or redownload!\n";
    filecheck = 2;
    system("pause");
    file_completion();
}

} else {
    cout<<"libusb0_x64.dll is missing! Please restart or redownload!\n";
    filecheck = 2;
    system("pause");
    file_completion();
}

} else {
    cout<<"libusb0.sys is missing! Please restart or redownload!\n";
    filecheck = 2;
    system("pause");
    file_completion();
}

} else {
    cout<<"libusbo.dll is missing! Please restart or redownload!\n";
    filecheck = 2;
    system("pause");
    file_completion();
}


     }


And here are the errors. I've tried multiple things. Nothing has worked so far....



1
2
3
4
5
6
7
8
9
10
9 C:\Users\Riyo\Desktop\PSPTYPEB x64 installer\PSPTYPEBx64Installer.cpp In file included from C:\Users\Riyo\Desktop\PSPTYPEB x64 installer\PSPTYPEBx64Installer.cpp 

 C:\Users\Riyo\Desktop\PSPTYPEB x64 installer\file_check.h In function `void file_check()': 


24 C:\Users\Riyo\Desktop\PSPTYPEB x64 installer\file_check.h `file_completion' undeclared (first use this function)   (Each undeclared identifier is reported only once for each function it appears in.) 

 C:\Users\Riyo\Desktop\PSPTYPEB x64 installer\PSPTYPEBx64Installer.cpp In function `void file_completion()': 

17 C:\Users\Riyo\Desktop\PSPTYPEB x64 installer\PSPTYPEBx64Installer.cpp `void file_completion()' used prior to declaration 
Okay, for some reason, by adding it to both of these blocks of codes,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/
#include <iostream>
#include <fstream>
#include "os_check.h"
#include "file_check.h"
using namespace std;

void file_completion();
void file_check();
void os_check();

                      void file_completion()
{
                                    if (filecheck = 1)
             { cout<<"Program files present...\n";
             system("pause");
             }
             else
             {
                  cout<<"There are one or more files missing. Make sure the files are present in the folder with the installer.\n";
                  system("pause");
                  }

}



int main()
         {
             cout << "Welcome to the PSPTYPEB installer for x64 systems.\n";
             cout << "\n";
             cout << "The program will now check your system for a x64 bit OS.\n";
             cout << "\n";
             system("pause");
             os_check();
             if (oscheck == 1)
             { 
                         cout<< "This program has verified that you have a x64 bit OS running and installation will continue.\n";
                         cout << "\n"; 
                         cout<< "The program will pause for a brief moment....\n";
                         cout << "\n";
                         system("PAUSE");
                         }
                         else if (oscheck == 0)
                         {
                             cout<< "This OS is not x64 bit. Exiting application...\n";
                             system("pause");
                         
                         }
                         else
                         {
                             cout<< "There was a problem verifying your OS system. Please restart\n";
                             cout<< "the program and try again....\n";
                             system("pause");
                         }
             cout<<"The program is now running a self check to ensure that all files are intact....\n";
             file_check();
 
            
            
                    return 0;
}
                         
                         
     
                         
             


AND

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include <iostream>
#include <io.h> 
using namespace std;

int filecheck = 2;

void file_completion();
void file_check()
{
     cout<<"Checking program files....\n";
     system("pause");
 if( access( "libusb0.dll", F_OK ) != -1 ) {
    if( access( "libusb0.sys", F_OK ) != -1 ) {
    if( access( "libusb0_x64.dll", F_OK ) != -1 ) {
    if( access( "libusb0_x64.sys", F_OK ) != -1 ) {
    if( access( "psp.cat", F_OK ) != -1 ) {
    if( access( "psp,inf", F_OK ) != -1 ) {
    if( access( "psp_x64.cat", F_OK ) != -1 ) {
    filecheck = 1;
} else {
    cout<<"psp_x64.cat is missing! Please restart or redownload!\n";
    filecheck = 2;
    system("pause");
    file_completion();
}

} else {
    cout<<"psp.inf is missing! Please restart or redownload!\n";
    filecheck = 2;
    system("pause");
    file_completion();
}

} else {
    cout<<"psp.cat is missing! Please restart or redownload!\n";
    filecheck = 2;
    system("pause");
    file_completion();
}

} else {
    cout<<"libusb0_x64.sys is missing! Please restart or redownload!\n";
    filecheck = 2;
    system("pause");
    file_completion();
}

} else {
    cout<<"libusb0_x64.dll is missing! Please restart or redownload!\n";
    filecheck = 2;
    system("pause");
    file_completion();
}

} else {
    cout<<"libusb0.sys is missing! Please restart or redownload!\n";
    filecheck = 2;
    system("pause");
    file_completion();
}

} else {
    cout<<"libusbo.dll is missing! Please restart or redownload!\n";
    filecheck = 2;
    system("pause");
    file_completion();
}


     }


caused the code to compile without error. However, I'm not receiving the results I want. I'm still receiving a "all files present" message when I should be receiving a "One or more files are missing..." message. Any ideas?
Found the problem. With all my elses in the .h file with the missing errors, I need single "=" and double '=' in the file completion function. I can't figure out how I fixed the function though, even though it is fixed, I'd still like someone to clarify.
Topic archived. No new replies allowed.