PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Compiler Error expected '=', ',', ';', 'asm' or '__attribute__' before 'type



Nebukat2010
21.11.2013, 19:47
Hallo,
Ich habe folgendes Problem. Wenn ich die Beispiel Programme von der RP6 Base Compilieren möchte bekomme ich folgenden Error:
Fehler 1 expected '=', ',', ';', 'asm' or '__attribute__'before 'typedef Datei: stdint.h 121 1

Die Beispiel Dateien der M256 lassen sich ohne Probleme kompilieren. WinAVR Version WinAVR-20100110

Kann mir jemand weiterhelfen?

Danke
Nebukat

RolfD
21.11.2013, 20:08
Hallo,
ich würd ja sagen, da ist irgendwo in den includierten Dateien oder im Dateikopf vor den Includes ein unbeabsichtigter Editierfehler passiert (c++Kommentar?) und versehentlich abgespeichert worden. Schau mal nach dem Dateidatum der Lib-Dateien ob man erkennen kann was neuerem Datums ist - da sitzt vermutlich dann auch der Fehler drin.
Die original libs und Beispielprogramme lassen sich eigentlich alle ohne Probleme mit make compilieren.
Gruß Rolf

Valen
21.11.2013, 21:54
-Ich habe 3 stdint.h Dateien (Langer als 120 Zeilen) in meinen WinAVR-20010110 Ordner. Zeile 121 ist Fett gedruckt:

\WinAVR-20010110\avr\include\stdint.h :
#else /* !defined(__DOXYGEN__) */

/* actual implementation goes here */

typedef int int8_t __attribute__((__mode__(__QI__)));
typedef unsigned int uint8_t __attribute__((__mode__(__QI__)));
typedef int int16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int uint16_t __attribute__ ((__mode__ (__HI__)));
typedef int int32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int uint32_t __attribute__ ((__mode__ (__SI__)));
#if !__USING_MINT8
typedef int int64_t __attribute__((__mode__(__DI__)));
typedef unsigned int uint64_t __attribute__((__mode__(__DI__)));
#endif

\WinAVR-20010110\avr32\include\stdint.h :

#if __have_long64
typedef signed long int64_t;
typedef unsigned long uint64_t;
#define __int64_t_defined 1
#elif __have_longlong64
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
#define __int64_t_defined 1
#elif __STDINT_EXP(INT_MAX) > 0x7fffffff
typedef signed int int64_t;
typedef unsigned int uint64_t;
#define __int64_t_defined 1
#endif

\WinAVR-20010110\avr\sys-include\stdint.h :

#if __have_long64
typedef signed long int64_t;
typedef unsigned long uint64_t;
#define __int64_t_defined 1
#elif __have_longlong64
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
#define __int64_t_defined 1
#elif __STDINT_EXP(INT_MAX) > 0x7fffffff
typedef signed int int64_t;
typedef unsigned int uint64_t;
#define __int64_t_defined 1
#endif

Nebukat2010
21.11.2013, 22:47
hi Also er nutzt anscheinen die \WinAVR-20010110\avr\include\stdint.h :. Die Beispiel Dateien sind frisch runter geladen also aktuelle Version. Die m256 Wifi Beispiele funktionieren ja auch ohne Probleme.
/*
* ************************************************** **************************
* RP6 ROBOT SYSTEM - ROBOT BASE EXAMPLES
* ************************************************** **************************
* Example: LEDs and Serial Interface Example
* Author(s): Dominik S. Herwald
* ************************************************** **************************
* Description:
* A typical "Hello World" program for the RP6. Writes text to the PC with the
* Serial Interface and shows a running Light with the LEDs afterwards.
*
* You can watch the text output when RP6 is connected to the USB interface
* with the Terminal in RP6Loader.
* In the RP6Loader Software switch to the tab "Terminal" and use the
* menu item RP6Loader->Start Target or whatever the text is for the
* language you selected.
* (or press strg+s on your keyboard)
*
* Also take a look at "RP6Base_LEDs_uncommented.c"! There you can see how
* this file looks like without any comments. Much shorter and for some of you
* maybe better to understand.
*
* ################################################## ##########################
* The Robot does NOT move in this example! You can simply put it on a table
* next to your PC and you should connect it to the PC via the USB Interface!
* ################################################## ##########################
* ************************************************** **************************
*/

/************************************************** ***************************/
// Includes:

#include "RP6RobotBaseLib.h" // The RP6 Robot Base Library.
// Always needs to be included!

/************************************************** ***************************/
// Main function - The program starts here:

int main(void)
{
initRobotBase(); // Always call this first! The Processor will not work
// correctly otherwise.

// ---------------------------------------
// Write messages to the Serial Interface
// (here it is a RP6 text logo):
writeString_P("\n\n _______________________\n");
writeString_P(" \\| RP6 ROBOT SYSTEM |/\n");
writeString_P(" \\_-_-_-_-_-_-_-_-_-_/\n\n");

// Explanation of special chars:
// '\n' = new line
// '\\' = '\'
// These are "escape sequences" for characters you can not
// use directly within strings.

// Write "Hello World" to the Serial Interface:
writeString_P("Hello World! My name is Robby!\n");
writeString_P("Let's go! :)\n");

// ---------------------------------------
// LEDs:
setLEDs(0b111111); // Turn all LEDs on!

// 0b111111 is a binary value and is the same as
// 63 in the decimal system.
// For this routine, the binary value is better to read, because each bit
// represents one of the LEDs.
// e.g. this:
// setLEDs(0b000001); would set only LED1
// setLEDs(0b000010); LED2
// setLEDs(0b000100); LED3
// setLEDs(0b101001); LED6, LED4, LED1 - and so on!

mSleep(1000); // delay 1000ms = 1s
setLEDs(0b000000); // All LEDs off!
mSleep(500); // delay 500ms = 0.5s


// ---------------------------------------

uint8_t runningLight = 1; // This defines the local unsigned 8 bit variable "runningLight".
// It can be accessed everywhere _below_ in this function.
// And ONLY within this function!

// ---------------------------------------
// Main loop - the program will loop here forever!
// In this program, it only runs a small LED chaselight.
while(true)
{
// Here we do a small LED test:
// ---------------------------------------

setLEDs(runningLight); // Set status LEDs to the value of the variable
// testLEDs.
// In the first loop iteration it has the value 1,
// and thus the StatusLED1 will be switched on.

runningLight <<= 1; // shift the bits of "runningLight" one step to the left.
// As there is only one bit set in this variable,
// only one LED is on at the same time.
// This results is a moving light dot like this:
// 1: 0b000001
// 2: 0b000010
// 3: 0b000100
// 4: 0b001000
// 5: 0b010000
// 6: 0b100000
//
// In decimal format that would be the numbers:
// 1, 2, 4, 8, 16, 32

// When we have reached a value > 32 (32 means Status LED6 is on),
// we need to reset the value of runningLight to 1 to start again
// from the beginning...
// Instead of "32" we could also write "0b100000".
if(runningLight > 32)
runningLight = 1; // reset runningLight to 1 (StatusLED1)

// If we want to see the running Light, we need to
// add a delay here - otherwise our human eyes would not see
// the moving light dot:
mSleep(100); // delay 100ms = 0.1s

// ---------------------------------------

}
// End of main loop
// ---------------------------------------

// ---------------------------------------
// The Program will NEVER get here!
// (at least if you don't perform a "break" in the main loop, which
// you should not do usually!)

return 0;
}


hier die Datei die ich versucht habe zu kompilieren.

Danke für die Hilfe
Nebukat

RolfD
21.11.2013, 23:03
Das rumrätseln bringt nix... der Fehler liegt eher nicht in den winavr Geschichten und auch nicht in den RP6 libs/examples.
Also was bleibt übrig? Verschossene Pfade in den makefiles oder ein Fehler / Typo im (geänderten?) Quellcode bevor du was includierst.
Lade dir die libs/examples einfach noch mal und pack sie irgendwo aus wo sie nicht stören und versuchs mit den enthaltenen makefiles.
Wenn das nicht klappt, brauchen wir mehr infos... Aso und Simelys ausschalten wenn du Code hochlädst...!
Und ist das die erste Fehlermeldung .. oder die letzte von mehreren... steht da nur das?
Gruß Rolf

Nebukat2010
22.11.2013, 08:52
Ok Danke.
Problem gelöst hab die Dateien neu runtergeladen und es ging. Keine Ahnung warum das vorher nicht ging ich habe die Beispiel Dateien erst vor 3 oder 4 Tagen neu geladen. Bis heute aber keine geändert. Dadurch habe ich diese natürliche erst mal ausgeschlossen.

Vielen Dank für die Hilfe
Nebukat