Compiles OK but get "0xC0000005: Access violation" when run



I've recently written a GTK application under Linux and I'm now trying to
compile and execute the application under win32.
 
I've followed the instructions at http://wolfpack.twu.net/docs/gtkwin32/index.html. The software compiles without any errors or warnings but when it runs it crashes with the error message.
"test.exe has encountered a problem and needs to close."
Which isn't particularly informative.
 
I've constructed a hello world program using glade, and have the same problem executing that.
Some things that I've tried include
+I have put the directory containing the GTK DLLS at the head of my path.
+I have tried stepping through with the debugger,
I get "Unhandled exception in test.exe: 0xC0000005: Access violation.
On my hello world executable. It seems to crash before the first line is executed. i.e. the stack is
 
0002b9be()
mainCRTStartup() line 129 + 6 bytes
KERNEL32! 7c816d4f()
On my other executable the error occurs when I execute the second of the following two lines
 
  main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW (main_window), _("XXX"));
 
i.e. the stack is
create_main_window() line 92 + 20 bytes
main(int 0, char * * 0x00000000) line 43 + 5 bytes
KERNEL32! 7c816d4f()
Strangely enough on another GTK executable it crashed on malloc, and when I changed this to g_malloc it worked fine (but crashed at a later point).
 
+I have tried both gtk+2.4 and gtk+2.8 with the same lack of success.
+ I have copied the DLLs into C:\WINDOWS\SYSTEM\
Note I'm using visual C++ 6.0 (but my code is C)
on a Windows XP professional version 2002 service pack 2 machine.
I can compile and run other applications using VC++.
 
Can anyone offer me some suggestions as to what is going on, and how to fix it? Although I'm an experienced programmer I haven't compiled too many VC++ applications,
and predominately use Linux or cygwin, therefore if you think that it may be something basic but windows specific please let me know.
 
Regards
Brad Starkie
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]