C++ in AVR Studio verwenden-> Funktioniert nicht!

Gast #2398141
Lesenswert?

Hallo,

also ich habe AVR Studio 5 installiert und wollte meine Programme mit 
C++ schreiben aber ich komme irgendwie nicht über diesen Fehlre hinweg!

1
------ Build started: Project: AVRGCC2, Configuration: Release AVR ------
2
Build started.
3
Project "AVRGCC2.avrgccproj" (default targets):
4
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
5
Target "CoreBuild" in file "D:\Program Files\Vs\AvrGCC.targets" from project "C:\Documents and Settings\Administrator\My Documents\AVRStudio\AVRGCC2\AVRGCC2\AVRGCC2.avrgccproj" (target "Build" depends on it):
6
  Task "RunAvrGCC"
7
    D:\Program Files\AVR Toolchain\bin\make.exe -C "D:\Program Files\AVR Toolchain\bin" -f "avr-c++.exe" all 
8
D:\Program Files\AVR Toolchain\bin\avr-c++.exe(1,1): NUL-Zeichen gelesen; der Rest der Zeile wird ignoriert
9
    make: Entering directory `D:/Program Files/AVR Toolchain/bin'
10
    make: Leaving directory `D:/Program Files/AVR Toolchain/bin'
11
D:\Program Files\AVR Toolchain\bin\avr-c++.exe(1,1): *** missing separator.  Schluss.
12
  Done executing task "RunAvrGCC" -- FAILED.
13
Done building target "CoreBuild" in project "AVRGCC2.avrgccproj" -- FAILED.
14
Done building project "AVRGCC2.avrgccproj" -- FAILED.
15

16
Build FAILED.
17

18

19
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========


Im Errorfenster ist folgende Information zu finden:

1: NULL-Zeichen gelesen; der Rest der Zeile wird ignoriert
2: *** missing separator. Schluss.


Also habe natürlich schon google benutzt aber ohne jetzt großen Erfolg 
erziehlt zu haben!
Ich habe die Einstellung "Use External Makefile" in AVR Studio aktivert 
und "D:\Program Files\AVR Toolchain\bin\avr-c++.exe" dort eingetragen!


Kann jemand mit diesem Fehler etwas Anfangen ?


Gruß
GoldenEyes
Gast #2398169
Lesenswert?

goldeneyes1987 schrieb:
> D:\Program Files\AVR Toolchain\bin\make.exe -C "D:\Program Files\AVR 
Toolchain\bin" -f "avr-c++.exe" all

Diese Zeile sagt make, es solle avr-c++.exe als Makefile verwenden, was 
natürlich völliger Unsinn ist.

> Ich habe die Einstellung "Use External Makefile" in AVR Studio aktivert
> und "D:\Program Files\AVR Toolchain\bin\avr-c++.exe" dort eingetragen!

Als Makefile?
Gast #2398181
Lesenswert?

Ja das wurde mir schnell klar !

Habe das jetzt auf "D:\Program Files\sample\Makefile" geändert!

Habe das hier verwendet "http://mfgkw.dyndns.org/AVR/Makefile";, dass ja 
für c++ geeignet sein soll!?

Jetzt kommt folgende Meldung:
1
------ Build started: Project: AVRGCC2, Configuration: Release AVR ------
2
Build started.
3
Project "AVRGCC2.avrgccproj" (default targets):
4
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
5
Target "CoreBuild" in file "D:\Program Files\Vs\AvrGCC.targets" from project "C:\Documents and Settings\Administrator\My Documents\AVRStudio\AVRGCC2\AVRGCC2\AVRGCC2.avrgccproj" (target "Build" depends on it):
6
  Task "RunAvrGCC"
7
    D:\Program Files\AVR Toolchain\bin\make.exe -C "D:\Program Files\sample" -f "Makefile" all 
8
    The system cannot find the path specified.
9
    make: Entering directory `D:/Program Files/sample'
10
    -f was unexpected at this time.
11
    ECHO is off.
12
    -------- begin --------
13
    avr-gcc (AVR_8_bit_GNU_Toolchain_3.2.3_315) 4.5.1
14
    Copyright (C) 2010 Free Software Foundation, Inc.
15
    This is free software; see the source for copying conditions.  There is NO
16
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
    make: *** [sizebefore] Fehler 255
18
    make: Leaving directory `D:/Program Files/sample'
19
  Done executing task "RunAvrGCC" -- FAILED.
20
Done building target "CoreBuild" in project "AVRGCC2.avrgccproj" -- FAILED.
21
Done building project "AVRGCC2.avrgccproj" -- FAILED.
22

23
Build FAILED.
24
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========


Die Errorliste ist jetzt empty!


Gruß
GoldenEyes
Gast #2398275
Lesenswert?

Also bin erstmal weg von AVR Studio!
Habe das in WinAVR probiert und komme auf folgende Fehlermeldung!
******************************************************************
> "make.exe" all

-------- begin --------
avr-gcc (WinAVR 20100110) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is 
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
PURPOSE.


Compiling: main.c
avr-gcc -c -mmcu=atmega8 -I. -gdwarf-2   -Os -Wall 
-Wa,-adhlns=main.c.lst -I. -std=gnu99 -Wstrict-prototypes 
-DF_OSC=4000000 -DF_CPU=4000000 -MD -MP -MF .deppp/main.o.d main.c -o 
main.o
In file included from main.c:4:
RC.h:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 
'RC'
main.c:8: warning: function declaration isn't a prototype
make.exe: *** [main.o] Error 1

> Process Exit Code: 2
> Time Taken: 00:00
***********************************************************************
1
# RC.h Datei
2

3
#if !defined(_RC_H)
4
#define _RC_H
5

6
#include "flightmode.h"
7

8
class RC {
9
private:
10
  flightmode flightMode;
11
  byte radio_status = 0;
12
public:
13
  void RC();
14
  void init();
15
  flightmode getFlightMode();
16
  int getChValue(int int ch);
17
  byte getState();
18
};
19

20
#endif  //_RC_H
21

22
______________________________________________________
23
# main.c Datei
24

25
#include "RC.h"
26

27
int main()
28

29
{
30
    while(1);
31
    
32
    return 1;
33
}


Ich habe den Hinweis von hp-freund durchgeführt!

Was läuft jetzt schief oder was mach ich falsch?

Gruß
GoldenEyes
Persönliche Seite #2413654
Lesenswert?

goldeneyes1987 schrieb:
> Also bin erstmal weg von AVR Studio!

Warum nur so vorschnell die Flinte ins Korn werfen ... ich musste 
"lediglich" einen halben Tag lang recherchieren, um herauszufinden, dass 
es für AVR Studio 5 direkt von Atmel eine Beta-Version für C++ 
Projekt-Templates gibt. ;-)

1. AVR Studio 5 starten
2. Tools\Extension Manager --> Online Gallery
3. "AVRGCC C++ (Beta)" herunterladen
4. AVR Studio 5 neustarten und ein neues Projekt erstellen

Hinsichtlich funktioneller Einschränkungen siehe:
http://support.atmel.no/bin/customer.exe?=&action=viewKbEntry&id=1001

Werde das mal im Artikel "AVR Studio" unter "Tipps und Tricks" 
verlinken.

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren