hey , i`m building a game using allegro library but i get the following error message .. do u know what might be the problem ?
1 | Compiler: Default compiler |
2 | Building Makefile: "M:\Cars\Makefile.win" |
3 | Executing make... |
4 | make.exe -f "M:\Cars\Makefile.win" all |
5 | g++.exe -D__DEBUG__ -c game.cpp -o game.o -I"M:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"M:/Dev-Cpp/include/c++/3.4.2/backward" -I"M:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"M:/Dev-Cpp/include/c++/3.4.2" -I"M:/Dev-Cpp/include" -DALLEGRO_STATICLINK -g3 |
6 | |
7 | In file included from game.cpp:2: |
8 | cars.cpp: In member function `void car::Desenbuf()': |
9 | cars.cpp:17: warning: passing `float' for converting 3 of `void rotate_sprite(BITMAP*, BITMAP*, int, int, fixed)' |
10 | cars.cpp:17: warning: passing `float' for converting 4 of `void rotate_sprite(BITMAP*, BITMAP*, int, int, fixed)' |
11 | |
12 | g++.exe -D__DEBUG__ -c cars.cpp -o cars.o -I"M:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"M:/Dev-Cpp/include/c++/3.4.2/backward" -I"M:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"M:/Dev-Cpp/include/c++/3.4.2" -I"M:/Dev-Cpp/include" -DALLEGRO_STATICLINK -g3 |
13 | |
14 | cars.cpp: In member function `void car::Desenbuf()': |
15 | cars.cpp:17: warning: passing `float' for converting 3 of `void rotate_sprite(BITMAP*, BITMAP*, int, int, fixed)' |
16 | cars.cpp:17: warning: passing `float' for converting 4 of `void rotate_sprite(BITMAP*, BITMAP*, int, int, fixed)' |
17 | |
18 | g++.exe -D__DEBUG__ main.o game.o cars.o -o "Cars.exe" -L"M:/Dev-Cpp/lib" -mwindows -lalleg_s -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lole32 -ldinput -lddraw -ldxguid -lwinmm -ldsound -g3 |
19 | |
20 | game.o(.text+0x0): In function `ZN3car4LoadEPc': |
21 | M:/Cars/cars.cpp:7: multiple definition of `car::Load(char*)' |
22 | main.o(.text+0x0):M:/Cars/cars.cpp:7: first defined here |
23 | game.o(.text+0xa2): In function `ZN3car8DesenbufEv': |
24 | M:/Cars/cars.cpp:16: multiple definition of `car::Desenbuf()' |
25 | main.o(.text+0x6):M:/Cars/cars.cpp:16: first defined here |
26 | game.o(.text+0x1a8): In function `Z5Tastev': |
27 | M:/Cars/game.cpp:6: multiple definition of `Taste()' |
28 | main.o(.text+0x10c):M:/Cars/game.cpp:6: first defined here |
29 | game.o(.text+0x278): In function `Z8Desenarev': |
30 | M:/Cars/game.cpp:14: multiple definition of `Desenare()' |
31 | main.o(.text+0x1dc):M:/Cars/game.cpp:14: first defined here |
32 | game.o(.text+0x308): In function `Z6Sunetev': |
33 | M:/Cars/game.cpp:18: multiple definition of `Sunete()' |
34 | main.o(.text+0x26c):M:/Cars/game.cpp:17: first defined here |
35 | cars.o(.text+0x0): In function `ZN3car4LoadEPc': |
36 | M:/Cars/cars.cpp:7: multiple definition of `car::Load(char*)' |
37 | main.o(.text+0x0):M:/Cars/cars.cpp:7: first defined here |
38 | cars.o(.text+0xa2): In function `ZN3car8DesenbufEv': |
39 | M:/Cars/cars.cpp:16: multiple definition of `car::Desenbuf()' |
40 | main.o(.text+0x6):M:/Cars/cars.cpp:16: first defined here |
41 | collect2: ld returned 1 exit status |
42 | |
43 | make.exe: *** [Cars.exe] Error 1 |
44 | |
45 | Execution terminated |
What could be the problem? I don't have any variables or functions by these names:
Z5Tastev, Z8Desenarev etc.. i do have however Taste Desenare
Please help
These are not real errors, these are WARNING. You are passing a float where the function wait an int.
cars.cpp:17: warning: passing `float' for converting 3 of `void rotate_sprite(BITMAP*, BITMAP*, int, int, fixed)' cars.cpp:17: warning: passing `float' for converting 4 of `void rotate_sprite(BITMAP*, BITMAP*, int, int, fixed)' cars.cpp:17: warning: passing `float' for converting 3 of `void rotate_sprite(BITMAP*, BITMAP*, int, int, fixed)' cars.cpp:17: warning: passing `float' for converting 4 of `void rotate_sprite(BITMAP*, BITMAP*, int, int, fixed)'
The others are not allegro related, but these are real errors.
1 | game.o(.text+0x0): In function `ZN3car4LoadEPc': |
2 | M:/Cars/cars.cpp:7: multiple definition of `car::Load(char*)' |
3 | main.o(.text+0x0):M:/Cars/cars.cpp:7: first defined here |
4 | game.o(.text+0xa2): In function `ZN3car8DesenbufEv': |
5 | M:/Cars/cars.cpp:16: multiple definition of `car::Desenbuf()' |
6 | main.o(.text+0x6):M:/Cars/cars.cpp:16: first defined here |
7 | game.o(.text+0x1a8): In function `Z5Tastev': |
8 | M:/Cars/game.cpp:6: multiple definition of `Taste()' |
9 | main.o(.text+0x10c):M:/Cars/game.cpp:6: first defined here |
10 | game.o(.text+0x278): In function `Z8Desenarev': |
11 | M:/Cars/game.cpp:14: multiple definition of `Desenare()' |
12 | main.o(.text+0x1dc):M:/Cars/game.cpp:14: first defined here |
13 | game.o(.text+0x308): In function `Z6Sunetev': |
14 | M:/Cars/game.cpp:18: multiple definition of `Sunete()' |
15 | main.o(.text+0x26c):M:/Cars/game.cpp:17: first defined here |
16 | cars.o(.text+0x0): In function `ZN3car4LoadEPc': |
17 | M:/Cars/cars.cpp:7: multiple definition of `car::Load(char*)' |
18 | main.o(.text+0x0):M:/Cars/cars.cpp:7: first defined here |
19 | cars.o(.text+0xa2): In function `ZN3car8DesenbufEv': |
20 | M:/Cars/cars.cpp:16: multiple definition of `car::Desenbuf()' |
21 | main.o(.text+0x6):M:/Cars/cars.cpp:16: first defined here |
22 | collect2: ld returned 1 exit status |
23 | |
24 | make.exe: *** [Cars.exe] Error 1 |
25 | |
26 | Execution terminated |
You are using a third party library which you are not linking against. Looks like you need to link this "taste desenar" library, who is using the functions you do not know.
Looks like you need to link this "taste desenar" library, who is using the functions you do not know.
Gull, "multiple definitions" isn't the same as "undefined reference"... If fact, it's the opposite
i`m building a game using allegro library but i get the following error message .. do u know what might be the problem ?
It has nothing to do with Allegro. You are #including cpp files. Stop it.
You know how to create a header file? Do that, then #include the header file.
It has nothing to do with Allegro. You are #including cpp files. Stop it.
You know how to create a header file? Do that, then #include the header file.
Thx .. this was the problem .. my game works now
Arf :p My eyes were aimed by the bolded text who said "first defined here" :p
I did copy paste the code but without noticing the multiple definition ;-)
Anyway his problem is now solved.
But ... Hey ! Wait ! Adix88 , You are a cookie scrooge, aren't you ? !
_