From: Ben Giddings Date: 2003-07-25T06:23:47+09:00 Subject: SWIG and "connect"? [Was: SWIG and char * parameters] D'OH! Now that Brett has pointed out why my oversimplified example was failing I've gone back and found out the problem was more subtle than I thought: When I name a function "connect" it behaves differently than if I name it "connectTo". As far as I'm aware, connect isn't a reserved word in either language, and no warnings are generated when I compile this. Incidentally, I'm doing this to try to make Ruby an RPC client. Is there a better way of doing this, other than SWIG? The only RPC<->Ruby connections I've found are for XML-RPC. int connectTo(char *host) { printf("Connecting to %s\n", host); global_client_ptr = clnt_create (host, MAXWELLPROG, V1, "udp"); if (global_client_ptr == NULL) { clnt_pcreateerror (host); return 0; } return 1; } int connect(char *host) { printf("Connecting to %s\n", host); global_client_ptr = clnt_create (host, MAXWELLPROG, V1, "udp"); if (global_client_ptr == NULL) { clnt_pcreateerror (host); return 0; } return 1; } #### irb(main):001:0> require 'rpc' => true irb(main):002:0> Rpc.sayHello Hello World => nil irb(main):003:0> Rpc.connect("localhost") => -1 irb(main):004:0> Rpc.connectTo("localhost") Connecting to localhost => 1 irb(main):005:0> Rpc.disconnect => nil irb(main):006:0> Rpc.connectTo("localhost") Connecting to localhost => 1 irb(main):007:0> Rpc.connect("localhost") => -1 irb(main):008:0> Rpc.disconnect => nil Thanks again, Ben