Od razu na wstępie zaznaczę, że kompletnie nie znam się na c++ (zajmuję się raczej web programmingiem). Mój problem jest taki:
Otrzymałem gotowy, napisany przez kogoś program (skompilowana, działająca binarka + kod źródłowy). Żadnych informacji poza tym (tzn jaki kompilator był użyty, jakie biblioteki etc. Po wielu bojach z gcc udało mi się w końcu skompilować własnoręcznie program pod win xp, jednak nie działa tak, jak powienien. Ale nie o to mi chodzi. Potrzebuję skompilować ten program pod linuksa (dokładniej debiana). Z tego, co ktoś mi powiedział program wykorzystuje biblioteki, które powinny dać się skompilować na każdym systemie.
Przy próbie kompilacji w linuksie otrzymuję ponizsze błędy (gcc 4.3):
- Kod: Zaznacz cały
debian:~/Desktop/azerus# gcc -Wall MemDescriptor.cpp Rand.cpp Core.cpp main.cpp
Core.cpp: In function ‘long unsigned int Core_GetBetween(double)’:
Core.cpp:19: warning: converting to ‘long unsigned int’ from ‘double’
Core.cpp: In function ‘void Core_Fire_Def(Stat*, MemDesriptor*, long unsigned in t, long unsigned int)’:
Core.cpp:528: warning: left shift count >= width of type
Core.cpp:602: warning: left shift count >= width of type
Core.cpp: In function ‘void Core_Fire_Agr(Stat*, MemDesriptor*, long unsigned in t, long unsigned int)’:
Core.cpp:882: warning: left shift count >= width of type
Core.cpp:956: warning: left shift count >= width of type
Core.cpp: In function ‘void Core_Shoots(Stat*, MemDesriptor*)’:
Core.cpp:1017: warning: unused variable ‘k’
Core.cpp: In function ‘void Core_Destroy(Stat*, MemDesriptor*)’:
Core.cpp:1042: warning: unused variable ‘_A’
Core.cpp: In function ‘void Core_Grup(Stat*, MemDesriptor*)’:
Core.cpp:1144: warning: unused variable ‘sek’
Core.cpp: In function ‘int Core_Kill_SD(Stat*, MemDesriptor*, Finder*, long unsi gned int)’:
Core.cpp:1442: warning: unused variable ‘i’
Core.cpp:1442: warning: unused variable ‘j’
Core.cpp:1467: warning: unused variable ‘i’
Core.cpp:1467: warning: unused variable ‘j’
Core.cpp:1366: warning: unused variable ‘_A’
Core.cpp: In function ‘void Core_SD(Stat*, MemDesriptor*)’:
Core.cpp:1499: warning: unused variable ‘k’
Core.cpp:1499: warning: unused variable ‘l’
Core.cpp: In function ‘long unsigned int CalcBattel(Stat*, MemDesriptor*, Battel *)’:
Core.cpp:1581: warning: unused variable ‘timing’
main.cpp: In function ‘void killthread(MemDesriptor*, long unsigned int)’:
main.cpp:30: warning: format ‘%i’ expects type ‘int’, but argument 2 has type ‘l ong unsigned int’
main.cpp:30: warning: format ‘%i’ expects type ‘int’, but argument 3 has type ‘l ong unsigned int’
main.cpp:31: warning: format ‘%i’ expects type ‘int’, but argument 3 has type ‘l ong unsigned int’
main.cpp:38: warning: comparison between signed and unsigned integer expressions
main.cpp: In function ‘void ConnectionHandler(void*)’:
main.cpp:167: error: ‘isdigit’ was not declared in this scope
main.cpp:183: error: ‘isdigit’ was not declared in this scope
main.cpp:199: error: ‘isdigit’ was not declared in this scope
main.cpp:208: error: ‘isdigit’ was not declared in this scope
main.cpp:224: error: ‘isdigit’ was not declared in this scope
main.cpp:232: error: ‘isdigit’ was not declared in this scope
main.cpp:240: error: ‘isdigit’ was not declared in this scope
main.cpp:245: error: ‘isdigit’ was not declared in this scope
main.cpp:264: error: ‘isdigit’ was not declared in this scope
main.cpp:282: error: ‘isdigit’ was not declared in this scope
main.cpp:293: error: ‘isdigit’ was not declared in this scope
main.cpp:311: error: ‘isdigit’ was not declared in this scope
main.cpp:334: error: ‘isdigit’ was not declared in this scope
main.cpp:342: error: ‘isdigit’ was not declared in this scope
main.cpp:348: error: ‘isdigit’ was not declared in this scope
main.cpp:367: error: ‘isdigit’ was not declared in this scope
main.cpp:375: error: ‘isdigit’ was not declared in this scope
main.cpp:381: error: ‘isdigit’ was not declared in this scope
main.cpp:400: error: ‘isdigit’ was not declared in this scope
main.cpp:408: error: ‘isdigit’ was not declared in this scope
main.cpp:414: error: ‘isdigit’ was not declared in this scope
main.cpp:433: error: ‘isdigit’ was not declared in this scope
main.cpp:441: error: ‘isdigit’ was not declared in this scope
main.cpp:447: error: ‘isdigit’ was not declared in this scope
main.cpp:466: error: ‘isdigit’ was not declared in this scope
main.cpp:474: error: ‘isdigit’ was not declared in this scope
main.cpp:480: error: ‘isdigit’ was not declared in this scope
main.cpp:506: error: ‘isdigit’ was not declared in this scope
main.cpp:524: error: ‘isdigit’ was not declared in this scope
main.cpp:535: error: ‘isdigit’ was not declared in this scope
main.cpp:553: error: ‘isdigit’ was not declared in this scope
main.cpp:576: error: ‘isdigit’ was not declared in this scope
main.cpp:584: error: ‘isdigit’ was not declared in this scope
main.cpp:590: error: ‘isdigit’ was not declared in this scope
main.cpp:609: error: ‘isdigit’ was not declared in this scope
main.cpp:617: error: ‘isdigit’ was not declared in this scope
main.cpp:623: error: ‘isdigit’ was not declared in this scope
main.cpp:642: error: ‘isdigit’ was not declared in this scope
main.cpp:650: error: ‘isdigit’ was not declared in this scope
main.cpp:656: error: ‘isdigit’ was not declared in this scope
main.cpp:675: error: ‘isdigit’ was not declared in this scope
main.cpp:683: error: ‘isdigit’ was not declared in this scope
main.cpp:689: error: ‘isdigit’ was not declared in this scope
main.cpp:708: error: ‘isdigit’ was not declared in this scope
main.cpp:716: error: ‘isdigit’ was not declared in this scope
main.cpp:722: error: ‘isdigit’ was not declared in this scope
main.cpp:855: warning: format ‘%i’ expects type ‘int’, but argument 3 has type ‘ long unsigned int’
main.cpp:860: warning: format ‘%i’ expects type ‘int’, but argument 4 has type ‘ long unsigned int’
main.cpp:860: warning: format ‘%i’ expects type ‘int’, but argument 5 has type ‘ long unsigned int’
main.cpp:864: warning: format ‘%i’ expects type ‘int’, but argument 4 has type ‘ long unsigned int’
main.cpp:864: warning: format ‘%i’ expects type ‘int’, but argument 5 has type ‘ long unsigned int’
main.cpp:868: warning: format ‘%i’ expects type ‘int’, but argument 4 has type ‘ long unsigned int’
main.cpp:871: warning: format ‘%i’ expects type ‘int’, but argument 4 has type ‘ long unsigned int’
main.cpp:871: warning: format ‘%i’ expects type ‘int’, but argument 5 has type ‘ long unsigned int’
main.cpp:875: warning: format ‘%i’ expects type ‘int’, but argument 4 has type ‘ long unsigned int’
main.cpp:875: warning: format ‘%i’ expects type ‘int’, but argument 5 has type ‘ long unsigned int’
main.cpp:892: warning: format ‘%i’ expects type ‘int’, but argument 4 has type ‘ long unsigned int’
main.cpp: In function ‘int main(int, char**)’:
main.cpp:1119: error: invalid conversion from ‘void (*)(void*)’ to ‘void* (*)(vo id*)’
main.cpp:1119: error: initializing argument 3 of ‘int pthread_create(pthread_t *, const pthread_attr_t*, void* (*)(void*), void*)’
main.cpp:983: warning: unused variable ‘j’
main.cpp:983: warning: unused variable ‘k’
main.cpp:983: warning: unused variable ‘l’
debian:~/Desktop/azerus#
Program oczywiście się nie kompiluje :/
W załączniku dam źródła tego programu. Mam nadzieje, ze znajdzie się na tym forum ktoś, kto wyciągnie pomocną dłoń do mnie


