This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Linking VC++ DLL


Hi,

I have already compiled and linked the following function

extern "C" __declspec(dllexport) int hello()
{
	printf("Hello World!\n");
	return 345;
}

in a VC++ DLL.

I have also successfully linked and created the import library in Cygwin,
libhallo.a

However,
when I compile and run the following code
using
gcc hello.c -lhallo

extern int hello();

int main()
{
	printf("What is this? %d\n", hello());
}

All I get in return is (under Cygwin):
What is this? 345

345 demonstrates that the function was called and correctly returned but
why is it that the printf statement in the function hello() went missing?
I have tried to run other VC compiled program but had no problem in
getting printf statements to work under the Cygwin environment. Would
appreciate if anyone can suggest what could be the possible
problem. Thanks!

regards
Edward



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]