PDA

View Full Version : Clanlib and MongoDB

lampcord
10-06-2012, 05:29 PM
Has anyone made Clanlib project that uses the MongoDB C++ client?

I've been struggling to get it to compile. Running into some sort of header clash between the two libs.

Just wondering if anyone else has tried this or knows a work around.

Or alternatives to mongo for indexable non SQL data stores.

sphair
10-06-2012, 06:25 PM
What is the error you get?

lampcord
10-07-2012, 12:01 AM
What is the error you get?

Sorry, should have posted it with my Q. Not sure what I was thinking.

I'm getting this:

1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\ws2def.h(91): warning C4005: 'AF_IPX' : macro redefinition
1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winsock.h(460) : see previous definition of 'AF_IPX'
...

followed by the same error for about 200 variables. Not sure where the references to winsock.h or ws2def.h are coming from but it looks like I need to get rid of one.

RootKernel
10-08-2012, 12:42 PM
Sorry, should have posted it with my Q. Not sure what I was thinking.

I'm getting this:

1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\ws2def.h(91): warning C4005: 'AF_IPX' : macro redefinition
1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winsock.h(460) : see previous definition of 'AF_IPX'
...

followed by the same error for about 200 variables. Not sure where the references to winsock.h or ws2def.h are coming from but it looks like I need to get rid of one.

41 down vote

This problem is caused when including <windows.h> before <winsock2.h>. Try arrange your include list that <windows.h> is included after <winsock2.h> or define _WINSOCKAPI_ first:

#define _WINSOCKAPI_ // stops windows.h including winsock.h
#include <windows.h>
// ...
#include "MyClass.h" // Which includes <winsock2.h>

lampcord
10-08-2012, 01:27 PM