Click here to Skip to main content
15,888,803 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: ATL Sink in .NET process Pin
Vikram123429-Feb-12 16:22
Vikram123429-Feb-12 16:22 
GeneralRe: ATL Sink in .NET process Pin
Vikram12341-Mar-12 7:56
Vikram12341-Mar-12 7:56 
GeneralRe: ATL Sink in .NET process Pin
barneyman1-Mar-12 17:36
barneyman1-Mar-12 17:36 
AnswerRe: ATL Sink in .NET process Pin
ThatsAlok21-Jun-12 23:10
ThatsAlok21-Jun-12 23:10 
QuestionGet Notification of Wrong Password Attempt Pin
Member 857955627-Feb-12 3:42
Member 857955627-Feb-12 3:42 
AnswerRe: Get Notification of Wrong Password Attempt Pin
Richard MacCutchan27-Feb-12 4:19
mveRichard MacCutchan27-Feb-12 4:19 
AnswerRe: Get Notification of Wrong Password Attempt Pin
peterchen24-Mar-12 6:32
peterchen24-Mar-12 6:32 
QuestionEntry point name correction in compiled DLL, Swig/GCC/CC/LD and exports Pin
XenobiusII24-Feb-12 19:09
XenobiusII24-Feb-12 19:09 
So here is my problem, I have a c library that I am compiling under CygWin.

I am using Swig to generate a c# wrapper class to it. So I follow the steps to do this. And everything compiles, etc... however..

the defined export names of the functions and constants etc have entry points named in the following fashion:

"swe_sol_eclipse_when_glob"

when I do a 'dumpbin -exports' on the dll the entry points are being named in the fashion of:

"swe_sol_eclipse_when_glob@28"

Is there a way to get rid of the '@xxx' from the names during compilation ?

The makefile is like this:

CFLAGS = -fpic -D MAKE_DLL -g -O9 -Wall  	# for Linux and other gcc systems<br />
OP=$(CFLAGS)  <br />
CC=cc	#for Linux<br />
<br />
# compilation rule for general cases<br />
.o :<br />
	$(CC) $(OP) -o $@ $? -lm<br />
.c.o:<br />
	$(CC) -c $(OP) $<     <br />
<br />
SWEOBJ = swedate.o swehouse.o swejpl.o swemmoon.o swemplan.o swepcalc.o sweph.o\<br />
	swepdate.o swephlib.o swecl.o swehel.o Sweph_wrap.o<br />
<br />
swetest: swetest.o libswe.a<br />
	$(CC) $(OP) -o swetest swetest.o -L. -lswe -lm<br />
<br />
swemini: swemini.o libswe.a<br />
	$(CC) $(OP) -o swemini swemini.o -L. -lswe -lm<br />
<br />
# create an archive and a dynamic link libary fro SwissEph<br />
# a user of this library will inlcude swephexp.h  and link with -lswe<br />
<br />
libswe.a: $(SWEOBJ)<br />
	ar r libswe.a	$(SWEOBJ)<br />
<br />
libswe.so: $(SWEOBJ)<br />
	$(CC) -shared -o libswe.so $(SWEOBJ)<br />
<br />
clean-swig:<br />
	rm -f ../../testsweph/*.cs<br />
	rm -f ../../testsweph/*.dl<br />
	rm -f *_wrap.c<br />
	<br />
swig: clean<br />
	swig -csharp -namespace swiss -module libswe -outdir ../../testsweph  -dllimport libswe.dll  Sweph.i <br />
<br />
dll: swig $(SWEOBJ)		<br />
	$(CC) $(OP) -shared -o libswe.dll $(SWEOBJ)<br />
	cp *.dll ../../testsweph<br />
        <br />
<br />
clean: clean-swig<br />
	rm -f *.o swetest libswe*	<br />
<br />
###<br />
swecl.o: swejpl.h sweodef.h swephexp.h swedll.h sweph.h swephlib.h<br />
sweclips.o: sweodef.h swephexp.h swedll.h<br />
swedate.o: swephexp.h sweodef.h swedll.h<br />
swehel.o: swephexp.h sweodef.h swedll.h<br />
swehouse.o: swephexp.h sweodef.h swedll.h swephlib.h swehouse.h<br />
swejpl.o: swephexp.h sweodef.h swedll.h sweph.h swejpl.h<br />
swemini.o: swephexp.h sweodef.h swedll.h<br />
swemmoon.o: swephexp.h sweodef.h swedll.h sweph.h swephlib.h<br />
swemplan.o: swephexp.h sweodef.h swedll.h sweph.h swephlib.h swemptab.c<br />
swepcalc.o: swepcalc.h swephexp.h sweodef.h swedll.h<br />
sweph.o: swejpl.h sweodef.h swephexp.h swedll.h sweph.h swephlib.h<br />
swephlib.o: swephexp.h sweodef.h swedll.h sweph.h swephlib.h<br />
swetest.o: swephexp.h sweodef.h swedll.h<br />
Sweph_wrap.o: Sweph_wrap.c


An example of an export is this:

C++
 #define EXP32  __declspec( dllexport )
.
.
ext_def(int32) swe_heliacal_ut(double tjdstart_ut, double *geopos, double *datm, double *dobs, char *ObjectName, int32 TypeEvent, int32 iflag, double *dret, char *serr);


C#
An example of the generated c# wrapper:

<pre lang="cs">[DllImport("libswe.dll", EntryPoint="CSharp_swe_heliacal_ut")]
  public static extern IntPtr swe_heliacal_ut(double jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4, string jarg5, HandleRef jarg6, HandleRef jarg7, HandleRef jarg8, string jarg9);


Swig Generated C Wrapper compiled in...


C++
<pre>SWIGEXPORT void * SWIGSTDCALL CSharp_swe_heliacal_ut(double jarg1, void * jarg2, void * jarg3, void * jarg4, char * jarg5, void * jarg6, void * jarg7, void * jarg8, char * jarg9) {
  void * jresult ;
  double arg1 ;
  double *arg2 = (double *) 0 ;
  double *arg3 = (double *) 0 ;
  double *arg4 = (double *) 0 ;
  char *arg5 = (char *) 0 ;
  int32 arg6 ;
  int32 arg7 ;
  double *arg8 = (double *) 0 ;
  char *arg9 = (char *) 0 ;
  int32 *argp6 ;
  int32 *argp7 ;
  int32 result;
  
  arg1 = (double)jarg1; 
  arg2 = (double *)jarg2; 
  arg3 = (double *)jarg3; 
  arg4 = (double *)jarg4; 
  arg5 = (char *)jarg5; 
  argp6 = (int32 *)jarg6; 
  if (!argp6) {
    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null int32", 0);
    return 0;
  }
  arg6 = *argp6; 
  argp7 = (int32 *)jarg7; 
  if (!argp7) {
    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null int32", 0);
    return 0;
  }
  arg7 = *argp7; 
  arg8 = (double *)jarg8; 
  arg9 = (char *)jarg9; 
  result = swe_heliacal_ut(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
  {
    int32 * resultptr = (int32 *) malloc(sizeof(int32));
    memmove(resultptr, &result, sizeof(int32));
    jresult = resultptr;
  }
  return jresult;
}


AnswerRe: Entry point name correction in compiled DLL, Swig/GCC/CC/LD and exports Pin
Richard MacCutchan24-Feb-12 23:43
mveRichard MacCutchan24-Feb-12 23:43 
Questionprojects with C++ Pin
niara 24-Feb-12 13:09
niara 24-Feb-12 13:09 
AnswerRe: projects with C++ Pin
Richard MacCutchan24-Feb-12 23:37
mveRichard MacCutchan24-Feb-12 23:37 
QuestionOnChar not called Pin
Member 199473021-Feb-12 2:20
Member 199473021-Feb-12 2:20 
AnswerRe: OnChar not called Pin
Jonathan Davies22-Feb-12 1:36
Jonathan Davies22-Feb-12 1:36 
GeneralRe: OnChar not called Pin
Richard MacCutchan22-Feb-12 3:06
mveRichard MacCutchan22-Feb-12 3:06 
GeneralRe: OnChar not called Pin
Jonathan Davies22-Feb-12 7:30
Jonathan Davies22-Feb-12 7:30 
Questionreading a .txt file added as resource file in VS 2008 Pin
Member 771617419-Feb-12 22:31
Member 771617419-Feb-12 22:31 
AnswerRe: reading a .txt file added as resource file in VS 2008 Pin
«_Superman_»20-Feb-12 18:29
professional«_Superman_»20-Feb-12 18:29 
Questionhow to return a reference to subvector of std::vector Pin
EQ Learner9-Feb-12 5:53
EQ Learner9-Feb-12 5:53 
AnswerRe: how to return a reference to subvector of std::vector Pin
Albert Holguin10-Feb-12 20:42
professionalAlbert Holguin10-Feb-12 20:42 
GeneralRe: how to return a reference to subvector of std::vector Pin
EQ Learner11-Feb-12 10:32
EQ Learner11-Feb-12 10:32 
GeneralRe: how to return a reference to subvector of std::vector Pin
Albert Holguin11-Feb-12 12:31
professionalAlbert Holguin11-Feb-12 12:31 
Questiondirectshow samplegraber Pin
venkatesh528677-Feb-12 20:44
venkatesh528677-Feb-12 20:44 
AnswerRe: directshow samplegraber Pin
Richard MacCutchan7-Feb-12 22:30
mveRichard MacCutchan7-Feb-12 22:30 
QuestionDifference between CHOICE and TIMEOUT dos commands Pin
vanikanc6-Feb-12 5:00
vanikanc6-Feb-12 5:00 
AnswerRe: Difference between CHOICE and TIMEOUT dos commands Pin
Richard MacCutchan6-Feb-12 5:36
mveRichard MacCutchan6-Feb-12 5:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.