(Multi-) Threading

Discuss programming topics for the various GPL'd game engine sources.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: (Multi-) Threading

Post by revelator »

for msvc static pthread build ;) http://sourceforge.net/projects/cbadvan ... z/download

ill upload a static build for gcc also soon.

SDL2 is getting to a point where it beats the old SDL :) been toying a bit with it and looks promissing.
More info is allways appreciated ;) bring it on !.
Productivity is a state of mind.
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: (Multi-) Threading

Post by Baker »

revelator wrote:for msvc static pthread build ;) http://sourceforge.net/projects/cbadvan ... z/download

ill upload a static build for gcc also soon.

SDL2 is getting to a point where it beats the old SDL :) been toying a bit with it and looks promissing.
More info is allways appreciated ;) bring it on !.
Thanks! I've have to try this out!
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: (Multi-) Threading

Post by revelator »

np m8 :) and here are static builds for msvc intel and gcc.
http://sourceforge.net/projects/cbadvan ... z/download

remember too set the PTW32_STATIC_LIB in preprocessor settings for msvc/intel. for gcc yank it in CFLAGS like this export CFLAGS=" -DPTW32_STATIC_LIB" or if using codeblocks set it in build options/compiler settings/#defines.
Productivity is a state of mind.
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: (Multi-) Threading

Post by Baker »

And get to have my CodeBlocks build have it to :D
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: (Multi-) Threading

Post by Baker »

revelator wrote:for msvc static pthread build ;) http://sourceforge.net/projects/cbadvan ... z/download
Sad to report this is 64-bit lib, if I am understand correctly. :(

unresolved external symbol __imp__pthread_join -- the 32-bit name for the function.

Well maybe not, defined PTW32_STATIC_LIB and now getting different error messages, ...

(saw your note, I thought that define was for gcc build, haha)

ignore default lib: LIBCMTD.lib -----compiles! runs!

Mission accomplished! Visual Studio 2008 C++ Express.

[vc6 doesn't work, but I can use pthreads.dll with that. I use vc6 for coding because the IDE is quickly and not overly complex (I hate looking through trees to find settings and how recent Visual Studio likes to hide find options, but I can just use VC2008 for the release builds.)]
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: (Multi-) Threading

Post by revelator »

might be because of different runtime dependencies msvc6 vs msvc 2010 runtime. Ill see if i can cook up a library linked to the static msvc runtime.
Productivity is a state of mind.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: (Multi-) Threading

Post by revelator »

btw the __imp_ before the typenames just means its trying to link to the dll version ;) hence the define.
Productivity is a state of mind.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: (Multi-) Threading

Post by revelator »

http://sourceforge.net/projects/cbadvan ... z/download

yep pthread linked to the dll runtimes so i fixed that part, they are now linked to the static msvc runtime instead.

above package only includes the msvc libraries, just replace the old ones with these and you should be good to go :)

i also included the debug library in case you need to go bughunting ;)
Productivity is a state of mind.
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: (Multi-) Threading

Post by Baker »

revelator wrote:http://sourceforge.net/projects/cbadvan ... z/download

yep pthread linked to the dll runtimes so i fixed that part, they are now linked to the static msvc runtime instead.

above package only includes the msvc libraries, just replace the old ones with these and you should be good to go :)

i also included the debug library in case you need to go bughunting ;)
That was very quick!

I get these errors when trying to compile now. vc6 doesn't have "strncat_s" as a function that was introduced in a later version of Visual Studio (2003? 2005? 2008?)

Code: Select all

pthreadVC2d.lib(pthread.obj) : warning LNK4078: multiple ".CRT" sections found with different attributes (40300040)
libcmtd.lib(dosmap.obj) : error LNK2005: __dosmaperr already defined in LIBCD.lib(dosmap.obj)
libcmtd.lib(tolower.obj) : error LNK2005: __tolower already defined in LIBCD.lib(tolower.obj)
libcmtd.lib(tolower.obj) : error LNK2005: _tolower already defined in LIBCD.lib(tolower.obj)
LIBCD.lib(crt0init.obj) : warning LNK4098: defaultlib "libcmtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
pthreadVC2d.lib(pthread.obj) : error LNK2001: unresolved external symbol ___security_cookie
pthreadVC2d.lib(pthread.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
pthreadVC2d.lib(pthread.obj) : error LNK2001: unresolved external symbol __ftime64_s
pthreadVC2d.lib(pthread.obj) : error LNK2001: unresolved external symbol _strncat_s
If I do nodefaultlib: libcmtd.lib I get these errors

Code: Select all

pthreadVC2d.lib(pthread.obj) : warning LNK4078: multiple ".CRT" sections found with different attributes (40300040)
pthreadVC2d.lib(pthread.obj) : error LNK2001: unresolved external symbol __endthreadex
pthreadVC2d.lib(pthread.obj) : error LNK2001: unresolved external symbol ___security_cookie
pthreadVC2d.lib(pthread.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
pthreadVC2d.lib(pthread.obj) : error LNK2001: unresolved external symbol __ftime64_s
pthreadVC2d.lib(pthread.obj) : error LNK2001: unresolved external symbol __beginthreadex
pthreadVC2d.lib(pthread.obj) : error LNK2001: unresolved external symbol _strncat_s
[I do want to mention that while I'd be esctatic to have a static lib for vc6, I can perfectly live with compiling release builds using Visual Studio 2008. I prefer to code and debug in vc6, but I can use the .dll version for that.]

But part of me suspects you likely view this as a challenge, considering all your work on CBAdvanced. :D Especially since your so close already.

Note: Release .lib is same errors

Code: Select all

pthreadVC2.lib(pthread.obj) : warning LNK4078: multiple ".CRT" sections found with different attributes (40300040)
libcmt.lib(dosmap.obj) : error LNK2005: __dosmaperr already defined in LIBCD.lib(dosmap.obj)
libcmt.lib(tolower.obj) : error LNK2005: __tolower already defined in LIBCD.lib(tolower.obj)
libcmt.lib(tolower.obj) : error LNK2005: _tolower already defined in LIBCD.lib(tolower.obj)
LIBCD.lib(crt0init.obj) : warning LNK4098: defaultlib "libcmt.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
pthreadVC2.lib(pthread.obj) : error LNK2001: unresolved external symbol __ftime64_s
pthreadVC2.lib(pthread.obj) : error LNK2001: unresolved external symbol ___security_cookie
pthreadVC2.lib(pthread.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
pthreadVC2.lib(pthread.obj) : error LNK2001: unresolved external symbol _strncat_s
Debug/thready.exe : fatal error LNK1120: 4 unresolved externals
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: (Multi-) Threading

Post by revelator »

agh aye those exports are from the newer msvcr runtime.

especially the security check cookie crap is for checking buffer overflows and was not present in the earlier msvc runtime.

actually you might have luck just renaming the libpthreadGC2.a file to pthreadVC2.lib and link with that in msvc6 since mingw by default uses the old msvc runtime.

dont have the old vc6 compiler anymore but if you feel upto compiling it yourself i can upload the source ?.

just cd into the pthread directory while in the msvc shell and do nmake clean VC-static to build it.

msvc6 does not install a link to its commandline utilities by default so you have to make that yourself, its located in the bin directory of your msvc6 compiler and is named VCVARS32.BAT.
rightclick it and select to make a shortcut, now edit its properties by rightclicking the shortcut and put this before it %comspec% /k so that it looks something like this.
%comspec% /k "C:\Program Files\compiler dir\VC\bin\VCVARS32.BAT" in the destination box. viola you now have access to the commandline toolset.

If this is to much for you to take in ill see if i can modify the msvc6 project file so that it gets the right flags for creating a library, normally its setup to create a dll by default.

ok heres the source code http://sourceforge.net/projects/cbadvan ... z/download
try and see if the msvc 6 dsw project works, i changed the output type to output a static library instead of a dll and it statically links to the msvc runtime.
Productivity is a state of mind.
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: (Multi-) Threading

Post by Baker »

I appreciate the effort, I'm perfectly happy with having a static lib for vs 2008 and also one for mingw.

I'll probably take a stab at compiling using the link tomorrow or Monday, but I'm thrilled I have a static lib I can use for release builds.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: (Multi-) Threading

Post by revelator »

;) allways nice to have a compiler guy handy hehe.

well i was fortunate i still had a copy of msvc6 in a virtual machine backup so i tried the build myself, but and heres the nasty stuff,
msvc 6 is no longer compatible with the pthread source code you will literally get 1000's of errors if you try :( agh.
mostly seems related to changes in typenames that the old compiler does not have (__int64 for instance) but there are many more.

I can understand the need for a simple IDE and i would like to look into if its possible to use the old msvc6 ide with the newer tools :)
atm the simplest ide i can give you if you want is sadly gcc based but pretty much as clean as the old msvc 6 IDE.
but its very basic so if you need special defines you would have to do most of them by hand.

Image
Productivity is a state of mind.
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: (Multi-) Threading

Post by Baker »

revelator wrote:msvc 6 is no longer compatible with the pthread source code
I believe it! Especially since later Visual Studio has thread safe string writes for snprint and such. I wouldn't expect a threading library today to contort itself to support vc6.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Barnes
Posts: 232
Joined: Thu Dec 24, 2009 2:26 pm
Location: Russia, Moscow
Contact:

Re: (Multi-) Threading

Post by Barnes »

If I remember correctly, intel compiler for Linux - is free.
It can automatically generate parallel code (open mp)
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: (Multi-) Threading

Post by revelator »

indeed :) well 2010 is still pretty much like the 2008 version so maybe an option ? also the IDE is not to nasty to handle yet and the compiler still supports atleast XP builds.
2012 also supports XP but the IDE can be a bit overwhelming. 2013 does not support XP at all unless you have a former compiler like 2010 handy in which case you can select that in the compiler options.

Aye the string safe printf runtimes will definatly make things screewy also the 64 bit int timer functions and the changes to C++ namespaces so loads of incompatibilities.

Ah well if you can live with the dll version on msvc6 it shouldnt matter to much :) can allways use 2008 for release builds with the static library.
Productivity is a state of mind.
Post Reply