On 13/10/2009 3:19 PM, EXTERNAL Loch Sebastian (Firma Ferchau; BhP/TEF17) wrote: > Hello list, > > I try to compile the actual trunk with VS2005 or VS2003 > and I got the following problems: > > 1.) PdfXObject.cpp > s:\vsprojects\podofo\vs2005\src\util\PdfMutexImpl_win32.h(86) : error C3861: > "TryEnterCriticalSection":
... where's the rest of the error mesage? > 2.) PdfFiltersPrivate.cpp > C:\Program Files\Microsoft Visual Studio > 8\VC\PlatformSDK\include\winsock2.h(112) : error C2011: 'fd_set': > 'struct' > -> I got here a bunch of definition errors... Please always quote FULL and EXACT error message text. Truncated and incomplete errors are useless, especially when you're asking for help with a compiler few people here (or at least few who actually try to help out on the list) have access to. My psychic powers just aren't up to what you're asking of them :-P > I tried to include winsock2.h before winsock.h in PdfCompilerCompatPrivate.h > but still getting definition errors. Any ideas where to include the above > header files? Does this remove the definition errors? Did you actually LOOK AT WHAT IS HAPPENING? Apply your debugging and problem solving skills? Let's go through it step by step. util\PdfMutexImpl_win32.h includes: #include "../PdfDefinesPrivate.h" so let's look at that. You're using VS, so just right click and choose "open document". We quickly see that it's just a wrapper for PdfCompilerCompatPrivate, so we in turn open up PdfCompilerCompatPrivate.h . Using the magic of IntelliSense, look at PdfCompilerCompatPrivate as opened within your project. Note at a glance what code is being excluded by conditional compilation macros, what values macros have, etc. Move your mouse over: #if PODOFO_HAVE_WINSOCK2_H on line 25. It should report that PODOFO_HAVE_WINSOCK2_H is defined as 1 and that, as a result, the block inside the #if is indeed compiled. That results in the inclusion of <winsock2.h>. OK, so we know that if <windows.h> is being included before that point then there's something wrong. How do we check that? Test for it by inserting the following code before the #ifdef block that attempts the inclusion of <winsock2.h>: #if defined(_WINDOWS_) && !defined(_WINSOCK2API_) #error <windows.h> included before <winsock2.h> #endif You also need to make sure that <winsock2.h> is actually getting included, so after the #ifdef block that tries to include <winsock2.h> add: #if !defined(_WINSOCK2API_) #error <winsock2.h> wasn't included! #endif Presumably, in your case, one of the two macros will trigger a #error, since you're having include order issues. If it's the the first one, then you just need to track down where the rogue inclusion of <windows.h> is coming from. At no point do PdfDefines.h or PdfCompilerCompat.h include <windows.h> and they're the only headers included before PdfDefinesPrivate.h and in turn PdfCompilerCompatPrivate.h, so I'm not really sure how it could be getting included. The PoDoFo sources don't include <windows.h> anywhere except PdfCompilerCompatPrivate.h. I'd bet it's the second one, and probably because PODOFO_HAVE_WINSOCK2_H won't be set, probably because of some problem with the build scripts or a modification to them. If that's the case you need to look at podofo_config.h and your CMakeCache.txt, or provide me with enough information to actually do more than vague guesswork. Anyway, I'm going to go do something more fun and productive now. -- Craig Ringer ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Podofo-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/podofo-users
