No. I never use the "ld" command. Try using gcc to build the executable.

  Notice that there is a "config.mak" file in the "simple" folder that uses
the Tecmake script to build the executable. You can use a Makefile like
this:

----------------------------------------------------------------------------
-----
ifeq ($(OS), Windows_NT)
  TECMAKE_CMD = $(MAKE) --no-print-directory -f ../tecmakewin.mak
TEC_UNAME=$(TEC_UNAME)
else
  TECMAKE_CMD = $(MAKE) --no-print-directory -f ../tecmake.mak
endif

.PHONY: do_all simple
do_all: simple

simple:
        @$(TECMAKE_CMD)
----------------------------------------------------------------------------
-----

Best,
Scuri

> -----Original Message-----
> From: Ano Nymous [mailto:[email protected]]
> Sent: quarta-feira, 20 de junho de 2012 14:20
> To: IUP discussion list.
> Subject: [Iup-users] undefined reference to `__main' while compile
> cd\test\simple
> 
> hi,
> i tried to compile the iupmain.c in cd\test\simple directory
> 
> i did the following
> D:\IUPCVS\cd\test\simple>gcc -c iupmain.c -I D:/iupcvs/iup/include -I
> D:/iupcvs/cd/include
> D:\IUPCVS\cd\test\simple>gcc -c simple.c -I D:/iupcvs/iup/include -I
> D:/iupcvs/cd/include
> D:\IUPCVS\cd\test\simple>gcc -c simple_led.c -I D:/iupcvs/iup/include
> -I D:/iupcvs/cd/include
> D:\IUPCVS\cd\test\simple>ls *.o
> iupmain.o  simple.o  simple_led.o
> 
> then i use the following ld command
> 
> D:\IUPCVS\cd\test\simple>ld -L D:/IUPCVS/IUP/LIB/DLLW4 -L
> D:/IUPCVS/CD/LIB/DLLW4 iupmain.o simple.o simple_led.o -liup -
> liupcontrols -liupcd -lcd -lcdpdf -lmsvcrt
> iupmain.o:iupmain.c:(.text+0xa): undefined reference to `__main'
> 
> any idea?
> 
>
----------------------------------------------------------------------------
--
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Iup-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/iup-users


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to