Help with _beginthread

Bart Anderson
Sat May 15 09:09:00 GMT 1999

Dear list

My main objective was to rip out MFC code from the infocom interpreter.

I have struggled with this for a while now, and am in need of technical

My setup is egcs 1.1.2 with installed
I also have V 1.21 installed and working.

I have a test project that calls _beginthread() and this compiles and works.
I have a more complex project with the same call to _beginthread(), but it
can't find init_thread().

Any ideas. I'll only send the stuff people are willing to
look at, I don't want to burden the list ...  ;)

in real project

WFrotzcmdw.cpp: _beginthread(init_thread(),4096,NULL);

..\c\Win_init.c:void init_thread()

results from make
g++ -c -I../include -o WFrotzapp.o WFrotzapp.cpp
g++ -c -I../include -o WFrotzdlg.o WFrotzdlg.cpp
g++ -c -I../include -o WFrotzmdlg.o WFrotzmdlg.cpp
g++ -c -I../include -o WFrotzcnv.o WFrotzcnv.cpp
g++ -c -I../include -o WFrotzcmdw.o WFrotzcmdw.cpp
WFrotzcmdw.cpp: In function `BOOL startThread()':
WFrotzcmdw.cpp:39: warning: implicit declaration of function `int
WFrotzcmdw.cpp:39: warning: passing `int' to argument 1 of `_beginthread(void
)(void *), unsigned int, void *)' lacks a cast
g++ -c -I../include -o Thread.o Thread.cpp
g++ -o WFrotz.exe  ./WFrotzapp.o ./WFrotzdlg.o ./WFrotzmdlg.o ./WFrotzcnv.o
rotzcmdw.o ./Thread.o  ../frotz/Alias.o ../frotz/Buffer.o ../frotz/Fastmem.o
frotz/Files.o ../frotz/Getopt.o ../frotz/Hotkey.o ../frotz/Input.o
.o ../frotz/Object.o ../frotz/Other.o ../frotz/Process.o ../frotz/Random.o
otz/Redirect.o ../frotz/Screen.o ../frotz/Sound.o ../frotz/Stream.o
le.o ../frotz/Text.o ../frotz/Variable.o ../frotz/Main.o  ../c/Win_init.o
in_input.o ../c/Win_pic.o ../c/Win_scrn.o ../c/Win_smpl.o ../c/Win_text.o -lV
l --subsystem,windows -lgdi32 -luser32 -lwinmm -lcomdlg32 -lcomctl32
./WFrotzcmdw.o(.text+0x18) undefined reference to `init_thread'
C:\EGCS-1~1.2\BIN\MAKE.EXE: *** [WFrotz.exe] Error 1

in test project
cfunc.c:void init_thread()
main.cpp:       _beginthread(init_thread(),4096,NULL);

results of make
g++ -c main.cpp
main.cpp: In function `int main()':
main.cpp:18: warning: implicit declaration of function `int init_thread(...)'
main.cpp:18: warning: passing `int' to argument 1 of `_beginthread(void
 *), unsigned int, void *)' lacks a cast
gcc -c cfunc.c
g++ -o main.exe  ./main.o ./cfunc.o  -lv -Wl --subsystem,windows -lcomctl32
er32 -lgdi32 -lwinmm -lcomdlg32
gcc -c cmain.c
gcc -o cmain cmain.o cfunc.o

Get your own FREE, personal Netscape WebMail account today at .

Want to unsubscribe from this list?
Send a message to

More information about the Cygwin mailing list