Click here to Skip to main content
15,905,913 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionWhat are the programmers' opinions about Plain English Programming? Pin
Quantum Robin18-Jan-19 8:04
Quantum Robin18-Jan-19 8:04 
QuestionRe: What are the programmers' opinions about Plain English Programming? Pin
David Crow18-Jan-19 16:21
David Crow18-Jan-19 16:21 
AnswerRe: What are the programmers' opinions about Plain English Programming? Pin
leon de boer19-Jan-19 2:48
leon de boer19-Jan-19 2:48 
GeneralRe: What are the programmers' opinions about Plain English Programming? Pin
Stefan_Lang20-Jan-19 22:08
Stefan_Lang20-Jan-19 22:08 
AnswerRe: What are the programmers' opinions about Plain English Programming? Pin
Alan Balkany22-Jan-19 5:45
Alan Balkany22-Jan-19 5:45 
QuestionHow to recognize a MutliTouch Input Event ? Pin
Member 1406801918-Jan-19 3:11
Member 1406801918-Jan-19 3:11 
AnswerRe: How to recognize a MutliTouch Input Event ? Pin
Victor Nijegorodov18-Jan-19 5:14
Victor Nijegorodov18-Jan-19 5:14 
AnswerRe: How to recognize a MutliTouch Input Event ? Pin
k505418-Jan-19 5:18
mvek505418-Jan-19 5:18 
QuestionToolbar for bottom split window - CSplitterWnd Pin
Anu_Bala15-Jan-19 23:31
Anu_Bala15-Jan-19 23:31 
AnswerRe: Toolbar for bottom split window - CSplitterWnd Pin
Victor Nijegorodov15-Jan-19 23:44
Victor Nijegorodov15-Jan-19 23:44 
GeneralRe: Toolbar for bottom split window - CSplitterWnd Pin
Anu_Bala16-Jan-19 0:09
Anu_Bala16-Jan-19 0:09 
GeneralRe: Toolbar for bottom split window - CSplitterWnd Pin
Victor Nijegorodov16-Jan-19 1:02
Victor Nijegorodov16-Jan-19 1:02 
GeneralRe: Toolbar for bottom split window - CSplitterWnd Pin
Anu_Bala16-Jan-19 1:39
Anu_Bala16-Jan-19 1:39 
GeneralRe: Toolbar for bottom split window - CSplitterWnd Pin
Victor Nijegorodov16-Jan-19 3:41
Victor Nijegorodov16-Jan-19 3:41 
GeneralRe: Toolbar for bottom split window - CSplitterWnd Pin
Anu_Bala16-Jan-19 17:26
Anu_Bala16-Jan-19 17:26 
GeneralRe: Toolbar for bottom split window - CSplitterWnd Pin
Victor Nijegorodov17-Jan-19 8:47
Victor Nijegorodov17-Jan-19 8:47 
QuestionAre there programmers that are currently using machine code and Assembly? Pin
Quantum Robin13-Jan-19 7:53
Quantum Robin13-Jan-19 7:53 
AnswerRe: Are there programmers that are currently using machine code and Assembly? Pin
HS_C_Student13-Jan-19 10:56
HS_C_Student13-Jan-19 10:56 
GeneralRe: Are there programmers that are currently using machine code and Assembly? Pin
HS_C_Student13-Jan-19 11:11
HS_C_Student13-Jan-19 11:11 
GeneralRe: Are there programmers that are currently using machine code and Assembly? Pin
Quantum Robin13-Jan-19 16:39
Quantum Robin13-Jan-19 16:39 
AnswerRe: Are there programmers that are currently using machine code and Assembly? Pin
leon de boer13-Jan-19 16:34
leon de boer13-Jan-19 16:34 
AnswerRe: Are there programmers that are currently using machine code and Assembly? Pin
CPallini13-Jan-19 21:26
mveCPallini13-Jan-19 21:26 
AnswerRe: Are there programmers that are currently using machine code and Assembly? Pin
Joe Woodbury14-Jan-19 6:25
professionalJoe Woodbury14-Jan-19 6:25 
JokeRe: Are there programmers that are currently using machine code and Assembly? Pin
Quantum Robin14-Jan-19 13:52
Quantum Robin14-Jan-19 13:52 
Questionerror: expected identifier before string constant Pin
Vaclav_13-Jan-19 6:28
Vaclav_13-Jan-19 6:28 
I hope I can explain this problem.

I can make an instance of a class in my main()


C++
CLASS_I2CIO   i2c_ads1115(DEVICE_I2C,ADDRESS_ADS);


no problema.

But if I add same code as class variable - I need an access to the class form main() - I get the following error.

C++
class C_VNA {
public:
	C_VNA();
	virtual ~C_VNA();

	C_Utility utility;
	CLASS_LCM1602 i2c;	// default constructor x,x,x,x);
	CIOCTLGPIO gpio;    // GPIo
	C_IOCTL_SPI spi;    // temporary not coded
	C_DDS_60 dds;       // frequency
	C_AD8302_Detector det;
    C_ADS1115 ads;
    CLASS_I2CIO   i2c_ioctl;       // genric i2c using ioctl

error here 
    CLASS_I2CIO   i2c_ads1115_test(DEVICE_I2C,ADDRESS_ADS);
error here 
};



Partial compiler output

C++
Compiler executable checksum: 606522cdd68a1ba2fd9e2930e9d38d0d
In file included from ../src/MODULES/M_VNA/CVNA.cpp:8:0:
../src/MODULES/M_VNA/CVNA.h:28:20: error: expected identifier before string constant
 #define DEVICE_I2C "dev/i2c-1"
                    ^
../src/MODULES/M_VNA/CVNA.h:60:36: note: in expansion of macro ‘DEVICE_I2C’
src/MODULES/M_VNA/subdir.mk:18: recipe for target 'src/MODULES/M_VNA/CVNA.o' failed
     CLASS_I2CIO   i2c_ads1115_test(DEVICE_I2C,ADDRESS_ADS);
                                    ^
../src/MODULES/M_VNA/CVNA.h:28:20: error: expected ‘,’ or ‘...’ before string constant
 #define DEVICE_I2C "dev/i2c-1"
                    ^
../src/MODULES/M_VNA/CVNA.h:60:36: note: in expansion of macro ‘DEVICE_I2C’
     CLASS_I2CIO   i2c_ads1115_test(DEVICE_I2C,ADDRESS_ADS);
                                    ^
make: *** [src/MODULES/M_VNA/CVNA.o] Error 1


There is nothing special about #defines

C++
// devices
#define DEVICE_SPI "dev/spidev0.0"
#define DEVICE_I2C "dev/i2c-1"

// define i2c addresses
#define ADDRESS_HITACHI 0x27
#define ADDRESS_ADS 0x48



The error "points " to #define which is redefined in this class - temporary for test purposes.
I did look thru similar problems and they all indicate the #define is NOT the issue, however I am unable to figure this out and correct it.
Any help would be appreciated.
Cheers

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.