Huhu,
ich wollte zu atom.io und Makefile wechseln für meine C++ Projekte.
Jetzt habe ich hier zwei Makefiles, eins für das Projekt, eins für die Engine. Allerdings habe ich Probleme Bibliotheken einzubinden. Ich habe mich dazu an der Ausgabe von eclipse orientiert, aber bekomme Fehler für "does not name a type".
Eigentlich habe ich den g++ noch nie von Hand bedient, daher brauche ich etwas Hilfe den Fehler zu finden.
Erstmal hier die beiden Makefiles (nicht wundern, ich versuche die später noch etwas zu automatisieren):
https://github.com/DeKugelschieber/Burni…ew/src/Makefile
https://github.com/DeKugelschieber/Burni…ngByte/Makefile
Dann die Ausgabe:
|
Quellcode
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
// ... g++ Compiler Aufrufe
g++ -std=c++11 -Wall -g3 -lglut -lalut -lopenal -lGL -Idl -lpthread -c ./main.cpp -o ../bin/main.o
In file included from ./BurningByte/bb.hpp:5:0,
from ./main.cpp:2:
./BurningByte/gl3w/gl3w.h:70:8: error: ‘PFNGLDRAWARRAYSPROC’ does not name a type
extern PFNGLDRAWARRAYSPROC gl3wDrawArrays;
^
./BurningByte/gl3w/gl3w.h:71:8: error: ‘PFNGLDRAWELEMENTSPROC’ does not name a type
extern PFNGLDRAWELEMENTSPROC gl3wDrawElements;
^
./BurningByte/gl3w/gl3w.h:72:8: error: ‘PFNGLGETPOINTERVPROC’ does not name a type
extern PFNGLGETPOINTERVPROC gl3wGetPointerv;
^
./BurningByte/gl3w/gl3w.h:73:8: error: ‘PFNGLPOLYGONOFFSETPROC’ does not name a type
extern PFNGLPOLYGONOFFSETPROC gl3wPolygonOffset;
^
./BurningByte/gl3w/gl3w.h:74:8: error: ‘PFNGLCOPYTEXIMAGE1DPROC’ does not name a type
extern PFNGLCOPYTEXIMAGE1DPROC gl3wCopyTexImage1D;
^
./BurningByte/gl3w/gl3w.h:75:8: error: ‘PFNGLCOPYTEXIMAGE2DPROC’ does not name a type
extern PFNGLCOPYTEXIMAGE2DPROC gl3wCopyTexImage2D;
^
./BurningByte/gl3w/gl3w.h:76:8: error: ‘PFNGLCOPYTEXSUBIMAGE1DPROC’ does not name a type
extern PFNGLCOPYTEXSUBIMAGE1DPROC gl3wCopyTexSubImage1D;
^
./BurningByte/gl3w/gl3w.h:77:8: error: ‘PFNGLCOPYTEXSUBIMAGE2DPROC’ does not name a type
extern PFNGLCOPYTEXSUBIMAGE2DPROC gl3wCopyTexSubImage2D;
^
./BurningByte/gl3w/gl3w.h:78:8: error: ‘PFNGLTEXSUBIMAGE1DPROC’ does not name a type
extern PFNGLTEXSUBIMAGE1DPROC gl3wTexSubImage1D;
^
./BurningByte/gl3w/gl3w.h:79:8: error: ‘PFNGLTEXSUBIMAGE2DPROC’ does not name a type
extern PFNGLTEXSUBIMAGE2DPROC gl3wTexSubImage2D;
^
./BurningByte/gl3w/gl3w.h:80:8: error: ‘PFNGLBINDTEXTUREPROC’ does not name a type
extern PFNGLBINDTEXTUREPROC gl3wBindTexture;
^
./BurningByte/gl3w/gl3w.h:81:8: error: ‘PFNGLDELETETEXTURESPROC’ does not name a type
extern PFNGLDELETETEXTURESPROC gl3wDeleteTextures;
^
./BurningByte/gl3w/gl3w.h:82:8: error: ‘PFNGLGENTEXTURESPROC’ does not name a type
extern PFNGLGENTEXTURESPROC gl3wGenTextures;
^
./BurningByte/gl3w/gl3w.h:83:8: error: ‘PFNGLISTEXTUREPROC’ does not name a type
extern PFNGLISTEXTUREPROC gl3wIsTexture;
^
make: *** [test] Fehler 1
marvin@marvin-desktop:~/Projekte/BurningByte/src$
|
Der Fehler bezieht sich auf die
gl3w.h, mein OpenGL wrapper.
Die Ausgabe von eclipse zu der Datei sieht so aus:
|
Quellcode
|
1
2
3
4
5
|
Building file: ../src/BurningByte/gl3w/gl3w.c
Invoking: GCC C Compiler
gcc -std=c++11 -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/BurningByte/gl3w/gl3w.d" -MT"src/BurningByte/gl3w/gl3w.d" -o "src/BurningByte/gl3w/gl3w.o" "../src/BurningByte/gl3w/gl3w.c"
cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C [enabled by default]
Finished building: ../src/BurningByte/gl3w/gl3w.c
|
Mit dem -MT"src/BurningByte/gl3w/gl3w.d" kann ich garnichts anfangen und ansonsten würde ich sagen müsste es bei mir eigentlich auch funktionieren...
Spielt die Reihenfolge eigentlich eine Rolle? Aktuell bastel ich aus jeder .cpp Datei eine .o Datei und linke die dann am Ende alle zusammen. Die .hpp werden ja auch automatisch einbezogen (oder?).
Dann noch etwas was eigentlich so auch nicht sein sollte. In der main.cpp steht ganz oben #include <GL/freeglut.h>. Wenn ich das weg lasse bekomme ich allerdings "/home/marvin/Projekte/BurningByte/src/./main.cpp:35: Nicht definierter Verweis auf `glut<IRGENDWAS>'
" und das auch noch mal für alle OpenAL Funktionen, obwohl diese gelinkt und eigentlich in bb.h eingebunden werden.