[C++] Sound abspielen unter Eclipse
-
Schönen guten Tag, vielleicht könnt Ihr mir helfen, da ich
in google entsprechend nicht fündig wurde.Es geht um folgendes ich kann unter Eclipse keine Sounds abspielen,
habe alle bibs. included#include <windows.h> #include <mmsystem.h>
Und im Linker
-lwinmm
hin zu gefügt aber er bringt mir folgende Fehlermeldung :
Description Resource Path Location Type
cannot find -l-lwinmm timer C/C++ ProblemHier mein Code:
#include <iostream> #include <windows.h> #include <mmsystem.h> using namespace std; //#pragma comment(lib, "winmm.lib") int main() { PlaySound((LPCTSTR)SND_ALIAS_SYSTEMSTART, NULL, SND_ALIAS_ID); return 0; }
Danke im Voraus
-
cannot find -l-lwinmm
Entferne mal das
-l
aus deinen Linker-Flags...
-
Eclipse ist eine IDE. Die spielt eher keine Sounds und die übersetzt auch keine Programme. Das macht der Compiler. Und der Linker hat dir einen Fehler gemeldet.
-
Dieser Thread wurde von Moderator/in Arcoth aus dem Forum C++ (alle ISO-Standards) in das Forum Compiler- und IDE-Forum verschoben.
Im Zweifelsfall bitte auch folgende Hinweise beachten:
C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?Dieses Posting wurde automatisch erzeugt.
-
danke @mhm es hat funktioniert .. Ist das immer so?
MFG
-
Offenstichtlich sollstest du nur den Namen der Bibliothek angeben, nicht den kompletten Flag.
-
Habe noch eine Frage wenn ich das Projekt kompiliere und unter Windows 10
aus führe kommt folgende Meldung:libstdc++-6.dll kann nicht gefunden werden.
Benutze Eclipse, weiß jemand einen Rat? Habe es gegoogelt und in den Linker diese statics hinzugefügt:
-static-libgcc -static-libstdc++
Ohne Erfolg
Danke im Voraus
-
Offensichtlich findet dein Programm die libstdc++-6.dll nicht. Entweder du kopierst die in den selben Ordner, oder besser, du passt deine Umgebungsvariablen so an, dass an der richtigen Stelle gesucht wird.
-
Und wie geht das in Eclipse?
-
hast du zu den zwei genannten Optionen noch -static zugefügt?
-
Er sagt folgendes:
Description Resource Path Location Type
cannot find -l-static-libgcc timer2 C/C++ Problem
cannot find -l-static-libstdc++ timer2 C/C++ Problem
-
wozu soll das "-l" vor den zwei Optionen gut sein? Es sind ja keine direkten library-Namen, sondern switches. Schon mal dies hier probiert?
-static
-static-libgcc
-static-libstdc++