problem to solve error code "expected constructor....before ';' token

Hi

I'm new to programming and to Arduino (Uno) and am having trouble understanding how to solve an error code "expected constructor, destructor or type conversion before ';' token" in the following code. I've solve a lot of other issues but stuck on this one. The error message appears to be connected to the line

void_lowlevel_ReadEncoder(int &rotate,int& press)

If anybody can spot my mistake I'd be very grateful. The code is to operate a magnetic sensor connected to an encoder and Uno the idea being to plot the magnetic field against distance. It was working but I've messed it up somehow.

#include <Wire.h>
#include<Adafruit_LSM303.h>
Adafruit_LSM303 lsm;
int val;
int totmag;

// Digital pin definitions
enum enDigitalPins
{
  // Rotary encoder input lines
  dpInEncoderA=2,
  dpInEncoderB=4,
  dpInEncoderPress=6,
};

static void _ResetPins()
{
  // Rotary encoder input lines
  // Configure as input, turn on pullup resistors
  pinMode(dpInEncoderA, INPUT);
  digitalWrite(dpInEncoderA, HIGH);
  pinMode(dpInEncoderB, INPUT);
  digitalWrite(dpInEncoderB, HIGH);
  pinMode(dpInEncoderPress, INPUT);
  digitalWrite(dpInEncoderPress, HIGH);
}

void setup()
{
  //configure the pins
  _ResetPins();

  // init serial communication
  Serial.begin(9600);
  config_MP();
  Serial.println("Ready to begin");

  // start adafruit
  if (!lsm.begin())   // Try to initialise and warn if we couldn't detect
  {
    Serial.println("Oops...unable to initialise the LSM303. Check wiring");
    while (1);
   }
   //end adafruit
  }

  
void_lowlevel_ReadEncoder(int &rotate,int& press)
 {
    rotate = (digitalRead(dpInEncoderB) * 2) +digitalRead(dpInEncoderA);
    press =digitalRead(dpInEncoderPress);
  }
  
  void loop()
  {
   ReadEncoder(); 
  }



  void ReadEncoder()
  {
    int Position, Press;
    int isFwd = 0;
    int depth = 0;

    _ResetPins();
    Serial.println("Reading the encoder... rotate the knob by one click");
   _lowlevel_ReadEncoder(Position, Press);
   while (!Serial.available())
  {
    int Position2, Press2;
    do
    {
      _lowlevel_ReadEncoder(Position2, Press2);
    }while ((Position2 == Position) && (Press2 == Press));
    if (Position2 != Position)
    {
      // "Forward" is shown by the position going from (0 to 1) or (1 to 3)
      // or (3 to 2) or (2 to 0). Anything else indicates that the user is 
      // turning the device the other way.

      int isFwd = ((Position == 0) && (Position2 == 1)) ||
      ((Position == 1) && (Position2 == 3)) ||
      ((Position == 3) && (Position2 == 2)) ||  
      ((Position == 2) && (Position2 == 0));
          depth = depth + (isFwd ? 10 : -10); //this yields four depth measurements

       lsm.read();   // reads the magnetometer

           val =sq(lsm.magData.x);
           val = val +sq(lsm.magData.y);
           val = val +sq(lsm.magData.z);
           val =sqrt(val);    // calculate total magnetic field

       float Pi = 3.14159;

    // Calculate the angle of the vector y,x
    float heading = (atan2(lsm.magData.z,lsm.magData.x) * 180) / Pi;
    // Normalise  to 0-360
    if (heading < 0)
    {
      heading = 360 + heading;
    }
           Serial.print(depth/4);
           Serial.print(",");
           //Serial.print((int)lsm.magData.x);
           //Serial.print(".");
           Serial.print((int)lsm.magData.y);
           Serial.print(".");
           //Serial.print((int)lsm.magData.z);
           //Serial.print(".");
           Serial.print(depth/4);
           Serial.print(".");
           Serial.print(val);
           Serial.print(".");
           Serial.print(depth/4);
           Serial.print(".");
           Serial.println((int)lsm.accelData.z);
           Serial.print("Compass Heading: ");
           Serial.println(heading);   
           
    }
 if (Press2 != Press)
 {
  Serial.println(Press ? "Press" :"Release");
 }
 Position = Position2;
 Press = Press2;
  }
  }
void_lowlevel_ReadEncoder(int &rotate,int& press)

Shouldn't_there_be_a_space_in_there_somewhere?

doh ! Thanks for the pointer, that seems to have worked and compiling has now progressed further but now gets stuck on "linking everything together"

but now gets stuck on "linking everything together"

Well, isn't it obvious what the problem is?

The function "config_MP()" is not declared.

Hi

Thanks for the suggestion, I've started a new topic with more info to try to resolve it. My main problem is that I have had a 2 year gap between now and when I wrote code for arduino and now I can't work out why the code I wrote no longer works as I 've forgotten how to do it!