Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Re: Unable to compile - VM_DBG.h errors (Read 16943 times)
EagleTSG
Junior Member
**
Offline


Posts: 13
Location: Denver, Colorado
Joined: Mar 10th, 2013
Re: Unable to compile - VM_DBG.h errors
Apr 10th, 2013 at 7:25pm
Print Post  
Thanks, I was the one that posted the message you refered to.  I'm runninng 1.0.3.  Changed to use SoftwareSerial but looks like the SoftwareSerial.h is nowhere to be found.  I can see the conditional include in VM_DBG.h so should be trying to include.  Get the following errors:

Compiling debug version of 'Marlin_gebruikte_dual_ballspindle' for 'Arduino Mega 2560 or Mega ADK'
Marlin_gebruikte_dual_ballspindle.ino : In file included from
VM_DBG.h : ISO C++ forbids declaration of 'SoftwareSerial' with no type
VM_DBG.h : expected ';' before '*' token
VM_DBG.h : 'SoftwareSerial' has not been declared
VM_DBG.h : 'SoftwareSerial' has not been declared
VM_DBG.h : : In member function 'void VisualMicroDebug::setVariable(T&, int, int)':
VM_DBG.h : 'transport' was not declared in this scope
Marlin_gebruikte_dual_ballspindle.ino : : In function 'void setup()':
Marlin_gebruikte_dual_ballspindle.ino : 'Serial' was not declared in this scope
Marlin_gebruikte_dual_ballspindle.ino : 'class VisualMicroDebug' has no member named 'transport'
Marlin_gebruikte_dual_ballspindle.ino : 'class VisualMicroDebug' has no member named 'transport'
Marlin_gebruikte_dual_ballspindle.ino : 'class VisualMicroDebug' has no member named 'transport'
Marlin_gebruikte_dual_ballspindle.ino : 'class VisualMicroDebug' has no member named 'transport'
Marlin_gebruikte_dual_ballspindle.ino : 'class VisualMicroDebug' has no member named 'transport'
Marlin_gebruikte_dual_ballspindle.ino : 'class VisualMicroDebug' has no member named 'transport'
Marlin_gebruikte_dual_ballspindle.ino : 'class VisualMicroDebug' has no member named 'transport'
Marlin_gebruikte_dual_ballspindle.ino : : In function 'void loop()':
Marlin_gebruikte_dual_ballspindle.ino : 'class VisualMicroDebug' has no member named 'transport'
Marlin_gebruikte_dual_ballspindle.ino : 'class VisualMicroDebug' has no member named 'transport'
Marlin_gebruikte_dual_ballspindle.ino : 'class VisualMicroDebug' has no member named 'transport'
Marlin_gebruikte_dual_ballspindle.ino : 'class VisualMicroDebug' has no member named 'transport'
Marlin_gebruikte_dual_ballspindle.ino : 'class VisualMicroDebug' has no member named 'transport'
Marlin_gebruikte_dual_ballspindle.ino : 'class VisualMicroDebug' has no member named 'transport'
VM_DBG.cpp : In file included from
VM_DBG.h : ISO C++ forbids declaration of 'SoftwareSerial' with no type
VM_DBG.h : expected ';' before '*' token
VM_DBG.h : 'SoftwareSerial' has not been declared
VM_DBG.h : 'SoftwareSerial' has not been declared
VM_DBG.h : : In member function 'void VisualMicroDebug::setVariable(T&, int, int)':
VM_DBG.h : 'transport' was not declared in this scope
VM_DBG.cpp : : At global scope:
VM_DBG.cpp : variable or field 'begin' declared void
VM_DBG.cpp : 'SoftwareSerial' was not declared in this scope
VM_DBG.cpp : 'theSerial' was not declared in this scope
VM_DBG.cpp : variable or field 'begin' declared void
VM_DBG.cpp : 'SoftwareSerial' was not declared in this scope
VM_DBG.cpp : 'theSerial' was not declared in this scope
VM_DBG.cpp : expected primary-expression before 'long'
VM_DBG.cpp : : In member function 'void VisualMicroDebug::sendMessage(const char*)':
VM_DBG.cpp : 'transport' was not declared in this scope
VM_DBG.cpp : : In member function 'void VisualMicroDebug::printPortsDigital()':
VM_DBG.cpp : 'transport' was not declared in this scope
VM_DBG.cpp : : In member function 'void VisualMicroDebug::printPinsAnalog()':
VM_DBG.cpp : 'transport' was not declared in this scope
VM_DBG.cpp : : In member function 'uint8_t VisualMicroDebug::readVariableTextDataType()':
VM_DBG.cpp : 'transport' was not declared in this scope
VM_DBG.cpp : : In member function 'uint8_t VisualMicroDebug::readVariableTextLength()':
VM_DBG.cpp : 'transport' was not declared in this scope
VM_DBG.cpp : : In function 'void no_lvalue_err()':
  
Back to top
 
IP Logged
 
EagleTSG
Junior Member
**
Offline


Posts: 13
Location: Denver, Colorado
Joined: Mar 10th, 2013
Re: Unable to compile - VM_DBG.h errors
Reply #1 - Apr 10th, 2013 at 7:26pm
Print Post  
Also, I used the non-alpha version of the debugger from the download page.
  
Back to top
 
IP Logged
 
EagleTSG
Junior Member
**
Offline


Posts: 13
Location: Denver, Colorado
Joined: Mar 10th, 2013
Re: Unable to compile - VM_DBG.h errors
Reply #2 - Apr 10th, 2013 at 7:34pm
Print Post  
I installed:

Debug V3.3 (2012/11) - Stable
 

Arduino for Visual Studio version 1212.30 (Recommended) from codeplex   
 
Visual Micro Debugger Upgrade Installer 33.msi

I also found SoftwareSerial.h needs to be downloaded and installed from Arduino, doing that now.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Unable to compile - VM_DBG.h errors
Reply #3 - Apr 10th, 2013 at 7:37pm
Print Post  
SoftwareSerial is installed with the arduino ide\Libraries. Which version of arduino is VM pointing to?

Please switch on Tools>Options>Visual Micro>Compile>Always show build folder". Then CTRL+Click the link that appears after debug build fails and email the [sketchname].cpp to info [at] visualmicro.com

Thanks
« Last Edit: Apr 10th, 2013 at 7:39pm by Tim@Visual Micro »  
Back to top
IP Logged
 
EagleTSG
Junior Member
**
Offline


Posts: 13
Location: Denver, Colorado
Joined: Mar 10th, 2013
Re: Unable to compile - VM_DBG.h errors
Reply #4 - Apr 10th, 2013 at 11:07pm
Print Post  
Down to one error now:

Compiling 'Marlin_gebruikte_dual_ballspindle' for 'Arduino Mega 2560 or Mega ADK'
Build folder: ballspindle\mega2560
Binary sketch size: 49650 bytes (of a 258048 byte maximum) (5.9727584 secs)
Compiling debug version of 'Marlin_gebruikte_dual_ballspindle' for 'Arduino Mega 2560 or Mega ADK'
Build folder: ballspindle\mega2560
Marlin_gebruikte_dual_ballspindle.ino : : In function 'void setup()':
Marlin_gebruikte_dual_ballspindle.ino : 'Serial1' was not declared in this scope
Error compiling

Sent the cpp with the error as requested.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Unable to compile - VM_DBG.h errors
Reply #5 - Apr 10th, 2013 at 11:31pm
Print Post  
Okay I have now received the screen shot of your project properties which shows where the confusion is. Thanks for sending it.

The problem is that you have set a RemoteTransport of SoftwareSerial but a RemotePort of Serial1

All the serial ports on the Arduino boards are HardwareSerial ports. If you want to use Serial1 then leave the RemoteTransport empty or set it to HardwareSerial.

Based on this the error you are getting is correct because Serial1 does not exist in SoftwareSerial.

If you want to use SoftwareSerial then you should be careful because your project is already attempting to use it. I can't see where your project initializes the SoftwareSerial but I can see the code attempting to use it as MYSERIAL (i think)

FYI: SoftwareSerial works on any interrupt based digitial pins other than the built in Arduino Serialx ports. SoftwareSerial is not so easy to work with if you want multiple versions of it at the same time, it also isn't very friendly if your own code is also sending/receiving data using the same pins.

Because you have a mega 2560 you should hopefully have enough serial ports that you can use Serial1,Serial2,Serial3,Serial4. Or maybe just leave everything empty and use the main usb upload port for debugging?

  
Back to top
IP Logged
 
EagleTSG
Junior Member
**
Offline


Posts: 13
Location: Denver, Colorado
Joined: Mar 10th, 2013
Re: Unable to compile - VM_DBG.h errors
Reply #6 - Apr 11th, 2013 at 12:40am
Print Post  
Thanks, that explains it.  The software uses the USB cable for serial communications  on COM6 but does use the FTDI drivers for this so I believe you may be correct with a concern I had about using software serial communications for debugging.  Although with the main program using the USB com port I may be able to use some pins that are not used by the program which happen to map to rx and tx pins not used.

I will let you know.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Unable to compile - VM_DBG.h errors
Reply #7 - Apr 11th, 2013 at 7:26am
Print Post  
Does the main program use all 4 com/usb ports?
  
Back to top
IP Logged
 
EagleTSG
Junior Member
**
Offline


Posts: 13
Location: Denver, Colorado
Joined: Mar 10th, 2013
Re: Unable to compile - VM_DBG.h errors
Reply #8 - Apr 11th, 2013 at 5:00pm
Print Post  
The only COM port used is COM6, which is also the only COM port that shows up (other than COM1) in device manager.  I tried to use SoftwareSerial and it took over COM6 for debugging (as expected) so the application could not connct with COM6. The documentation says 4 hardware ports are available but software port is only one and is routed over USB cable.

I've tried a compile with HardwareSerial using Serial2 (one of the unused set of pins for the application. 

From Arduino doc:  Serial: 0 (RX) and 1 (TX); Serial 1: 19 (RX) and 18 (TX); Serial 2: 17 (RX) and 16 (TX); Serial 3: 15 (RX) and 14 (TX). Used to receive (RX) and transmit (TX) TTL serial data. Pins 0 and 1 are also connected to the corresponding pins of the ATmega16U2 USB-to-TTL Serial chip. 

0/1, 16/17, 17/18 are not used by Marlin. 

Got following:

Binary sketch size: 49650 bytes (of a 258048 byte maximum) (5.8497428 secs)
Compiling debug version of 'Marlin_gebruikte_dual_ballspindle' for 'Arduino Mega 2560 or Mega ADK'
Marlin_gebruikte_dual_ballspindle.ino : In file included from
VM_DBG.h : ISO C++ forbids declaration of 'HardwareSerial' with no type
VM_DBG.h : expected ';' before '*' token
VM_DBG.h : 'HardwareSerial' has not been declared
VM_DBG.h : 'HardwareSerial' has not been declared
VM_DBG.h : : In member function 'void VisualMicroDebug::setVariable(T&, int, int)':
VM_DBG.h : 'transport' was not declared in this scope
Marlin_gebruikte_dual_ballspindle.ino : : In function 'void setup()':
Marlin_gebruikte_dual_ballspindle.ino : 'Serial2' was not declared in this scope
Marlin_gebruikte_dual_ballspindle.ino : 'class VisualMicroDebug' has no member named 'transport'
Error compiling

I will send information to info (at) vmicro.com
  
Back to top
 
IP Logged
 
EagleTSG
Junior Member
**
Offline


Posts: 13
Location: Denver, Colorado
Joined: Mar 10th, 2013
Re: Unable to compile - VM_DBG.h errors
Reply #9 - Apr 11th, 2013 at 5:03pm
Print Post  
Information has been sent to info (at) visualmicro.com (not vmicro.com).
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Unable to compile - VM_DBG.h errors
Reply #10 - Apr 11th, 2013 at 8:05pm
Print Post  
If you are using an ftdi cable then I think it will always come up on the same local pc port number.

I just compiled a debug version with localPort=Serial2 without a problem so it points to the #includes of your project killing some things.

Please add this to your sketch code and see if it compiles in release mode

Code
Select All
Serial.begin(115200);
Serial.println("Hello");
 



Thanks

You do not need the remoteTX and remoteRx pins that are shown in the screen shot you have sent. They are for softwareserial
« Last Edit: Apr 11th, 2013 at 8:08pm by Tim@Visual Micro »  
Back to top
IP Logged
 
EagleTSG
Junior Member
**
Offline


Posts: 13
Location: Denver, Colorado
Joined: Mar 10th, 2013
Re: Unable to compile - VM_DBG.h errors
Reply #11 - Apr 12th, 2013 at 4:31pm
Print Post  
Thanks for the reply.  I did as requested, with the code in Setup and got errors as pasted below.

I guess I'm confused about Local Port and Remote Port.  I thought Remote Port was a way to debug when the Local Port was being used by the sketch.  From the test below, it appears using Serial2 does not change anything (COM6 still opens as debug window).

Local Port's description is The serial port the local computer uses to debug.  This show COM1, COM6 and was what I typed Serial1 into, it compiled but did not work.

Remote Port is The serial port the remote micro-controller uses to debug and shows Serial to Serial5.

I also ran debugTest code with Serial2 forced into the Local Port with debug enabled and it compiled, with the end result, when I let it run long enough was Serial Serial2 window shows "Port failed to open:"

In case you meant to try with Remote Port=Serial2 I tried that with debugTest and it compiled and ran and output "Hello" to Serial COM6 after it opened COM6 for debug messages.  In the sketch I'm trying to build, COM6 is used by a UI to control the printer and send 3D commands to "print" an object.   


What's the difference, why are there two port settings?  Trying to get my sketch to compile with Serialx is of no use if it does not solve the debug port problem.

Compiling 'Marlin_gebruikte_dual_ballspindle' for 'Arduino Mega 2560 or Mega ADK'
Marlin_gebruikte_dual_ballspindle.ino : : In function 'void setup()':
Marlin_gebruikte_dual_ballspindle.ino : 'Serial' was not declared in this scope
Error compiling

debugTest
int loop_cnt = 0;
void setup()
{
  /* add setup code here */
     pinMode(13, OUTPUT);
              Serial.begin(115200);
              Serial.println("Hello");
}
void loop()
{

  /* add main program code here */
     digitalWrite(13,HIGH);
     loop_cnt++;
     delay(100);
     digitalWrite(13,LOW);
     delay(100);
}
  
Back to top
 
IP Logged
 
EagleTSG
Junior Member
**
Offline


Posts: 13
Location: Denver, Colorado
Joined: Mar 10th, 2013
Re: Unable to compile - VM_DBG.h errors
Reply #12 - Apr 12th, 2013 at 4:42pm
Print Post  
I also tried with the following code in debugTest:

     Serial.begin(115200);
              Serial.println("Hello for Serial");
     Serial2.begin(115200);
     Serial2.println("Hello for Serial2");

I compiled and ran but only opened COM6 with "Hello for Serial".
  
Back to top
 
IP Logged
 
EagleTSG
Junior Member
**
Offline


Posts: 13
Location: Denver, Colorado
Joined: Mar 10th, 2013
Re: Unable to compile - VM_DBG.h errors
Reply #13 - Apr 12th, 2013 at 4:53pm
Print Post  
I found a reference to my confusion, but the test with debugTest showed using Serial2 did not change the use of COM6 for the debug window:

"www.visualmicro.com/category/Arduino-Debug"

Remote Port enabled us to override the serial port that the debugger uses. By default it uses the main Arduino Serial port and initialises the port speed to 115k. You may optional override the speed of the port or both the speed and the port. This option might be useful if you already use the main serial port or if you want to manually initialise the debug port in the sketch setup() function.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Unable to compile - VM_DBG.h errors
Reply #14 - Apr 12th, 2013 at 6:16pm
Print Post  
Hi,

This means that COM6 is a usb cable connected to the main serial/upload port.

If you are using an ftdi cable then you need to plug the tx and rx of the cable into the rx2 and tx2 of the Arduino board. You will need two ftdi cables for ease, one for upload and one for debug. COM6 is your upload port so the 2nd ftdi will show as a different COM port.

To test you have a valid connection between pc and arduino serial 2 use this code

void setup()
{
Serial2.begin(115200);

void loop()
{
Serial2.println("Hello for Serial2");
}


NB

The LocalPort property relates to the COM/USB port on the pc. The RemotePort is the name of the Arduinio Serialx port you want to debug using. 

If you are using any Serialx port other than the main upload port (which is called Serial in the Arduino code), you must connect a cable from the relevant arduino pins to a usb port on your pc.

Unless you are uploading with a special hardware programmer, you will need one usb cable to upload and one for debug. 

In your case your program already uses the upload usb so as you rightly say you need to use a different Serialx port which can be specified using the LocalPort (pc) and RemotePort (arduino) project properties.
« Last Edit: Apr 12th, 2013 at 6:25pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint