Building on cygwin 64: undefined reference to `WinMain'

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 toWinMain’
/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.

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.On Sunday, September 21, 2014 12:18:36 AM UTC-4, gmhwxi wrote:

patscc.dats contains an implementation of ‘main’.
I suspect that patscc_dats.c was not properly generated (which might be
empty).

On Sat, Sep 20, 2014 at 10:00 PM, Brandon Barker <brand...@gmail.com <javascript:>> wrote:

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.


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...@googlegroups.com <javascript:>.
To post to this group, send email to ats-l...@googlegroups.com
<javascript:>.
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
https://groups.google.com/d/msgid/ats-lang-users/df437625-13ee-4d10-bf24-299f52507b4b%40googlegroups.com?utm_medium=email&utm_source=footer
.

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.On Friday, September 26, 2014 2:17:48 PM UTC-4, Brandon Barker wrote:

In /home/brand_000/ATS-Postiats/utils/atscc, doing:

rm *.c
make

fixed the problem.

On Friday, September 26, 2014 2:11:02 PM UTC-4, Brandon Barker wrote:

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.

On Sunday, September 21, 2014 12:18:36 AM UTC-4, gmhwxi wrote:

patscc.dats contains an implementation of ‘main’.
I suspect that patscc_dats.c was not properly generated (which might be
empty).

On Sat, Sep 20, 2014 at 10:00 PM, Brandon Barker brand...@gmail.com wrote:

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.


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...@googlegroups.com.
To post to this group, send email to ats-l...@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
https://groups.google.com/d/msgid/ats-lang-users/df437625-13ee-4d10-bf24-299f52507b4b%40googlegroups.com?utm_medium=email&utm_source=footer
.

In /home/brand_000/ATS-Postiats/utils/atscc, doing:

rm *.c
make

fixed the problem.On Friday, September 26, 2014 2:11:02 PM UTC-4, Brandon Barker wrote:

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.

On Sunday, September 21, 2014 12:18:36 AM UTC-4, gmhwxi wrote:

patscc.dats contains an implementation of ‘main’.
I suspect that patscc_dats.c was not properly generated (which might be
empty).

On Sat, Sep 20, 2014 at 10:00 PM, Brandon Barker brand...@gmail.com wrote:

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.


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...@googlegroups.com.
To post to this group, send email to ats-l...@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
https://groups.google.com/d/msgid/ats-lang-users/df437625-13ee-4d10-bf24-299f52507b4b%40googlegroups.com?utm_medium=email&utm_source=footer
.

patscc.dats contains an implementation of ‘main’.
I suspect that patscc_dats.c was not properly generated (which might be
empty).On Sat, Sep 20, 2014 at 10:00 PM, Brandon Barker brandon...@gmail.com wrote:

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.


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
https://groups.google.com/d/msgid/ats-lang-users/df437625-13ee-4d10-bf24-299f52507b4b%40googlegroups.com?utm_medium=email&utm_source=footer
.