Arduino Mega Serial communication with C++ app


I’ve been trying to get my Arduino Mega to communicate with a simple C++ program through the serial port.

Currently, the Arduino seems to communicate fine with the serial interface and I’ve made a small program allowing me to use the Arduino IDE serial monitor to send and receive data to and from it: it receives the string from the serial monitor and echoes back the result once it has received the string.

Now the problem lies in the following: I’m trying to make a C++ application to allow me to do pretty much the same thing as serial monitor currently does (ie. send a series of bytes to the serial port on which the Arduino is plugged and received the echoed info).
I’ve found a couple of C++ Serial libraries (currently trying out this one: ), made my application, compiles fine but I don’t get any result.

For some reason the Arduino is neither receiveing, nor sending data from and to the C++ Application.

The C++ application is the one currently provided by the site I named above.

Any help with this would be greatly appreciated!


PS: functional Aduino Mega serial echoing code below
Also, I am running on a W7 64bit OS, not sure whether it matters.

// include the library code:
#include <LiquidCrystal.h>

LiquidCrystal lcd(46, 53, 28, 26, 24, 22);
int bytes=0;

void setup()
  lcd.print("Comp 2 Serial");

void loop()
  if(millis()%1000 == 0)
    bytes = Serial.available()+1;
    lcd.print("Comp 2 Serial");
    char str[bytes];
    for(int i=0;i<bytes;i++)
      str[i] =;
    str[bytes-1] = '\0';
    lcd.print("                 ");
    Serial.print("Received: ");