[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem building 0.8.0 with VS 2015


Hello

I'm trying to build the 0.8.0 tag from git using VS 2015 and am having compile issues. I'm using the CMake 3.11.0 GUI on windows to configure. The configuration works fine but when I open the generated solutions the projects don't build. When building ssh_shared I get the following error

	2>C:\code\libssh\libssh\src\init.c(47): error C2061: syntax error: identifier '__attribute__'

I believe this is due to these defines in init.c

	#define CONSTRUCTOR_ATTRIBUTE __attribute__((constructor))
	#define DESTRUCTOR_ATTRIBUTE __attribute__((destructor))

On Win32, defining as 

	#define CONSTRUCTOR_ATTRIBUTE
	#define DESTRUCTOR_ATTRIBUTE

Appears to fix the problem. I've attached a patch that addresses this issue. Please let me know if there is an issue with my change or if the patch is incorrectly formatted.

Thanks
John

Signed-off-by: John Dunn <john.dunn@xxxxxxx>

Attachment: fix_win32_build.patch
Description: fix_win32_build.patch


Follow-Ups:
Re: Problem building 0.8.0 with VS 2015Joseph Southwell <jsouthwell@xxxxxxxxxxxxxxxxxxxx>
Re: Problem building 0.8.0 with VS 2015Andreas Schneider <asn@xxxxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org