:'( please help us, we´re trying to make a server client program
this is the code
.486 ; Crea codigo de 32 bits
.model flat, stdcall ; 32 bit Modelo de memoria
option casemap :none ; case sensitive
include \masm32\include\windows.inc ; Librerias de windowns
include \masm32\macros\macros.asm ; Macros preconstruidos
; --------------------------------------------------
; include archivos para el llamado de las funciones
; --------------------------------------------------
include \masm32\include\masm32.inc
include \masm32\include\gdi32.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\wsock32.inc
; ------------------------------------------------
; Librerias con funciones
; ------------------------------------------------
includelib \masm32\lib\masm32.lib
includelib \masm32\lib\gdi32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\wsock32.lib
and this is the error
Assembling: C:\masm32\chat\Client.asm
\masm32\include\wsock32.inc(84) : warning A4006: too many arguments in macro call
switch(1): Macro Called From
\masm32\include\wsock32.inc(84): Include File
\masm32\include\wsock32.inc(84) : error A2008: syntax error : PROTO
switch(1): Macro Called From
\masm32\include\wsock32.inc(84): Include File
Posting the erroneous code would be helpful ::) :wink
EDIT:
Welcome in here, btw :8)
nadie,
There is not much that we can do to help you at this point. Can you attach the .asm file (or the entire project)?
Paul
thanks for all, here is the code and .exe
[attachment deleted by admin]
Hi nadie,
because you included the macros.asm file before the wsock32.inc masm thinks that "select" is an alias for the "switch" macro and not the wsock function.
I was looking for some directive like "undef" for C but I just found "purge" which seems to do the same job in masm.
You should purge "select" after the include for macro.asm and before the include for wsock32.inc.
E.g.:
[...]
.486 ; Crea codigo de 32 bits
.model flat, stdcall ; 32 bit Modelo de memoria
option casemap :none ; case sensitive
include \masm32\include\windows.inc ; Librerias de windowns
include \masm32\macros\macros.asm ; Macros preconstruidos
purge select
; --------------------------------------------------
; include archivos para el llamado de las funciones
; --------------------------------------------------
include \masm32\include\masm32.inc
include \masm32\include\gdi32.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\wsock32.inc
[...]
Then it will assemble without probs.
Regards
Both files assemble without error on my system, whether macros.asm is included before or after wsock32.inc and wsock32.lib.
Hi nadie,
The suggestion made by mnemonic works fine. I tried several other things and the best I ever got was a symbol redefinition error (select)
Anyway, use purge select and also remove
include \masm32\include\user32.inc
and
includelib \masm32\lib\user32.lib
as they are not being used and will generate a warning.
hth,
Paul
BTW, there nothing like "undef" in MASM unfortunately, not even "purge" works that way. Purge just makes the macro blank.
The worsest thing is you can't undefine text macro in MASM :( All you can do is redefine it using some tricks.
thanks for the help, the error message dont appear, but when i run the program, it show "cant initialize the winsock.dll", please help me.
Nadie :'(
Hi nadie,
To avoid errors working with winsock functions, you must download the last version of MASM32 (8.2) and the corresponding last service pack.
Ramon