C++ compile error !

Pages: 12
Hey !

I've tried several time to compile and coorect the messy code of a server software, and unfortunately all my attemps result in the same 5 errors :

Line 4 : C:\Users\XXX\Desktop\XXX\XXX\system\addlicense.cpp In file included from ../../../Users/XXX/Desktop/XXX/XXX/system/addlicense.cpp

Line 36 C:\Users\XXX\Desktop\XXX\XXX\license.h `OPERATION_LOCK' does not name a type

( No line ? ) C:\Users\XXX\Desktop\XXX\XXX\system\addlicense.cpp In function `int main(int, char**)':

Line 143 C:\Users\XXX\Desktop\XXX\XXX\system\addlicense.cpp `CreateLicenseList' undeclared (first use this function)

( No line ) (Each undeclared identifier is reported only once for each function it appears in.)

I precise that I tried to compile with Windows 7 using Dev C++ ( all versions brings the same erros. ) I've tried with Liunx too.
Here's the two files that causes problem :
addlicense.cpp

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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
#include <windows.h>
#include <stdio.h>

#include "../license.h"

// add a license
// addlicense.exe file:<filename> add bbuser:<username> bbpass:<password> serial:<serialNumber> access:<accesskey> pass:<gcpassword> priv:<privileges>

// delete a license
// addlicense.exe file:<filename> delete find:<options>

// modify a license
// addlicense.exe file:<filename> modify find:<options> <newoptions>

// unban a license
// addlicense.exe file:<filename> unban find:<options>

// display a license
// addlicense.exe file:<filename> info find:<options>

// parses a command line option.
DWORD parseoption(LICENSE* l,char* option)
{
    if (!memcmp(option,"bbuser:",7))
    {
        strcpy(l->username,&option[7]);
        return LICENSE_CHECK_USERNAME;
    } else if (!memcmp(option,"bbpass:",7))
    {
        strcpy(l->password,&option[7]);
        return LICENSE_CHECK_PASSWORD;
    } else if (!memcmp(option,"serial:",7))
    {
        if ((option[7] == '0') && ((option[8] == 'x') || (option[8] == 'X'))) sscanf(&option[9],"%X",&l->serialNumber);
        else sscanf(&option[7],"%d",&l->serialNumber);
        return LICENSE_CHECK_SERIALNUMBER;
    } else if (!memcmp(option,"access:",7))
    {
        strcpy(l->accessKey,&option[7]);
        return LICENSE_CHECK_ACCESSKEY;
    } else if (!memcmp(option,"pass:",5))
    {
        strcpy(l->password2,&option[5]);
        return LICENSE_CHECK_GC_PASSWORD;
    } else if (!memcmp(option,"priv:",5))
    {
        if ((option[5] == '0') && ((option[6] == 'x') || (option[6] == 'X'))) sscanf(&option[7],"%X",&l->privileges);
        else sscanf(&option[5],"%d",&l->privileges);
        return LICENSE_CHECK_PRIVILEGES;
    }
    return 0;
}

DWORD scanFlags = 0,replaceFlags = 0;

int deletelicenseenumproc(LICENSE_LIST* list,int index,LICENSE* l,long param)
{
    bool success;
    if (DeleteLicense(list,index))
    {
        printf("> > license deleted: %08X\n",l->serialNumber);
        return (-1);
    }
    printf("> > license could not be deleted: %08X\n",l->serialNumber);
    return 1;
}

int modifylicenseenumproc(LICENSE_LIST* list,int index,LICENSE* l,LICENSE* lnew)
{
    bool success;
    printf("> > license modified: %08X\n",l->serialNumber);
    if (replaceFlags & LICENSE_CHECK_USERNAME) strcpy(l->username,lnew->username);
    if (replaceFlags & LICENSE_CHECK_PASSWORD) strcpy(l->password,lnew->password);
    if (replaceFlags & LICENSE_CHECK_SERIALNUMBER) l->serialNumber = lnew->serialNumber;
    if (replaceFlags & LICENSE_CHECK_ACCESSKEY) strcpy(l->accessKey,lnew->accessKey);
    if (replaceFlags & LICENSE_CHECK_GC_PASSWORD) strcpy(l->password2,lnew->password2);
    if (replaceFlags & LICENSE_CHECK_PRIVILEGES) l->privileges = lnew->privileges;
    return 1;
}

int unbanlicenseenumproc(LICENSE_LIST* list,int index,LICENSE* l,long param)
{
    bool success;
    memset(&l->banTime,0,sizeof(FILETIME));
    printf("> > license unbanned: %08X\n",l->serialNumber);
    return 1;
}

int infolicenseenumproc(LICENSE_LIST* list,int index,LICENSE* l,long param)
{
    bool success;
    printf("> blue burst user/pass: %s %s\n",l->username,l->password);
    printf("> gc serial/access/password: %08X %s %s\n",l->serialNumber,l->accessKey,l->password2);
    printf("> privilege flags/ban time: %08X %08X%08X\n\n",l->privileges,l->banTime.dwHighDateTime,l->banTime.dwLowDateTime);
    return 1;
}

int main(int argc,char* argv[])
{
    printf("> fuzziqer software newserv license editor\n\n");

    char filename[MAX_PATH];
    DWORD x,flagsTemp;
    LICENSE_LIST* list;
    LICENSE lold,lnew;
    memset(&lold,0,sizeof(LICENSE));
    memset(&lnew,0,sizeof(LICENSE));

    bool result;
    DWORD action = 0; // 1 = add, 2 = delete, 3 = modify, 4 = unban, 5 = get info
    DWORD numFailures = 0,numChanges;
    for (x = 1; x < argc; x++)
    {
        result = true;
             if (!memcmp(argv[x],"add",3)) action = 1;
        else if (!memcmp(argv[x],"delete",6)) action = 2;
        else if (!memcmp(argv[x],"modify",6)) action = 3;
        else if (!memcmp(argv[x],"unban",5)) action = 4;
        else if (!memcmp(argv[x],"info",4)) action = 5;
        else if (!memcmp(argv[x],"file:",5)) strcpy(filename,&argv[x][5]);
        else if (!memcmp(argv[x],"find:",5))
        {
            flagsTemp = parseoption(&lold,&argv[x][5]);
            if (!flagsTemp)
            {
                printf("> > error: unknown find option: %s\n",&argv[x][5]);
                numFailures++;
            } else scanFlags |= flagsTemp;
        } else {
            flagsTemp = parseoption(&lnew,argv[x]);
            if (!flagsTemp)
            {
                printf("> > error: unknown option: %s\n",argv[x]);
                numFailures++;
            } else replaceFlags |= flagsTemp;
        }
    }

    list = LoadLicenseList(filename);
    if (!list)
    {
        printf("> > warning: license file not found, creating a new one\n");
        list = CreateLicenseList();
        if (!list)
        {
            printf("> > use the [file:<filename>] option to specify the file name\n");
            numFailures++;
        } else strcpy(list->filename,filename);
    }
    if (numFailures) return (-1);

    switch (action)
    {
      case 1: // add license
        if (AddLicense(list,&lnew)) printf("> > license added\n");
        else printf("> > error!\n");
        break;
      case 2: // delete license
        if (!scanFlags) printf("> > error: no scan flags specified\n> > use at least one [find:] directive\n");
        else {
            numChanges = EnumLicenses(list,scanFlags,&lold,(LicenseEnumProc)deletelicenseenumproc,0);
            printf("> > %d licenses deleted\n",numChanges);
        }
        break;
      case 3: // modify license
        if (!scanFlags) printf("> > error: no scan flags specified\n> > use at least one [find:] directive\n");
        else {
            numChanges = EnumLicenses(list,scanFlags,&lold,(LicenseEnumProc)modifylicenseenumproc,(long)(&lnew));
            printf("> > %d licenses modified\n",numChanges);
        }
        break;
      case 4: // unban license
        if (!scanFlags) printf("> > error: no scan flags specified\n> > use at least one [find:] directive\n");
        else {
            numChanges = EnumLicenses(list,scanFlags,&lold,(LicenseEnumProc)unbanlicenseenumproc,0);
            printf("> > %d licenses unbanned\n",numChanges);
        }
        break;
      case 5: // show license
        if (!scanFlags) printf("> > error: no scan flags specified\n> > use at least one [find:] directive\n");
        else {
            numChanges = EnumLicenses(list,scanFlags,&lold,(LicenseEnumProc)infolicenseenumproc,0);
            printf("> > %d licenses listed\n",numChanges);
        }
        break;
    }
    if (!SaveLicenseList(list)) printf("> > error: couldn't save the license list\n");

    system("PAUSE>NUL");

    return 0;
}
Last edited on
License.h

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
// credentials to verify for VerifyLicense and similar functions
#define LICENSE_VERIFY_BLUEBURST        0x00000001 // verify BB username
#define LICENSE_VERIFY_GAMECUBE         0x00000002 // verify GC serial number/access key
#define LICENSE_VERIFY_PC               0x00000004 // verify PC serial number/access key
#define LICENSE_VERIFY_SERIALNUMBER     0x00000008 // verify serial number only
#define LICENSE_VERIFY_CHECK_PASSWORD   0x00000010 // verify password also (this flag must be combined with one of the above)

// credentials to search for using EnumLicenses (can be combined)
#define LICENSE_CHECK_USERNAME          0x00000001 // search by username
#define LICENSE_CHECK_PASSWORD          0x00000002 // search by password
#define LICENSE_CHECK_SERIALNUMBER      0x00000004 // search by serial number
#define LICENSE_CHECK_ACCESSKEY         0x00000008 // search by access key
#define LICENSE_CHECK_GC_PASSWORD       0x00000010 // search by GC password
#define LICENSE_CHECK_PRIVILEGES        0x00000020 // search by privileges

// errors
#define LICENSE_RESULT_INVALID_CALL   (-1) // invalid arguments
#define LICENSE_RESULT_OK             0 // no error
#define LICENSE_RESULT_NOTFOUND       1 // license not found
#define LICENSE_RESULT_WRONGPASS      2 // wrong password
#define LICENSE_RESULT_BANNED         3 // license is banned

// a license.
typedef struct {
    char username[20]; // BB username (max. 16 chars; should technically be Unicode)
    char password[20]; // BB password (max. 16 chars)
    unsigned long serialNumber; // PC/GC serial number. MUST BE PRESENT FOR BB LICENSES TOO; this is also the player's guild card number.
    char accessKey[16]; // PC/GC access key. (to log in using PC on a GC license, just enter the first 8 characters of the GC access key)
    char password2[12]; // GC password
    long privileges; // privilege level
    FILETIME banTime; // end time of ban (zero = not banned)
} LICENSE;

// a loaded list of licenses
typedef struct {
    OPERATION_LOCK operation;
    char filename[260];
    unsigned long numLicenses;
    LICENSE* licenses;
} LICENSE_LIST;

typedef int (*LicenseEnumProc)(LICENSE_LIST* list,DWORD index,LICENSE* l,long param); // returns <0: run that one again, =0: stop enumerating, >0: continue

LICENSE_LIST* LoadLicenseList(char* filename);
bool SaveLicenseList(LICENSE_LIST* li);
void DestroyLicenseList(LICENSE_LIST* li);

int VerifyLicense(LICENSE_LIST* li,LICENSE* l,long verifyWhat);
int SetUserBan(LICENSE_LIST* li,LICENSE* l,long verifyWhat,DWORD seconds);

unsigned int FindLicense(LICENSE_LIST* li,unsigned long serialNumber);
bool AddLicense(LICENSE_LIST* li,LICENSE* l);
bool DeleteLicense(LICENSE_LIST* li,long index);

int EnumLicenses(LICENSE_LIST* list,DWORD filter,LICENSE* criteria,LicenseEnumProc proc,long param);
Last edited on
Thanks to anyone tried to help me !
Where are OPERATION_LOCK and the function CreateLicenseList() defined? The compiler can't find those.

If you can add code tags, it would make the posts easier to read and put line numbers on the code. (You can edit a post, highlight the code, then click the <> button to the right of the post to add tags.)

Line 4 : C:\Users\XXX\Desktop\XXX\XXX\system\addlicense.cpp In file included from ../../../Users/XXX/Desktop/XXX/XXX/system/addlicense.cpp

Line 36 C:\Users\XXX\Desktop\XXX\XXX\license.h `OPERATION_LOCK' does not name a type

1
2
3
4
5
6
7
// a loaded list of licenses
typedef struct {
OPERATION_LOCK operation; // <--- ?
char filename[260];
unsigned long numLicenses;
LICENSE* licenses;
} LICENSE_LIST;



( No line ? ) C:\Users\XXX\Desktop\XXX\XXX\system\addlicense.cpp In function `int main(int, char**)':

Line 143 C:\Users\XXX\Desktop\XXX\XXX\system\addlicense.cpp `CreateLicenseList' undeclared (first use this function)

1
2
3
4
5
list = LoadLicenseList(filename);
if (!list)
{
printf("> > warning: license file not found, creating a new one\n");
list = CreateLicenseList();// <---- ? 
Hey, thanks for trying to help me

Well, OPERATION_LOCK Seem to be defined in operation.s file (.asm ) :
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
72
73
74
75
76
77
78
79
80
section .text

global _operation_lock@4
global _operation_unlock@4

extern _Sleep@4
extern _GetTickCount@0
extern _GetCurrentThreadId@0

; operation_lock: this function locks a resource using its OPERATION_LOCK structure.
; in newserv, the OPERATION_LOCK comes first in any resource structure, so any
; resource can be locked by simply passing the resource to operation_lock.
_operation_lock@4:
    push ebx
    push edx
    push ecx
    push eax
    call _GetCurrentThreadId@0
    push eax
    mov edx, [esp+0x18]
    mov ecx, [edx+0x08]
    cmp eax, ecx
    jne _operation_lock_if1_false
    inc dword [edx+0x0C]
    jmp _operation_lock_end
  _operation_lock_if1_false:
    mov edx, [esp+0x18]
    cmp dword [edx+0x08], 0x00000000
    je _operation_lock_lock
    push 0x00000005
    call _Sleep@4
    jmp _operation_lock_if1_false
  _operation_lock_lock:
    mov edx, [esp+0x18]
    mov eax, [esp]
    mov [edx+0x08], eax
    mov ecx, [edx+0x08]
    cmp ecx, eax
    jne _operation_lock_if1_false
    mov ecx, [esp+0x14]
    mov [edx], ecx
    call _GetTickCount@0
    mov edx, [esp+0x18]
    mov [edx+0x04], eax
    mov dword [edx+0x0C], 0x00000001
  _operation_lock_end:
    add esp, 4
    pop eax
    pop ecx
    pop edx
    pop ebx
    ret 4

; operation_unlock: unlocks a locked resource. raises an exception (int 03) if
; the object is locked by another thread.
_operation_unlock@4:
    push edx
    push ecx
    push eax
    call _GetCurrentThreadId@0
    mov edx, [esp+0x10]
    cmp [edx+0x08], eax
    je _operation_unlock_threadIDOk
    int 03
  _operation_unlock_threadIDOk:
    cmp dword [edx+0x0C], 0x00000000
    jne _operation_unlock_lockCountOk
    int 03
  _operation_unlock_lockCountOk:
    dec dword [edx+0x0C]
    cmp dword [edx+0x0C], 0x00000000
    jne _operation_unlock_end
    mov dword [edx], 0x00000000
    mov dword [edx+0x04], 0x00000000
    mov dword [edx+0x08], 0x00000000
  _operation_unlock_end:
    pop eax
    pop ecx
    pop edx
    ret 4


Or operation.h :

1
2
3
4
5
6
7
8
9
10
11
12
// Structure used to lock resources (spinlock) 
typedef struct {
    void* pcOriginalRequester;
    unsigned long time;
    unsigned long threadID;
    unsigned long lockCount;
} OPERATION_LOCK;

extern "C" {
    void __stdcall operation_lock(void* oper);
    void __stdcall operation_unlock(void* oper);
};
?
I think those kind of problems should be detected before compiling. in C++ it is important to work slowly and consider all the problems and errors may happen. If you are having troubles doing that you can try any program to do it. I use Checkmarx so it might help.
Don't forget to consider all possibilities.
Best regards.
Ben.
Not an answer since this isn't my code, i cannot detect any problem before the compilation since this doesn't have been writtent by me.
its hard to unravel. Is there an actual error on line 4, the first thing you listed? What did that say, exactly?

Operation_lock is defined as a struct in operation.h. If it isn't seeing that, it will blow up, which seems to be the issue below, but c++ is bad about one error creating another. If there was a real error on line 4, all the rest of it could be compiler confusion. You have to solve the first error first, then try again.

If line 4 isn't an error, somewhere your incudes are scrambled and it isn't seeing operation.h where it needs to in order to understand that struct.
Well, Operation_LOCK is seem to be defined in operation.s file, but if i Include the operation.s file in compilation I get error 255...

The line 4 is actually an error, it does not find the license.h file, but this is a lie since there's both on the same location.
The line 4 is actually an error, it does not find the license.h file, but this is a lie since there's both on the same location.

If it is indeed complaining about not being able to include a file, it isn't lying. Just assuming a compiler error served up to you is mistaken when it always turns up is.. well, silly.

You say the files are in the same location, but the compiler doesn't expect them to be in the same location because the code tells the compiler it is not: #include "../license.h"

The two dots/forward slash are instructions to look in the parent directory.
Well, this problem seem to be resolved,
now I've got this error :

[Linker error] undefined reference to `operation_unlock@4'
[Linker error] undefined reference to `__chkstk_ms'
more undefined references to `__chkstk_ms' follow
[Linker error] undefined reference to `operation_lock@4'
[Linker error] undefined reference to `inet_addr@4'
[Linker error] undefined reference to `gethostbyname@4'
[Linker error] undefined reference to `WSACleanup@0'
[Linker error] undefined reference to `inet_ntoa@4'
[Linker error] undefined reference to `WSAStartup@8'

all of them are errors multiple times.
Using dev-c++ I've tried to link the operation.s asm file to the project, but i've always got the same error, strange since operation.s contain all of them fonctions.

?
You need to add the appropriate library. For WSAStartup:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms742213(v=vs.85).aspx

Ws2_32.lib
Thanks, now they're only the chkstk_ms error !
Resolved also.

Final errors are in operation.s files, who effectively define operation_lock and some others vital functions for the program.

There's all the errors alongside with the operation.s file. If someone can help me to pass the final step to make this work, i'll be very happy.

Operation.s file :

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
72
73
74
75
76
77
78
79
80
section .text

global _operation_lock@4
global _operation_unlock@4

extern _Sleep@4
extern _GetTickCount@0
extern _GetCurrentThreadId@0

; operation_lock: this function locks a resource using its OPERATION_LOCK structure.
; in newserv, the OPERATION_LOCK comes first in any resource structure, so any
; resource can be locked by simply passing the resource to operation_lock.
_operation_lock@4:
    push ebx
    push edx
    push ecx
    push eax
    call _GetCurrentThreadId@0
    push eax
    mov edx, [esp+0x18]
    mov ecx, [edx+0x08]
    cmp eax, ecx
    jne _operation_lock_if1_false
    inc dword [edx+0x0C]
    jmp _operation_lock_end
  _operation_lock_if1_false:
    mov edx, [esp+0x18]
    cmp dword [edx+0x08], 0x00000000
    je _operation_lock_lock
    push 0x00000005
    call _Sleep@4
    jmp _operation_lock_if1_false
  _operation_lock_lock:
    mov edx, [esp+0x18]
    mov eax, [esp]
    mov [edx+0x08], eax
    mov ecx, [edx+0x08]
    cmp ecx, eax
    jne _operation_lock_if1_false
    mov ecx, [esp+0x14]
    mov [edx], ecx
    call _GetTickCount@0
    mov edx, [esp+0x18]
    mov [edx+0x04], eax
    mov dword [edx+0x0C], 0x00000001
  _operation_lock_end:
    add esp, 4
    pop eax
    pop ecx
    pop edx
    pop ebx
    ret 4

; operation_unlock: unlocks a locked resource. raises an exception (int 03) if
; the object is locked by another thread.
_operation_unlock@4:
    push edx
    push ecx
    push eax
    call _GetCurrentThreadId@0
    mov edx, [esp+0x10]
    cmp [edx+0x08], eax
    je _operation_unlock_threadIDOk
    int 03
  _operation_unlock_threadIDOk:
    cmp dword [edx+0x0C], 0x00000000
    jne _operation_unlock_lockCountOk
    int 03
  _operation_unlock_lockCountOk:
    dec dword [edx+0x0C]
    cmp dword [edx+0x0C], 0x00000000
    jne _operation_unlock_end
    mov dword [edx], 0x00000000
    mov dword [edx+0x04], 0x00000000
    mov dword [edx+0x08], 0x00000000
  _operation_unlock_end:
    pop eax
    pop ecx
    pop edx
    ret 4




Errors :

"../../../Users/x/Desktop/x/x/operation.s"

../../../Users/x/Desktop/x/x/operation.s: Assembler messages:
../../../Users/x/Desktop/x/x/operation.s:1: Error: no such instruction: `section .text'
../../../Users/x/Desktop/x/x/operation.s:3: Error: no such instruction: `global _operation_lock@4'
../../../Users/x/Desktop/x/x/operation.s:4: Error: no such instruction: `global _operation_unlock@4'
../../../Users/x/Desktop/x/x/operation.s:6: Error: no such instruction: `extern _Sleep@4'

../../../Users/x/Desktop/x/x/operation.s:7: Error: no such instruction: `extern _GetTickCount@0'
../../../Users/x/Desktop/x/x/operation.s:8: Error: no such instruction: `extern _GetCurrentThreadId@0'
../../../Users/x/Desktop/x/x/operation.s:10: Error: no such instruction: `this function locks a resource using its OPERATION_LOCK structure.'

../../../Users/x/Desktop/x/x/operation.s:11: Error: too many memory references for `in'
../../../Users/x/Desktop/x/x/operation.s:12: Error: no such instruction: `resource can be locked by simply passing the resource to operation_lock.'
../../../Users/x/Desktop/x/x/operation.s:20: Error: invalid char '[' beginning operand 2 `[esp+0x18]'
../../../Users/x/Desktop/x/x/operation.s:21: Error: invalid char '[' beginning operand 2 `[edx+0x08]'
../../../Users/x/Desktop/x/x/operation.s:22: Error: too many memory references for `cmp'
../../../Users/x/Desktop/x/x/operation.s:24: Error: junk `[edx+0x0C]' after expression
../../../Users/x/Desktop/x/x/operation.s:24: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
../../../Users/x/Desktop/x/x/operation.s:27: Error: invalid char '[' beginning operand 2 `[esp+0x18]'
../../../Users/x/Desktop/x/x/operation.s:28: Error: junk `[edx+0x08]' after expression
../../../Users/x/Desktop/x/x/operation.s:28: Error: too many memory references for `cmp'
../../../Users/x/Desktop/x/x/operation.s:34: Error: invalid char '[' beginning operand 2 `[esp+0x18]'
../../../Users/x/Desktop/x/x/operation.s:35: Error: invalid char '[' beginning operand 2 `[esp]'
../../../Users/x/Desktop/x/x/operation.s:36: Error: invalid char '[' beginning operand 1 `[edx+0x08]'
../../../Users/x/Desktop/x/x/operation.s:37: Error: invalid char '[' beginning operand 2 `[edx+0x08]'
../../../Users/x/Desktop/x/x/operation.s:38: Error: too many memory references for `cmp'
../../../Users/x/Desktop/x/x/operation.s:40: Error: invalid char '[' beginning operand 2 `[esp+0x14]'
../../../Users/x/Desktop/x/x/operation.s:41: Error: invalid char '[' beginning operand 1 `[edx]'
../../../Users/x/Desktop/x/x/operation.s:43: Error: invalid char '[' beginning operand 2 `[esp+0x18]'
../../../Users/x/Desktop/x/x/operation.s:44: Error: invalid char '[' beginning operand 1 `[edx+0x04]'
../../../Users/x/Desktop/x/x/operation.s:45: Error: junk `[edx+0x0C]' after expression
../../../Users/x/Desktop/x/x/operation.s:45: Error: too many memory references for `mov'
../../../Users/x/Desktop/x/x/operation.s:47: Error: too many memory references for `add'
../../../Users/x/Desktop/x/x/operation.s:52: Error: suffix or operands invalid for `ret'
../../../Users/x/Desktop/x/x/operation.s:54: Error: no such instruction: `unlocks a locked resource. raises an exception (int 03)if'
../../../Users/x/Desktop/x/x/operation.s:55: Error: no such instruction: `the object is locked by another thread.'
../../../Users/x/Desktop/x/x/operation.s:61: Error: invalid char '[' beginning operand 2 `[esp+0x10]'
../../../Users/x/Desktop/x/x/operation.s:62: Error: invalid char '[' beginning operand 1 `[edx+0x08]'
../../../Users/x/Desktop/x/x/operation.s:64: Error: suffix or operands invalid for `int'
../../../Users/x/Desktop/x/x/operation.s:66: Error: junk `[edx+0x0C]' after expression
../../../Users/x/Desktop/x/x/operation.s:66: Error: too many memory references for `cmp'
../../../Users/x/Desktop/x/x/operation.s:68: Error: suffix or operands invalid for `int'
../../../Users/x/Desktop/x/x/operation.s:70: Error: junk `[edx+0x0C]' after expression
../../../Users/x/Desktop/x/x/operation.s:70: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
../../../Users/x/Desktop/x/x/operation.s:71: Error: junk `[edx+0x0C]' after expression
../../../Users/x/Desktop/x/x/operation.s:71: Error: too many memory references for `cmp'
../../../Users/x/Desktop/x/x/operation.s:73: Error: junk `[edx]' after expression
../../../Users/x/Desktop/x/x/operation.s:73: Error: too many memory references for `mov'
../../../Users/x/Desktop/x/x/operation.s:74: Error: junk `[edx+0x04]' after expression
../../../Users/x/Desktop/x/x/operation.s:74: Error: too many memory references for `mov'
../../../Users/x/Desktop/x/x/operation.s:75: Error: junk `[edx+0x08]' after expression
../../../Users/x/Desktop/x/x/operation.s:75: Error: too many memory references for `mov'
../../../Users/x/Desktop/x/x/operation.s:80: Error: suffix or operands invalid for `ret'
It seems that the compiler does not recognize operation.s as assembler. Maybe you need to change the extension of the file.
Interesting, have you any suggestion or i have to find my by myself the extension ?
It looks like extension is not the solution. Check this out:

http://matoqui.tripod.com/Software/tutorial.htm
Pages: 12