Building on cygwin 64: undefined reference to `WinMain'

1,485 views
Skip to first unread message

Brandon Barker

unread,
Sep 20, 2014, 10:00:35 PM9/20/14
to ats-lan...@googlegroups.com
This is after a fresh rebuilt of ATS1 and ATS2:

cp -f src/patsopt bin/patsopt
make -C utils/atscc -f Makefile all
make[1]: Entering directory '/home/brand_000/ATS-Postiats/utils/atscc'
\
  gcc -I"/home/brand_000/ATS-Postiats" -I"/home/brand_000/ATS-Postiats"/ccomp/runtime -std=c99 -D_XOPEN_SOURCE -DATS_MEMALLOC_LIBC -O2 -o patscc patscc_dats.c atscc_main_dats.c atscc_print_dats.c
/usr/lib/gcc/x86_64-pc-cygwin/4.8.3/../../../../lib/libcygwin.a(libcmain.o): In function `main':
/usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/lib/libcmain.c:39: undefined reference to `WinMain'
/usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/lib/libcmain.c:39:(.text.startup+0x7e): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `WinMain'
collect2: error: ld returned 1 exit status
Makefile:29: recipe for target 'patscc' failed
make[1]: *** [patscc] Error 1
make[1]: Leaving directory '/home/brand_000/ATS-Postiats/utils/atscc'
Makefile_devl:39: recipe for target 'src_patscc' failed
make: *** [src_patscc] Error 2


My only clue so far is that none of the *.c files being compiled seem to include a main entry point, and this may be confusing cygwin's linker.

Hongwei Xi

unread,
Sep 21, 2014, 12:18:36 AM9/21/14
to ats-lan...@googlegroups.com
patscc.dats contains an implementation of 'main'.
I suspect that patscc_dats.c was not properly generated (which might be empty).


--
You received this message because you are subscribed to the Google Groups "ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/df437625-13ee-4d10-bf24-299f52507b4b%40googlegroups.com.

Brandon Barker

unread,
Sep 26, 2014, 2:11:02 PM9/26/14
to ats-lan...@googlegroups.com
Sorry for the delayed reply; I started looking at it again and you are correct. In fact, the file I had peaked at previously (atscc_main_dats.c ) was the only one that had any code in it. The others (  atscc_print_dats.c,  patscc_dats.c ) are empty.

Brandon Barker

unread,
Sep 26, 2014, 2:17:48 PM9/26/14
to ats-lan...@googlegroups.com
In /home/brand_000/ATS-Postiats/utils/atscc, doing:

rm *.c
make



fixed the problem.

Brandon Barker

unread,
Sep 26, 2014, 4:20:33 PM9/26/14
to ats-lan...@googlegroups.com
I'm actually getting this behavior on Linux as well. I'll look in to it a bit more and submit an issue on github.
Reply all
Reply to author
Forward
0 new messages