Help compiling? 
Author Message
 Help compiling?

Hi all,

I did not write this source or makefile but I would like to know why it is
failing, any ideas?

$ make
ld -o kernel.elf main.o -dN -Ttext 0x101080
ld: warning: cannot find entry symbol _mainCRTStartup; defaulting to
00101080
main.o: In function `main':
/home/Administrator/os/main.c:25: undefined reference to `__main'
make: *** [kernel.elf] Error 1

Adrian.



Mon, 04 Apr 2005 15:55:04 GMT  
 Help compiling?

Quote:

> Hi all,

> I did not write this source or makefile but I would like to know why it is
> failing, any ideas?

> $ make
> ld -o kernel.elf main.o -dN -Ttext 0x101080
> ld: warning: cannot find entry symbol _mainCRTStartup; defaulting to
> 00101080
> main.o: In function `main':
> /home/Administrator/os/main.c:25: undefined reference to `__main'
> make: *** [kernel.elf] Error 1

> Adrian.

You haven't shown us the source or told us which compiler/platform
you're using. With the wealth, nay, this veritable *feast* of information
we have to work with, we can confidently predict that the error
is on line 38 of main.c.

--
The most likely way for the world to be destroyed, most experts
agree, is by accident. That's where we come in; we're computer
professionals. We cause accidents.       - Nathaniel Borenstein



Mon, 04 Apr 2005 16:38:49 GMT  
 Help compiling?

Quote:
> I did not write this source or makefile but I would like to know why it
> is failing, any ideas?
> $ make
> ld -o kernel.elf main.o -dN -Ttext 0x101080

If you are compiling a kernel, you would probably not want a entry point
called main. More likely there is a some sort of pointer inside an
interrupt table or a piece of code at a strategic point in memory.

Quote:
> ld: warning: cannot find entry symbol _mainCRTStartup; defaulting to
> 00101080

Sounds like the linker knows that 00101080 is the normal entry point for
this CPU.

Quote:
> main.o: In function `main':
> /home/Administrator/os/main.c:25: undefined reference to `__main'

Some compilers like to insert a call to _main() into the main() function.
Usually for calling constructors of global (or static) objects in the C++
world. If you are sure that this is not required, you may be able to get
away with just leaving an empty function called _main behind.

Bill, clutching at straws.

--
 Hey there, write a robot to play Gomoku -
       http://www.bacchae.co.uk/tourk/gomoku.html
                                (I still have some 8" disks for sale)



Mon, 04 Apr 2005 16:49:15 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. need help compiling vc++6 project in vC++.Net

2. TIME FUNCTION -- NEED help compiling

3. please help compile problem

4. HELP: compiling MS C7 source in Borland C 4.5

5. Help compiling FreeBSD C program (POSIX?)

6. Help compiling this code

7. help: compile-time message

8. help compiling mhash-0.8.9.tar.gz

9. Help -- Compile MS-C Ver 6.00 SourceCode

10. Need Help compiling M

11. Need Help compiling Microsoft C with Borland C

12. Need help compiling

 

 
Powered by phpBB® Forum Software