francoiscampbell / CLionArduinoPlugin

A plugin for CLion that enables arduino-cmake integration.
155 stars 42 forks source link

Build error when trying to use GU7000 headers for Noritake VFD modules... #21

Open highgain86j opened 8 years ago

highgain86j commented 8 years ago

Basically, I've been working on a few projects that utilize the Noritake's GU7000 series VFD modules. These projects also turned out to require the use of pt.h I suppose this could be a general question on the handling of header files on CLion with the plugin installed. The headers have been loaded via Arduino IDE by importing the distributed zip file and things were working fine under Arduino IDE. Then I decided that I wanted to use a more intelligent IDE so made a switch to CLion (wise or unwise is not the question here because I'm liking CLion anyway :P).

Making things easier, the imported headers/libraries have been moved to C:\Program Files (x86)\Arduino\libraries, and maintains the following structure (copied from GitBash);

$ ls -l /c/Program\ Files\ \(x86\)/Arduino/libraries/GU7000/*
-rw-r--r-- 1 Tahiro 197121   471 6月   2 15:53 '/c/Program Files (x86)/Arduino/libraries/GU7000/GU7000_Interface.h'
-rw-r--r-- 1 Tahiro 197121  2521 6月   2 15:53 '/c/Program Files (x86)/Arduino/libraries/GU7000/GU7000_Parallel.h'
-rw-r--r-- 1 Tahiro 197121  4004 6月   2 15:53 '/c/Program Files (x86)/Arduino/libraries/GU7000/GU7000_Serial_Async.h'
-rw-r--r-- 1 Tahiro 197121  1114 6月   2 15:53 '/c/Program Files (x86)/Arduino/libraries/GU7000/GU7000_Serial_SPI.h'
-rw-r--r-- 1 Tahiro 197121   935 6月   2 15:53 '/c/Program Files (x86)/Arduino/libraries/GU7000/GU7000_Serial_Sync.h'
-rw-r--r-- 1 Tahiro 197121  1382 6月   2 15:53 '/c/Program Files (x86)/Arduino/libraries/GU7000/keywords.txt'
-rw-r--r-- 1 Tahiro 197121 34823 6月   2 15:53 '/c/Program Files (x86)/Arduino/libraries/GU7000/methods.txt'
-rw-r--r-- 1 Tahiro 197121 14542 6月   2 15:53 '/c/Program Files (x86)/Arduino/libraries/GU7000/Noritake_VFD_GU7000.cpp'
-rw-r--r-- 1 Tahiro 197121  6042 6月   2 15:53 '/c/Program Files (x86)/Arduino/libraries/GU7000/Noritake_VFD_GU7000.h'

'/c/Program Files (x86)/Arduino/libraries/GU7000/examples':
total 0
drwxr-xr-x 1 Tahiro 197121 0 6月  10 01:23 BacklightExample/
drwxr-xr-x 1 Tahiro 197121 0 6月  10 01:23 BitmapDrawing/
drwxr-xr-x 1 Tahiro 197121 0 6月  10 01:23 CharacterSets/
drwxr-xr-x 1 Tahiro 197121 0 6月  10 01:23 EastAsianCharacters/
drwxr-xr-x 1 Tahiro 197121 0 6月  10 01:23 Hello/
drwxr-xr-x 1 Tahiro 197121 0 6月  10 01:23 LargeTextDemo/
drwxr-xr-x 1 Tahiro 197121 0 6月  10 01:23 LEDbacklight_test/
drwxr-xr-x 1 Tahiro 197121 0 6月  10 01:23 OnBoardBitmap/
drwxr-xr-x 1 Tahiro 197121 0 6月  10 01:23 Proportional/

For some reasons, none of these headers was correctly referenced by CLion with the plugin installed, and I had to modify the #include array section as follows; From:

#include <GU7000_Interface.h>
#include <GU7000_Serial_Async.h>
#include <Noritake_VFD_GU7000.h>
#include <GU7000_Parallel.h>
#include <GU7000_Serial_SPI.h>
#include <GU7000_Serial_Sync.h>
#include <pt.h>

To:

#include <GU7000/GU7000_Interface.h>
#include <GU7000/GU7000_Serial_Async.h>
#include <GU7000/Noritake_VFD_GU7000.h>
#include <GU7000/GU7000_Parallel.h>
#include <GU7000/GU7000_Serial_SPI.h>
#include <GU7000/GU7000_Serial_Sync.h>
#include <pt/pt.h>

For start, things seemed better but soon with no luck for a successful build. The error message clearly said something was wrong with the referencing of Noritake_VFD_GU7000.h within GU7000_Serial_Async.h on its line:8 (written as #include <Noritake_VFD_GU7000.h>). Likewise, all other referencing of any headers under GU7000 directory had to be rewritten - which made me think that there should be the more correct ways of getting around problems of this kind.

The question is; a.)How differently (from Arduino IDE) are the libraries searched to be included under CLion + plugin? b.)Are there any ways to avoid the modification of header referencing in .ino, .h, or *.cpp files so that codes formerly written in Arduino IDE work on CLion just as is? c.)(This may be hard for you to answer, but...)Woud the use of PlatformIO combined with CLion be any better on this? - I'm now testing both ways.

Tapematch commented 7 years ago

I have the same problem with TFT libraries. Did you solve it and if so, how?