View Single Post
Old 16 February 2014, 13:35   #2
thomas
Registered User
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 5,948
You have to put minstart.o before hello_min.c in the command line. If you link without standard lib, then the first object module becomes the entry to the program. If hello_min is first, then main becomes the entry and not minstart as intended.

Given that minstart.o does not do much anyway, it's completely superfluous IMHO.

If this is your hello_min.c:

Code:
#include <proto/exec.h>

#define __NOLIBBASE__
#include <proto/dos.h>

struct Library *DOSBase;

int main (void)

{
if (DOSBase = OpenLibrary ("dos.library",36))
	{
	Printf ("Hello World!\n");

	CloseLibrary (DOSBase);
	}

return (RETURN_OK);
}
then this is my hello_min_min.c which links well without minstart.o:

Code:
#define __NOLIBBASE__
#include <proto/exec.h>
#include <proto/dos.h>

struct Library *SysBase;
struct Library *DOSBase;

__saveds
int main (void)

{
SysBase = *((struct Library **)4);

if (DOSBase = OpenLibrary ("dos.library",36))
	{
	Printf ("Hello World!\n");

	CloseLibrary (DOSBase);
	}

return (RETURN_OK);
}
thomas is offline  
 
Page generated in 0.04153 seconds with 11 queries