-fpermissive perhaps? > I put this into [PIC] as this has something to do with a breakthrough > with PICkit 2 under Linux. > = > I do not know much about C++ but I am having problem to build a > C++ program under different Linux distros. Ubuntu 6.06 is fine > (with g++ 3.3/3.4/4.0). Ubuntu 7.04/7.10 (with g++ 3.3/3.4/4.1) > and Arch Linux (g++ 4.2) are not fine. > = > This has something to do with Linux version of pk2cmd > (the console version of PICKit 2) which Jeff Post replaced Windows > HID API with libusb under Linux and wrote some replacement > functions for some Windows specific C library functions. > = > Under Ubuntu 6.06 the build process is fine and the resultant > program also works nicely with my limit testing on 16F/18F PICs. > This is really very nice. However I could not build it under other > Ubuntu versions and Arch. > = > The offending codes are in the original source code package > (written for the free Visual C++ 2005 Express Edition). > http://ww1.microchip.com/downloads/en/DeviceDoc/PICkit2_PK2CMD_SourceV1_0= 0.zip > = > For example: > g++ -Wall -D_GNU_SOURCE -O2 -I/usr/local/include -DLINUX -DUSE_DETACH > -DCLAIM_USB -o cmd_app.o -c cmd_app.cpp > In file included from PICkitFunctions.h:4, > from cmd_app.h:2, > from cmd_app.cpp:3: > DeviceData.h:15: error: extra qualification 'CDeviceData::' on member > 'ClearAllData' > DeviceData.h:16: error: extra qualification 'CDeviceData::' on member > 'ClearProgramMemory' > DeviceData.h:17: error: extra qualification 'CDeviceData::' on member > 'ClearConfigWords' > DeviceData.h:18: error: extra qualification 'CDeviceData::' on member > 'ClearUserIDs' > DeviceData.h:19: error: extra qualification 'CDeviceData::' on member > 'ClearEEPromMemory' > = > #pragma once > = > = > = > #define MAX_MEM 262144 > = > #define MAX_EE 8192 > = > #define MAX_CFG 8 > = > #define MAX_UID 128 > = > = > = > class CDeviceData > = > { > = > public: > = > CDeviceData(void); > = > ~CDeviceData(void); > = > void CDeviceData::ClearAllData(unsigned int progMemSize, unsigned > short int eeMemSize, unsigned char numConfigs, > = > unsigned char numIDs, unsigned int memBlankVal, int > eeBytes, int idBytes, > = > unsigned short int configBlank[], unsigned int OSCCALInit); > = > void CDeviceData::ClearProgramMemory(unsigned int progMemSize, > unsigned int memBlankVal); > = > void CDeviceData::ClearConfigWords(unsigned char numConfigs, > unsigned short int configBlank[]); > = > void CDeviceData::ClearUserIDs(unsigned char numIDs, int idBytes, > unsigned int memBlankVal); > = > void CDeviceData::ClearEEPromMemory(unsigned short int eeMemSize, > int eeBytes, unsigned int memBlankVal); > = > = > = > unsigned int ProgramMemory[MAX_MEM]; > = > unsigned int EEPromMemory[MAX_EE]; > = > unsigned int ConfigWords[MAX_CFG]; > = > unsigned int UserIDs[MAX_UID]; > = > unsigned int OSCCAL; > = > unsigned int BandGap; > = > }; > = > = > Once I remove the so called "extra qualification" within all the header > files, I can build the program and the resultant binary is again working. > = > Jeff thinks this is proper C++ and he does not have the time and Linux > distros right now to debug the issues. So I will try to get the help here. > = > What do you think? Could I add a compiler switch to solve the problem. > = > CC=3Dg++ > DBG=3D-O2 > OPTS=3D-Wall -D_GNU_SOURCE $(DBG) > CFLAGS=3D$(OPTS) -I$(LIBUSB)/include -DLINUX -DUSE_DETACH -DCLAIM_USB > = > Thanks in advance. > = > Xiaofan > -- = > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > = > = > = > -- = > No virus found in this incoming message. > Checked by AVG Free Edition. = > Version: 7.5.503 / Virus Database: 269.15.10/1091 - Release Date: 2007-10= -24 > 14:31 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D Ruben J=F6nsson AB Liros Electronic Box 9124, 200 39 Malm=F6, Sweden TEL INT +46 40142078 FAX INT +46 40947388 ruben@pp.sbbs.se =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist