Re: Call Java functions in a C DLL - Unix
This is a discussion on Re: Call Java functions in a C DLL - Unix ; Ahmad Jalil Qarshi writes:
> I think that there is some problem with my makefile.
> LD = cc
> # create our librarys
> Interface.a: Interface.o
> $(LD) $(DYNLINKFLAGS) $(JAVALIBS) $(LIBS) $(LIB_OBJS) -o $@
> Now the problem is ...
-
Re: Call Java functions in a C DLL
Ahmad Jalil Qarshi writes:
> I think that there is some problem with my makefile.
> LD = cc
> # create our librarys
> Interface.a: Interface.o
> $(LD) $(DYNLINKFLAGS) $(JAVALIBS) $(LIBS) $(LIB_OBJS) -o $@
> Now the problem is that library is not properly created because the
> size of the Interface.a file is very small only 552 bytes. whereas the
> size of Interface.o file is 34428. Which clearly indicates that the
> problem is with the Interface.a file i.e during linking.
>
> Can any body help me to figure out the problem.
Traditionally .a libraries are just archives created using the ar
command. I know nothing of AIX, but I would be surprised if cc were
the command to make a library from a module.
Incidentally, do you need a library at all? With only one module the
advantages of using a library are minor.
--
Ben.
-
Re: Call Java functions in a C DLL
Ben Bacarisse wrote:
> Ahmad Jalil Qarshi writes:
>
>
>> I think that there is some problem with my makefile.
>
>> LD = cc
>
>> # create our librarys
>> Interface.a: Interface.o
>> $(LD) $(DYNLINKFLAGS) $(JAVALIBS) $(LIBS) $(LIB_OBJS) -o $@
>
>> Now the problem is that library is not properly created because the
>> size of the Interface.a file is very small only 552 bytes. whereas the
>> size of Interface.o file is 34428. Which clearly indicates that the
>> problem is with the Interface.a file i.e during linking.
>>
>> Can any body help me to figure out the problem.
>
> Traditionally .a libraries are just archives created using the ar
> command. I know nothing of AIX, but I would be surprised if cc were
> the command to make a library from a module.
>
It may well be, the compiler driver normally knows how to invoke the
linker with the required libraries. At least with Solaris, one has to
use CC to link C++ objects.
One thing that does look odd is the symbol $(DYNLINKFLAGS) being used to
build a static library.
--
Ian Collins
-
Re: Call Java functions in a C DLL
Ben Bacarisse wrote:
> Traditionally .a libraries are just archives created using the ar
> command. I know nothing of AIX, but I would be surprised if cc were
> the command to make a library from a module.
Actually, on AIX shared libraries *are* stored in .a files, crazy as it
seems. It's basically an archive containing a shared object IIRC.
AS
-
Re: Call Java functions in a C DLL
Ian Collins writes:
> Ben Bacarisse wrote:
>> Ahmad Jalil Qarshi writes:
>>
>>
>>> I think that there is some problem with my makefile.
>>
>>> LD = cc
>>
>>> # create our librarys
>>> Interface.a: Interface.o
>>> $(LD) $(DYNLINKFLAGS) $(JAVALIBS) $(LIBS) $(LIB_OBJS) -o $@
>>
>>> Now the problem is that library is not properly created because the
>>> size of the Interface.a file is very small only 552 bytes. whereas the
>>> size of Interface.o file is 34428. Which clearly indicates that the
>>> problem is with the Interface.a file i.e during linking.
>>>
>>> Can any body help me to figure out the problem.
>>
>> Traditionally .a libraries are just archives created using the ar
>> command. I know nothing of AIX, but I would be surprised if cc were
>> the command to make a library from a module.
>>
> It may well be, the compiler driver normally knows how to invoke the
> linker with the required libraries. At least with Solaris, one has to
> use CC to link C++ objects.
Have I missed something? I am talking about the rule to *build* a .a
from a set of .o files. Obviously cc could be a driver that knows how
to do that, but I have not yet seem such a system. The $(LD) command
I quoted does not need to link anything (on the system I am familiar
with).
--
Ben.
-
Re: Call Java functions in a C DLL
Arch Stanton writes:
> Ben Bacarisse wrote:
>> Traditionally .a libraries are just archives created using the ar
>> command. I know nothing of AIX, but I would be surprised if cc were
>> the command to make a library from a module.
>
> Actually, on AIX shared libraries *are* stored in .a files, crazy as
> it seems. It's basically an archive containing a shared object IIRC.
OK, but are they built with cc? Is some form of archive not needed?
--
Ben.
-
Re: Call Java functions in a C DLL
Ben Bacarisse writes:
> Ian Collins writes:
>
>> Ben Bacarisse wrote:
>>> Ahmad Jalil Qarshi writes:
>>>
>>>
>>>> I think that there is some problem with my makefile.
>>>
>>>> LD = cc
>>>
>>>> # create our librarys
>>>> Interface.a: Interface.o
>>>> $(LD) $(DYNLINKFLAGS) $(JAVALIBS) $(LIBS) $(LIB_OBJS) -o $@
>>>
>>>> Now the problem is that library is not properly created because the
>>>> size of the Interface.a file is very small only 552 bytes. whereas the
>>>> size of Interface.o file is 34428. Which clearly indicates that the
>>>> problem is with the Interface.a file i.e during linking.
>>>>
>>>> Can any body help me to figure out the problem.
>>>
>>> Traditionally .a libraries are just archives created using the ar
>>> command. I know nothing of AIX, but I would be surprised if cc were
>>> the command to make a library from a module.
>>>
>> It may well be, the compiler driver normally knows how to invoke the
>> linker with the required libraries. At least with Solaris, one has to
>> use CC to link C++ objects.
>
> Have I missed something? I am talking about the rule to *build* a .a
> from a set of .o files. Obviously cc could be a driver that knows how
> to do that, but I have not yet seem such a system. The $(LD) command
> I quoted does not need to link anything (on the system I am familiar
> with).
Well, it seems I am missing the fact that the OP is making a dynamic
library so maybe the compiler driver (cc) does know how to tell the
linker to do it.
To the OP: listen to everyone else!
--
Ben.
-
Re: Call Java functions in a C DLL
Ben Bacarisse wrote:
>
> Well, it seems I am missing the fact that the OP is making a dynamic
> library so maybe the compiler driver (cc) does know how to tell the
> linker to do it.
>
> To the OP: listen to everyone else!
>
Very gracious Ben!
--
Ian Collins