Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build Poco Net failed MinGW [TIMESTAMP_REQUEST enum vs macro] #2967

Closed
sk-landry opened this issue Mar 29, 2020 · 4 comments
Closed

build Poco Net failed MinGW [TIMESTAMP_REQUEST enum vs macro] #2967

sk-landry opened this issue Mar 29, 2020 · 4 comments

Comments

@sk-landry
Copy link

Good morning,

I'm building POCO from Github's master branch. (commit = 3fc3e5f)
I use MinGW 7.3 32bits bundled in QT. I am on Windows 10.
The build of POCO NET failed because of the enum TIMESTAMP_REQUEST define in ICMPv4PackekImpl.h

enum MessageType
{
TIMESTAMP_REQUEST ,
};

The error indicates that there is a macro TIMESTAMP_REQUEST define somewhere, I don't know where but it is causing a conflict

My solution was to rename the enum from TIMESTAMP_REQUEST to simply TIMESTAMP.

For information, I've previously built POCO 1.9.0-release without any issues with the same environment.

@iSLC
Copy link

iSLC commented Jan 29, 2021

It conflicts with a macro named TIMESTAMP_REQUEST inside the wincrypt.h header.

#define TIMESTAMP_REQUEST ((LPCSTR) 78)

EDIT: My solution was to basically get rid of it for the duration of that enum.

	// wincrypt.h also contains a macro named TIMESTAMP_REQUEST
	// being a MinGW issue we can get rid of it for a moment
#if defined(TIMESTAMP_REQUEST) && defined(POCO_COMPILER_MINGW)
	#pragma push_macro("TIMESTAMP_REQUEST")
	#define POCO_RESTORE_TIMESTAMP_REQUEST
	#undef TIMESTAMP_REQUEST
#endif

	enum MessageType
	{
		//...
		TIMESTAMP_REQUEST,
		//...
	};

#if defined(POCO_RESTORE_TIMESTAMP_REQUEST)
	#pragma pop_macro("TIMESTAMP_REQUEST")
	#undef POCO_RESTORE_TIMESTAMP_REQUEST
#endif

Note however that you need this fix to know if you're under MinGW #3195

Looks weird but you work with what you can.

@github-actions
Copy link

This issue is stale because it has been open for 365 days with no activity.

@github-actions github-actions bot added the stale label Jan 30, 2022
@github-actions
Copy link

This issue was closed because it has been inactive for 60 days since being marked as stale.

@aleks-f aleks-f added this to the Release 1.13.0 milestone Jul 7, 2022
nwrkbiz added a commit to nwrkbiz/poco that referenced this issue Jun 15, 2023
@aleks-f aleks-f added enhancement and removed stale labels Jul 11, 2023
@aleks-f aleks-f reopened this Jul 11, 2023
aleks-f pushed a commit that referenced this issue Jul 11, 2023
aleks-f pushed a commit that referenced this issue Nov 23, 2023
aleks-f pushed a commit that referenced this issue Nov 27, 2023
@matejk matejk self-assigned this Dec 12, 2023
@matejk
Copy link
Contributor

matejk commented Dec 13, 2023

When trying to compile with MinGW 11 there are more compile issues with current state of devel.

Will fix and create pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants