Re: Error when accessing ports.
I generate the code for my chip PIC230F256B
I assume you mean a PIC32MX
It's easier to help if you give the real part number.
If you are #including xc.h then it will be dragging in .\pic32mx\include\lega-c\proc\p32mx230f256b.h which DOES have a definition for LATBbits.LATB7
Are you sure you have the correct PIC device selected in the project properties?
To get a useful answer, always state which PIC you are using!