List Info

Thread: "ocaml_beginners"::[] Passing parameters to gcc




"ocaml_beginners"::[] Passing parameters to gcc
country flaguser name
United States
2007-04-17 05:49:27

Hello

I have a problem compiling my hybrid OCaml C program.

All works well when i have all the libs in the same directory of the output
file. i have the next files to compile

convert.c
macros.ml
testC.c
testML.ml

all the above i compile with the -c flag and they are all libraries.

and then i have a demo file named

demo.ml

to finnely link all the files together i use

ocamlopt -pp camlp4o str.cmxa -cclib '-lpcsclite convert.o testC.o'
macros.cmx demo.ml -o demo

(note that i pass as parameter the file macros.cmx and not testML.cmx and it
works. Both files are open inside the demo.ml . I dont know why i have to do
this in one file and not in the other, an explanation would be nice ...
The line i have above gives me a valid working result)

the problem is when i move all the libraries i have to another directory,
witch is /usr/local/lib/ocamlstuff

i then try this

ocamlopt -pp camlp4o -I /usr/local/lib/ocamlstuff str.cmxa -cclib
'-lpcsclite convert.o testC.o' macros.cmx demo.ml -o demo

It works for all OCaml libs, but it wont work for the C libs....

I tried a lot of variations like for instance

ocamlopt -I /usr/local/lib/ocamlstuff -pp camlp4o str.cmxa -cclib '-B
/usr/local/lib/ocamlstuff convert.o testC.o -lpcsclite' macros.cmx
demo.ml-o demo

But still does not work, i get the following output

gcc: convert.o: No such file or directory
gcc: testC.o: No such file or directory

This is a gcc problem, so i'm not passing well the parameters to the C
compiler... is there anny aditional flag i should use?

Thank you
Manuel

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )