[Gems-users] Problem in static linking to ruby


Date: Thu, 24 Jun 2010 03:38:44 -0500
From: "Anup Holey" <holey003@xxxxxxx>
Subject: [Gems-users] Problem in static linking to ruby
Hi,
 
I am trying to statically link a separate binary to ruby which is another simulator. I have changed the Makefile in gems-2.1/ruby/ for that purpose.
Call to this simulator happens from ruby/simics/commands.C file. I have included necessary header file in commands.C.
 
But it gives me error during compilation saying 'undefined reference to function_name'. I must be making some mistake.
I am not sure about compilation flow of ruby and how it exactly generated ruby.so. I want my library to be present in ruby.so.
 
This is the change I made in ruby/Makefile.
 
 $(BIN_DIR)/tester.exec: simics_api_dummy.c $(RUBY_OBJ) $(BIN_DIR)/created $(GENERATED_DIR)/generated
             @echo ""
             @echo "Linking tester binary ..."
             $(CC) -o $@ $(LDFLAGS) simics/simics_api_dummy.c -L$(LIBRARY_PATH) -lname \
                     $(RUBY_OBJ)
             @echo "Made tester"
Actual binary name is libname.a. No changes otherwise. Original ruby compilation works fine.
 
I get the error on this command during make. What must be going wrong?
Is this the right place for linking my library?
 
Thanks and regards,
Anup
 
[← Prev in Thread] Current Thread [Next in Thread→]