Hi there,
I have an issue whereby I have created a Windows Forms application using C++ and have a program which sends commands through a serial port. Communicate.cpp is my main form. I have Commands.cpp which holds commands to send down the serial port. In Communicate.h I have a click event which calls function
"elbow()" however whenever I try to build it I get the error: "Error C3861: 'elbow': identifier not found" I have included Commands.h in Communicate.cpp and Commands.h is included in Commands.cpp.
Communicate.h function call:
private: System::Void testBtn_Click(System::Object^ sender, System::EventArgs^ e)
{
elbow(2, 1);
}
Communicate.cpp includes:
#include "Communicate.h"
#include "Commands.h"
Commands.cpp:
#include "Commands.h"
#include "Communicate.h"
using namespace SerialCommunications;
using namespace System;
using namespace System::IO::Ports;
void elbow(int dir, int amt)
{
array<Byte>^ cmd = { 0xff, 0xff, 0xff };
for (int i = 0; i < 255; i++)
{
Communicate::serialPort1->Write(cmd, 0, 3);
cmd[2]--;
}
return;
}
Thanks in advance,
Max