Author Topic: /crt1.o(.text+0x2c): undefined reference to `main\'  (Read 7869 times)

cmisip

  • Sr. Member
  • ****
  • Posts: 256
    • View Profile
    • http://home.mchsi.com/~cmisip/index.htm
/crt1.o(.text+0x2c): undefined reference to `main\'
« on: May 30, 2004, 04:33:49 pm »
I am trying to compile xu4.  I get this error using gcc 2.95.3

/usr/local/bin/arm-linux-gcc -DHAVE_BACKTRACE=1 -DHAVE_VARIADIC_MACROS=1 -Wall -I. -I/home/cmisip/develop/usr/local/include -I/home/cmisip/develop/usr/local/include/SDL -DQWS -D_REENTRANT -Dmain=SDL_main -I/home/cmisip/develop/usr/local/include/libxml2 -DICON_FILE=\"/usr/local/share/pixmaps/u4.bmp\" -DVERSION=\"0.9\" -ggdb -rdynamic -o dumpsavegame util/dumpsavegame.o savegame.o io.o names.o
/usr/local/arm-linux/lib/crt1.o: In function `_start\':
/usr/local/arm-linux/lib/crt1.o(.text+0x2c): undefined reference to `main\'
collect2: ld returned 1 exit status
make: *** [dumpsavegame] Error 1


Anybody care to comment what is going on?

Thanks.
Zaurus 5600
Zynergy Rootfs 1.1
Custom zImage

How Do You Do That in Linux

Mickeyl

  • Hero Member
  • *****
  • Posts: 1495
    • View Profile
    • http://www.Vanille.de
/crt1.o(.text+0x2c): undefined reference to `main\'
« Reply #1 on: May 31, 2004, 01:57:45 pm »
Seems to be a SDL application. I recommend -lSDLmain
Cheers,

Michael 'Mickey' Lauer | Embedded Linux Freelancer | www.Vanille-Media.de
Consider donating, if you like the software I contribute to.

cmisip

  • Sr. Member
  • ****
  • Posts: 256
    • View Profile
    • http://home.mchsi.com/~cmisip/index.htm
/crt1.o(.text+0x2c): undefined reference to `main\'
« Reply #2 on: May 31, 2004, 03:41:32 pm »
/usr/local/bin/arm-linux-gcc -DHAVE_BACKTRACE=1 -DHAVE_VARIADIC_MACROS=1 -Wall -I. -I/home/cmisip/develop/usr/local/include -I/home/cmisip/develop/usr/local/include/SDL -DQWS -D_REENTRANT -Dmain=SDL_main -I/home/cmisip/develop/usr/local/include/libxml2 -DICON_FILE=\"/usr/local/share/pixmaps/u4.bmp\" -DVERSION=\"0.9\" -ggdb -rdynamic -ISDLmain -o dumpsavegame util/dumpsavegame.o savegame.o io.o names.o
/usr/local/arm-linux/lib/crt1.o: In function `_start\':
/usr/local/arm-linux/lib/crt1.o(.text+0x2c): undefined reference to `main\'
collect2: ld returned 1 exit status
make: *** [dumpsavegame] Error 1


I added -ISDLmain but get the same error.
Zaurus 5600
Zynergy Rootfs 1.1
Custom zImage

How Do You Do That in Linux

cmisip

  • Sr. Member
  • ****
  • Posts: 256
    • View Profile
    • http://home.mchsi.com/~cmisip/index.htm
/crt1.o(.text+0x2c): undefined reference to `main\'
« Reply #3 on: May 31, 2004, 03:44:27 pm »
Does it help to say that xu4 was not meant to be compiled with gcc 2.95.x because of anonymous union structs (I changed those).   The source files  in u4/util compile fine on gcc 3.2.2.  What changes does the makefile need?

Thanks again
Zaurus 5600
Zynergy Rootfs 1.1
Custom zImage

How Do You Do That in Linux

Mickeyl

  • Hero Member
  • *****
  • Posts: 1495
    • View Profile
    • http://www.Vanille.de
/crt1.o(.text+0x2c): undefined reference to `main\'
« Reply #4 on: May 31, 2004, 04:13:18 pm »
You did -ISDLmain while I recommended -lSDLmain
Cheers,

Michael 'Mickey' Lauer | Embedded Linux Freelancer | www.Vanille-Media.de
Consider donating, if you like the software I contribute to.

cmisip

  • Sr. Member
  • ****
  • Posts: 256
    • View Profile
    • http://home.mchsi.com/~cmisip/index.htm
/crt1.o(.text+0x2c): undefined reference to `main\'
« Reply #5 on: May 31, 2004, 04:31:32 pm »
Oh please elaborate.  They look the same to me?  And where do I put it?  
Thanks.
Zaurus 5600
Zynergy Rootfs 1.1
Custom zImage

How Do You Do That in Linux

Mickeyl

  • Hero Member
  • *****
  • Posts: 1495
    • View Profile
    • http://www.Vanille.de
/crt1.o(.text+0x2c): undefined reference to `main\'
« Reply #6 on: May 31, 2004, 04:50:35 pm »
Uhm... it\'s two different letters. One is a uppercase I, as in Isadora, the other is a lowercase l as in library
(The point where you placed it was ok)
Cheers,

Michael 'Mickey' Lauer | Embedded Linux Freelancer | www.Vanille-Media.de
Consider donating, if you like the software I contribute to.

cmisip

  • Sr. Member
  • ****
  • Posts: 256
    • View Profile
    • http://home.mchsi.com/~cmisip/index.htm
/crt1.o(.text+0x2c): undefined reference to `main\'
« Reply #7 on: May 31, 2004, 05:05:22 pm »
Here is what I got:

/usr/local/bin/arm-linux-gcc -DHAVE_BACKTRACE=1 -DHAVE_VARIADIC_MACROS=1 -Wall -I. -I/home/cmisip/develop/usr/local/include -I/home/cmisip/develop/usr/local/include/SDL -DQWS -D_REENTRANT -Dmain=SDL_main -I/home/cmisip/develop/usr/local/include/libxml2 -DICON_FILE=\"/usr/local/share/pixmaps/u4.bmp\" -DVERSION=\"0.9\" -ggdb -rdynamic -lSDLmain -o dumpsavegame util/dumpsavegame.o savegame.o io.o names.o
/usr/local/arm-linux/bin/ld: cannot find -lSDLmain
collect2: ld returned 1 exit status
make: *** [dumpsavegame] Error 1

The contents of my lib directory are:

libpng12.a           libSDL.a                   libxml2.la
libpng12.so          libSDL.la                  libxml2.so
libpng12.so.0        libSDLmain.a               libxml2.so.2
libpng12.so.0.1.2.5  libSDL_mixer-1.2.so.0      libxml2.so.2.6.6
libpng.a             libSDL_mixer-1.2.so.0.2.3  libz.so
libpng.so            libSDL_mixer.a             libz.so.1
libpng.so.3          libSDL_mixer.la            libz.so.1.2.1
libpng.so.3.1.2.5    libSDL_mixer.so            pkgconfig
libSDL-1.2.so.0      libSDL.so                  python2.2
libSDL-1.2.so.0.7.0  libxml2.a                  xml2Conf.sh
Zaurus 5600
Zynergy Rootfs 1.1
Custom zImage

How Do You Do That in Linux

cmisip

  • Sr. Member
  • ****
  • Posts: 256
    • View Profile
    • http://home.mchsi.com/~cmisip/index.htm
/crt1.o(.text+0x2c): undefined reference to `main\'
« Reply #8 on: May 31, 2004, 05:11:35 pm »
On a positive note, compilation proceeds up to this point and creates a u4 binary drop in replacement to xu4 from http://inter.zon.free.fr/zaurus_index.htmlwhich runs on the zaurus 5600.  

Dont know the long term consequences of this though.  It runs and I am able to move, kill monsters and save the game.

I still would like to know where I am wrong.
Zaurus 5600
Zynergy Rootfs 1.1
Custom zImage

How Do You Do That in Linux