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]

"Cannot open display" or "cannot find entry symbol _WinMainCRTStartup"


Hi:

after reading Cygwin-User-guide and FAQ, I still 
have a problem runing a C-program under Windows. 
*The program:
 should output first some information on the to
display image sequence and then display images.
* Windows OS: XP version 2002 on a Toshiba 
  Tecra S1 laptop
* Cygwin: v 1.3.22.1
* Env-variables 
  LOGONSERVER=\\TOSHI HOSTNAME=TOSHI 
  COMPUTERNAME=TOSHI
* Problem and and what I have done:
1. I copied the source code (including the makefile
(see below)) to my /home directory under c:\cygwin
2. I modified the original makefile by adding
-mwindows
3. I compiled the program and got the executable and 
   the warning 
   "cannot find entry symbol _WinMainCRTStartup ..."
Here is a summary of the output:
$ make -f Makefile.cygwin
gcc -mwindows  -O6 -Wall -pedantic   -c -o seq.o seq.c
...
gcc -mwindows  -O6 -Wall -pedantic  -L/usr/X11R6/lib
-L/lib  -o seq.exe seq.o get_color.o guess.o
help_seq.o util_seq.o -lX11 -lm
/usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../../i686-pc-cygwin/bin/ld:
warning: cannot find entry symbol _WinMainCRTStartup;
defaulting to 00401000
4. when I run the prgram (./seq.exe img_seq) it does
not output anything. It just stops after a while.

---- I tried gdb and I got 
"Program exited with code 01".
When I setting a break point at MainCRTStartup 
(break *0x401000) I get no output and "Program exited
with code 01"

---- Then I tried it without -mwindows, i.e., 
2.1 I did not modify my original makefile 
(i.e., no -mwindows added)
3.1 I compiled the progtam and got the executable
without the above warning about CRT.
4.1 when I run the program it gives some correct
normal text output and then stops and gives 
"cannot connect to X server TOSHI:0"

---- Then I tried the option
2.2 I modified my make file by adding -mwindows -e
_mainCRTStartup
3.2 I compiled without the CRT warning ad got the
executable.
4.2 when I run the program, same as 4. above.
(Note: I tried it with -e _mainCRTStartup only and the
results is as 4.1 above)

--- Do you have any hint why I am not able to display
the output window (or in the other case why the
program does not output anything). I appreciate any
hint.

Regards.
Salma
==============
My Makefile:
SRCS =  seq.c ....

PROG        = seq.exe
SLIBS       = -lX11 -lm
CC          = gcc -mwindows -e _mainCRTStartup
CFLAGS      = -O6 -Wall -pedantic
LDFLAGS     =  -L/usr/X11R6/lib -L/lib
OBJS        = $(SRCS:.c=.o)
 
all : $(PROG)

$(PROG): $(OBJS)
	$(LINK.c) -o $(PROG) $(OBJS) $(SLIBS)

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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]