Problem ze skompilowaniem programu c++ (początkujący)


(Smutasek2) #1

Witam.

Mam pewien kod źródłowy pewnego programu i chciałbym go skompilować, próbowałem za pomocą dev++ lecz nie jestem w stanie bo niby są jakieś błędy w kodzie...

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:26:24: caml/alloc.h: No such file or directory

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:27:23: caml/fail.h: No such file or directory

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:28:25: caml/memory.h: No such file or directory

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:29:27: caml/bigarray.h: No such file or directory

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:34: error: syntax error before "value"

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:34: error: syntax error before "src_arr"

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c: In function `string_of_binary_array':

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:36: error: `src_arr' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:36: error: (Each undeclared identifier is reported only once

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:36: error: for each function it appears in.)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:36: error: `src_idx' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:36: error: `src_len' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:37: error: `retval' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:40: warning: passing arg 1 of `memmove' makes pointer from integer without a cast


x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c: At top level:

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:46: error: syntax error before "value"

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:46: error: syntax error before "src_arr"

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c: In function `string_from_binary_array':

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:48: error: `src_arr' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:48: error: `buffer' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:48: error: `src_idx' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:48: error: `src_len' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:48: error: `dst_idx' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:49: warning: initialization makes pointer from integer without a cast

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:51: error: `Val_unit' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c: At top level:

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:57: error: syntax error before "value"

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:57: error: syntax error before "src_arr"

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c: In function `cstring_of_binary_array':

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:59: error: `src_arr' undeclared (first use in this function)


x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:59: error: `src_idx' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:59: error: `src_len' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:60: error: `retval' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c: At top level:

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:71: error: syntax error before "value"

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:71: error: syntax error before "src_arr"

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c: In function `unsafe_cstring_of_binary_array':

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:73: error: `src_arr' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:73: error: `src_idx' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c: At top level:

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:78: error: syntax error before "value"

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:78: error: syntax error before "dst_arr"

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c: In function `string_to_binary_array':

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:80: error: `dst_arr' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:80: error: `dst_idx' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:80: error: `src_str' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:82: error: invalid type argument of `->'

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:83: warning: passing arg 2 of `memcpy' makes pointer from integer without a cast

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:84: error: `Val_unit' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c: At top level:

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:90: error: syntax error before "value"

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:90: error: syntax error before "dst_arr"

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c: In function `cstring_to_binary_array':

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:92: error: `dst_arr' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:92: error: `dst_idx' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:92: error: `dst_len' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:92: error: `src_str' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:94: error: invalid type argument of `->'

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:95: warning: passing arg 2 of `memcpy' makes pointer from integer without a cast

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:97: error: `Val_unit' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c: At top level:

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:104: error: syntax error before "uint32"

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:104: warning: no semicolon at end of struct or union

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:105: warning: data definition has no type or storage class


x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:107: error: syntax error before '}' token

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:107: warning: data definition has no type or storage class

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:109: error: syntax error before "void"

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:109: error: syntax error before '*' token

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:110: error: syntax error before "void"

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:110: error: syntax error before '*' token

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:111: error: syntax error before "void"

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:111: error: syntax error before "MD5Context"

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:113: error: syntax error before "value"

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:113: error: syntax error before "v_iarr"

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c: In function `digest_array':

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:115: error: `v_iarr' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:116: error: `result' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:117: error: syntax error before "context"

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:118: error: invalid type argument of `->'

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:119: warning: initialization makes pointer from integer without a cast

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:121: error: `context' undeclared (first use in this function)

x:\Users\xXx\Desktop\rldev-1.40\src\common\binarray-c.c:130: error: invalid lvalue in unary `&'


Wykonanie zakończone

anyway, wiem, że teraz zabrzmi to głupio ale ja nie mam bladego pojęcia o programowaniu w tym języku ani jak należy kompilować taki program. Do tej pory używałem jedynie Autohotkey'a + vTaskStudio i tam sprawa była jasna bo wszystko zawsze było w jednym pliku, a tutaj jest dodatkowo z setka innych które nic mi nie mówią.

Wracając do tematu zadam pytanie proste: jakie takie coś się kompiluje - od razu mówię, w sieci jest już skompilowany ten program ale bez tego patcha bez którego nic nie zrobię.

Z góry przepraszam i dziękuję za wszelką wyrozumiałość i pomoc.


(Pkubaj) #2

Masz opisane w pliku INSTALL:

cd src

./configure

omake

sudo omake install


(Razi) #3

Kompilowanie takich projektów pod Windowsem to męka, jeśli projekt nie jest dostarczony jako projekt w konkretnym środowisku i się tego środowiska nie posiada, w tym wypadku potrzebny jest Bash, omake, kompilatory C i C++ i kilka bibliotek.

Widzę tam skrypt konfiguracyjny i instalacyjny pod Linuksa.

Co do kompilacji tego czegoś pod windowsem, w pliku INSTALL jest notka:

Windows users, please note: the only build environment supported is Cygwin with

the Cygwin port of OCaml (this also happens to be the development platform).

MinGW + MSYS may or may not work; MSVC is not supported. If you really insist

on using native Windows programs, you are advised to stick to the binary

distribution.

Czyli tylko kompilator Cygwin, MinGW (m.in. Dev-C++) może nie działać, VC nie działa. Zaleca się pobrać binarną dystrybucję, zamiast bawić się z kompilacją źródeł.