
"Roland" <roland.schwarz@chello.at> wrote in message news:20040805083842.XVAN21832.viefep17-int.chello.at@speedsnail...
On Thu, 05 Aug 2004 10:07:47 +0200 Bronek Kozicki <brok@rubikon.pl> wrote:
[...]
This can be done easier. The problem is that you are using this bit of code slightly of topic. However you as already having discovered somehow need to convince the linker to link in the lib. Since you are not referencing any exported symbols this is the reason for not linking the lib in.
Without #pragma trickery this can be done in the following way:
extern "C" void tss_cleanup_implemented(void);
int main(int argc, char* argv[]) { tss_cleanup_implemented(); // just a dummy call to link the lib in printf("entering main\n");
DWORD id; HANDLE h = CreateThread(NULL, 0, &f, 0, 0, &id); WaitForSingleObject(h, INFINITE); CloseHandle(h);
_dummy = 0;
printf("leaving main\n");
return _dummy; }
From the end-user point of view I'd still prefer the "/include" method - if
possible. BTW, you guys have performed some great work here. I'm just a bit surprised that no one of the MS lurkers has had anything (technical) to say about this. // Johan