Welcome, Guest. Please login or register.

Author Topic: Stuck with VBCC.... *HELP*  (Read 6865 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Thomas

Re: Stuck with VBCC.... *HELP*
« on: January 10, 2014, 06:55:32 PM »
These are missing in your code:

#include
#include
#include

And if you find these, remove them:

#include
#include
#include

Offline Thomas

Re: Stuck with VBCC.... *HELP*
« Reply #1 on: January 10, 2014, 10:38:15 PM »
Try CloseLibrary((struct Library *)IntuitionBase);

How does the corresponding OpenLibrary look like?

Offline Thomas

Re: Stuck with VBCC.... *HELP*
« Reply #2 on: January 11, 2014, 08:16:29 AM »
And this is how it should be:

Code: [Select]

#include <proto/exec.h>
#include <proto/dos.h>
#include <proto/intuition.h>

struct IntuitionBase *IntuitionBase;

struct Screen *my_screen;

struct NewScreen my_new_screen=
{
0,
0,
320,
200,
3,
0,
1,
NULL,
CUSTOMSCREEN,
NULL,
&quot;MY SCREEN&quot;,
NULL,
NULL
};



int main(void)
{
IntuitionBase = (struct IntuitionBase *) OpenLibrary( &quot;intuition.library&quot;, 0 );

if( IntuitionBase == NULL )
return (RETURN_FAIL);

my_screen = (struct Screen *) OpenScreen( &my_new_screen );

if(my_screen == NULL)
{
CloseLibrary( (struct Library *) IntuitionBase );
return (RETURN_FAIL);
}

Delay( TICKS_PER_SECOND * 5); /* changed from 30 seconds to 5 seconds because I am impatient */

CloseScreen( my_screen );

CloseLibrary( (struct Library *) IntuitionBase );

return (RETURN_OK);
}

Offline Thomas

Re: Stuck with VBCC.... *HELP*
« Reply #3 on: January 11, 2014, 07:02:42 PM »
The C language has evolved a bit since those books were written. Older compilers were less strict. Usually this led to bad code. Nowadays the compiler helps you to find errors easier. Older compilers more supported lazy programmers.

So yes, if an example contains

main()
{
...
}

then it probably contains many mistakes which you have to correct.