Install and configure VCS 1 SDK on a Windows host - SundanceMultiprocessorTechnology/VCS-1 GitHub Wiki
- EMC2-Zxxx
- FM191-Rxx
- Microsoft Windows 7 x64
- Mosquitto broker (only required for local tests. Details provided in the meeting the requirements section)
- paho.mqtt.c (details provided in the meeting the requirements section)
- paho.mqtt.cpp (details provided in the meeting the requirements section)
- Build and Run tests - The VCS-1 (FM191) Windows SDK was built and tested in Microsoft Windows 7 x64 bit using the Cygwin and on Ubuntu 16.04.04 x86_64 LTS.
- Support requests. All the support requests must be logged here.
On Windows, one must install Cygwin gcc.
Cygwin GCC: Read How to install Cygwin. Make sure that you select the following packets:
- cmake
- extra-cmake-modules
- gcc-core
- gdb
- g++
- make
- openssl
- pthreads
- ninja
- git
- doxygen
- graphviz
- libssl-dev
Two ways to install CDT, depending on whether you have previously installed an Eclipse:
If you have already installed "Eclipse for Java Developers" or other Eclipse packages, you could install the CDT plug-in as follows:
- Launch Eclipse ⇒ Help ⇒ Install New Software ⇒ In "Work with" field, pull down the drop-down menu and select "Kepler - http://download.eclipse.org/releases/kepler" (or juno for Eclipse 4.2; or helios for Eclipse 3.7). In "Name" box, expand "Programming Language" node ⇒ Check "C/C++ Development Tools" ⇒ "Next" ⇒ ... ⇒ "Finish".
- If you have not to install any Eclipse package, you could download "Eclipse IDE for C/C++ Developers" from here, and unzip the downloaded file into a directory of your choice.
Step 0: Launch Eclipse
Start Eclipse by running "eclipse.exe" in the Eclipse installed directory.
Choose an appropriate directory for your workspace (i.e., where you would like to save your works).
If the "welcome" screen shows up, close it by clicking the "close" button.
Step 1: Create a new C++ Project
For each C++ application, you need to create a project to keep all the source codes, object files, executable files, and relevant resources.
To create a new C++ project:
Choose "File" menu ⇒ "New" ⇒ Project... ⇒ C/C++ ⇒ C++ project.
The "C++ Project" dialogue pops up.
In "Project name" field, enter "FirstProject".
In "Project Types" box, select "Executable" ⇒ "Empty Project".
In "Toolchains" box, choose your compiler, e.g., "Cygwin GCC" or "MinGW GCC" ⇒ Next.
The "Select Configurations" dialogue appears. Select both "Debug" and "Release" ⇒ Finish.
Step 2: Write a Hello-world C++ Program
In the "Project Explorer" (leftmost panel) ⇒ Right-click on "FirstProject" (or use the "File" menu) ⇒ New ⇒ Source File.
The "New Source File" dialogue pops up.
In "Source file" field, enter "Hello.cpp".
Click "Finish".
The source file "Hello.cpp" opens on the editor panel (double-click on "test.cpp" to open if necessary). Enter the following codes:
#include <iostream>
using namespace std;
int main() {
cout << "Hello, world!" << endl;
return 0;
}
If "Unresolved Inclusion Error"
If error "unresolved inclusion" appears next to #include statement, the "include paths for headers" are not set properly. Select "Project" menu ⇒ Properties ⇒ C/C++ General ⇒ Paths and Symbols ⇒ In "Includes" tab:
For Cygwin GCC:
"Add" the following directories to "GNU C", where $CYGWIN_HOME is your Cygwin installed directory:
$CYGWIN_HOME\lib\gcc\i686-pc-cygwin\4.5.x\include
$CYGWIN_HOME\lib\gcc\i686-pc-cygwin\4.5.x\include-fixed
$CYGWIN_HOME\usr\include
$CYGWIN_HOME\usr\include\w32api
"Add" the following directories to "GNU C++", where $CYGWIN_HOME is your Cygwin installed directory:
$CYGWIN_HOME\lib\gcc\i686-pc-cygwin\4.5.x\include\c++
$CYGWIN_HOME\lib\gcc\i686-pc-cygwin\4.5.x\include\c++\i686-pc-cygwin
$CYGWIN_HOME\lib\gcc\i686-pc-cygwin\4.5.x\include\c++\backward
$CYGWIN_HOME\lib\gcc\i686-pc-cygwin\4.5.x\include
$CYGWIN_HOME\lib\gcc\i686-pc-cygwin\4.5.x\include-fixed
$CYGWIN_HOME\usr\include
$CYGWIN_HOME\usr\include\w32api
For MinGW GCC:
"Add" the following directories to "GNU C", where $MINGW_HOME is your MinGW installed directory:
$MINGW_HOME\lib\gcc\mingw32\4.6.x\include
$MINGW_HOME\include
$MINGW_HOME\lib\gcc\mingw32\4.6.x\include-fixed
"Add" the following directories to "GNU C++", where $MINGW_HOME is your Cygwin installed directory:
$MINGW_HOME\lib\gcc\mingw32\4.6.x\include\c++
$MINGW_HOME\lib\gcc\mingw32\4.6.x\include\c++\mingw32
$MINGW_HOME\lib\gcc\mingw32\4.6.x\include\c++\backward
$MINGW_HOME\lib\gcc\mingw32\4.6.x\include
$MINGW_HOME\include
$MINGW_HOME\lib\gcc\mingw32\4.6.x\include-fixed
NOTE: To find the header paths, you can do a search on headers such as "stdio.h" (for C) and "iostream" (for C++) under the Cygwin or MinGW installed directory. Note: If you encounter "error while loading shared libraries" during link. Install "libmpfr4" in cygwin. Step 3: Compile/Build
Right-click on the "FirstProject" (or use the "Project" menu) ⇒ choose "Build Project" to compile and link the program. Step 4: Run
To run the program, right-click on the "FirstProject" (or anywhere on the source "test.cpp", or select the "Run" menu) ⇒ Run As ⇒ Local C/C++ Application ⇒ (If ask, choose Cygwin's gdb debugger) ⇒ The output "Hello, world!" appears on the "Console" panel.
NOTE: You need to create a new C++ project for EACH of your programming problems. This is messy for writing toy programs!
-
Download and install (paho.mqtt.c)[https://github.com/eclipse/paho.mqtt.c.git]. Please follow the instructions provided in the (paho.mqtt.c repository)[https://github.com/eclipse/paho.mqtt.cpp]. Please note that the installation must be done through the Cygwin or Mingw terminals.
-
Download and install (paho.mqtt.cpp)[https://github.com/eclipse/paho.mqtt.cpp.git]. Please follow the instructions provided in the (paho.mqtt.cpp repository)[https://github.com/eclipse/paho.mqtt.cpp]. Please note that the installation must be done trought the Cygwin or Mingw terminals.
-
Install mosquitto broker. How to install mosquitto broker
-
Recommended reading MQTT C++ Client for Posix and Windows
Open the cygwin terminal and change directory to the eclipse-workspace check where the terminal was open
$ pwd
Please note that in my case I am getting /cygdrive/c/Users/Pedro Machado/AppData/Roaming/SPB_Data and I want to go to /cygdrive/c/Users/Pedro Machado/eclipse-workspace
$ cd ../../../eclipse-workspace
now one just need to clone the repository, compile and run.
$ git clone https://github.com/SundanceMultiprocessorTechnology/VCS-1.git
$ cd VCS-1/Software/FM191_SDK
$ make
$ ./emc2-fm191.exe
Please be aware that communication between the Windows machine with the VCS-1 is made using mqtt. Therefore we invite the user to read the following article MQTT C++ Client for Posix and Windows. Please note that the user is allowed to compile the project in eclipse but must lunch the binary file from the Cygwin terminal.