The MASM Forum Archive 2004 to 2012

Project Support Forums => MASM32 => Topic started by: ToutEnMasm on August 24, 2011, 11:59:21 AM

Title: compatibility between the masm32 lib and c++ project
Post by: ToutEnMasm on August 24, 2011, 11:59:21 AM
Hello,
There is problem when i try to use the masm32 lib with c++ code using the crt.
The linker say  that the masm32 want this crt lib and the c++ want this other lib and the two cannot be mixed.
There is only two prog in the masm32 who use the crt.
wait_key.asm and retkey.asm are this two files who use the getch (crt_getch) function.
Is it possible in the future to put this files in another lib to keep the compatibilty ?.

Title: Re: compatibility between the masm32 lib and c++ project
Post by: hutch-- on August 24, 2011, 12:47:18 PM
Yves,

the problem is you cannot use 2 libraries with the same name so if you need to link MASM code that uses the CRT with C++ code that uses the CRT you need to call the same library. Now this would mean creating an include file for the C++ version of the CRT and see if that works.
Title: Re: compatibility between the masm32 lib and c++ project
Post by: dedndave on August 24, 2011, 12:52:15 PM
you could create a second library by replacing getch with cin.get
Title: Re: compatibility between the masm32 lib and c++ project
Post by: ToutEnMasm on August 24, 2011, 01:03:06 PM

cin.get ?
I don't know this one.
Title: Re: compatibility between the masm32 lib and c++ project
Post by: MichaelW on August 24, 2011, 01:04:50 PM
Since the MASM32 library is created from separately assembled procedures, linking with the MASM32 library will not pull in any procedures that are not specifically referenced.
Title: Re: compatibility between the masm32 lib and c++ project
Post by: ToutEnMasm on August 24, 2011, 01:25:38 PM

What i have done to simplify the problem:
Put out the two files of the masm32 lib and use getch ( proto c) with the include files who are already made .