GerHobbelt / pthread-win32

clone of pthread-win32 (a.k.a. pthreads4w) + local tweaks (including MSVC2008 - MSVC2022 project files)
Other
350 stars 166 forks source link

VS 2008 project does not compile #12

Closed fredmcfly2 closed 3 years ago

fredmcfly2 commented 6 years ago

Attempting to compile by using the Microsoft Visual Studio 2008. The project does not compile. 133 errors.

Most are the error: fatal error C1189: #error : "config.h was not #included"

The remaining errors are related to missing files, such as: fatal error C1083: Cannot open source file: '.\fork.c': No such file or directory fatal error C1083: Cannot open source file: '.\spin.c': No such file or directory

fredmcfly2 commented 6 years ago

If I define HAVE_CONFIG_H then I get the following preprocessor error: error RC2188: C:\Workspace\RecMngr\external\pthreads\obj\pthread_lib_Win32_MSVC2008.Debug\RCa13980(406) : fatal error RC1116: RC terminating after preprocessor errors

zhenguoli commented 4 years ago

You can solve this problem by adding a definition "PTW32_ARCHx86" in "Properities > Resources > General > Preprocessor Definitions" of the project "pthread_lib" and "pthread_dll" according to the version.rc:

#if defined(PTW32_RC_MSC)
#  if defined(PTW32_ARCHx64)
#    define PTW32_ARCH "x64"
#  elif defined(PTW32_ARCHx86)
#    define PTW32_ARCH "x86"
#  else
#    error "PTW32_ARCHx64 / PTW32_ARCHx86 has not been defined"
#  endif
...
GerHobbelt commented 3 years ago

(After a hiatus of a decade.)

Closing this one as a solution was provided above (thanks!) and I consider MSVC2008 outdated today.

Please file a new issue & cross-ref to this one if this is a problem for legacy projects.