generate DLL using cygwin or MinGW

I am making "dll" using JNI as suggested in SWIG.
I am getting weird error when I try to generate dll using Cygwin.

cygwin way
C:\Cplusplus\swigwin-2.0.11>gcc -shared example.o  example_wrap.o -mno -cygwin -
Wl,--add-stdcall-alias  -o example.dll
gcc: error: unrecognized command line option '-mno'
gcc: error: unrecognized command line option '-cygwin'

Open in new window



MinGW way
C:\Cplusplus\swigwin-2.0.11>gcc -shared example_wrap.o -L/local/lib/ -ltcl84 -o
example.dll
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot fin
d -ltcl84
collect2.exe: error: ld returned 1 exit status

Open in new window

jgdvishnuSoftware ArchitectAsked:
Who is Participating?
 
jkrConnect With a Mentor Commented:
'gcc' needs to link with the TCL library as well as it seems. If you have that one, add '-l<tcl_lib_name>' to the command line.

As for Cygwin, '-Wl,' seems a bit odd, try removing the comma and make it '-Wl' (or add the respective argument if there is one)
1
 
jkrCommented:
Well, I don't know about '-mno', but '-cygwin' seems to be more than redundant as a compiler option - try building the module omitting the two of them.

As fas as for teh 2nd snippet, are you sure that there is a 'libtcl84*' in your library search path? Try

find /usr/lib -name "libtcl84*" -print

Open in new window

to find out about that.
0
 
jgdvishnuSoftware ArchitectAuthor Commented:
Thanks I am getting a strange error now...


C:\Cplusplus\swigwin-2.0.11>gcc -shared example.o  example_wrap.o -Wl,--add-stdcall-alias  -o example.dll
example_wrap.o:example_wrap.c:(.text+0x91b): undefined reference to `_imp__Tcl_ResetResult'
example_wrap.o:example_wrap.c:(.text+0x92f): undefined reference to `_imp__Tcl_SetObjResult'
example_wrap.o:example_wrap.c:(.text+0x953): undefined reference to `_imp__Tcl_SetErrorCode'
example_wrap.o:example_wrap.c:(.text+0x968): undefined reference to `_imp__Tcl_ResetResult'
example_wrap.o:example_wrap.c:(.text+0x98c): undefined reference to `_imp__Tcl_SetErrorCode'
example_wrap.o:example_wrap.c:(.text+0x9b7): undefined reference to `_imp__Tcl_AppendResult'
example_wrap.o:example_wrap.c:(.text+0x9d4): undefined reference to `_imp__Tcl_NewStringObj'
example_wrap.o:example_wrap.c:(.text+0x9fc): undefined reference to `_imp__Tcl_ObjSetVar2'
example_wrap.o:example_wrap.c:(.text+0xa88): undefined reference to `_imp__Tcl_InitHashTable'
example_wrap.o:example_wrap.c:(.text+0xb32): undefined reference to `_imp__Tcl_DeleteHashEntry'
example_wrap.o:example_wrap.c:(.text+0xbb1): undefined reference to `_imp__Tcl_VarEval'
example_wrap.o:example_wrap.c:(.text+0xbc2): undefined reference to `_imp__Tcl_GetObjResult'
example_wrap.o:example_wrap.c:(.text+0xbda): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0xbee): undefined reference to `_imp__Tcl_ResetResult'
example_wrap.o:example_wrap.c:(.text+0xc1c): undefined reference to `_imp__Tcl_VarEval'
example_wrap.o:example_wrap.c:(.text+0xc2f): undefined reference to `_imp__Tcl_ResetResult'
example_wrap.o:example_wrap.c:(.text+0xc46): undefined reference to `_imp__Tcl_ResetResult'
example_wrap.o:example_wrap.c:(.text+0xc5d): undefined reference to `_imp__Tcl_GetObjResult'
example_wrap.o:example_wrap.c:(.text+0xc6f): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0xd5d): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0xdf3): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0xef9): undefined reference to `_imp__Tcl_NewStringObj'
example_wrap.o:example_wrap.c:(.text+0xf8f): undefined reference to `_imp__Tcl_NewStringObj'
example_wrap.o:example_wrap.c:(.text+0xfc2): undefined reference to `_imp__Tcl_GetVar'
example_wrap.o:example_wrap.c:(.text+0x1040): undefined reference to `_imp__Tcl_SetVar'
example_wrap.o:example_wrap.c:(.text+0x10bc): undefined reference to `_imp__TclFreeObj'
example_wrap.o:example_wrap.c:(.text+0x110f): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x1133): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x11e0): undefined reference to `_imp__Tcl_DeleteCommandFromToken'
example_wrap.o:example_wrap.c:(.text+0x13f8): undefined reference to `_imp__TclFreeObj'
example_wrap.o:example_wrap.c:(.text+0x143e): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x1462): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x151c): undefined reference to `_imp__TclFreeObj'
example_wrap.o:example_wrap.c:(.text+0x1561): undefined reference to `_imp__Tcl_DuplicateObj'
example_wrap.o:example_wrap.c:(.text+0x1572): undefined reference to `_imp__Tcl_SetObjResult'
example_wrap.o:example_wrap.c:(.text+0x15c6): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x15e5): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x162d): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x1666): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x174f): undefined reference to `_imp__TclFreeObj'
example_wrap.o:example_wrap.c:(.text+0x17bc): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x17fa): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x1821): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x1851): undefined reference to `_imp__Tcl_GetStringResult'
example_wrap.o:example_wrap.c:(.text+0x18ea): undefined reference to `_imp__Tcl_AppendElement'
example_wrap.o:example_wrap.c:(.text+0x1988): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x19a6): undefined reference to `_imp__Tcl_GetCommandInfo'
example_wrap.o:example_wrap.c:(.text+0x19d0): undefined reference to `_imp__Tcl_DuplicateObj'
example_wrap.o:example_wrap.c:(.text+0x1a14): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x1a3c): undefined reference to `_imp__Tcl_CreateObjCommand'
example_wrap.o:example_wrap.c:(.text+0x1abf): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x1af6): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x1b7e): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x1c0b): undefined reference to `_imp__Tcl_GetObjResult'
example_wrap.o:example_wrap.c:(.text+0x1c15): undefined reference to `_imp__Tcl_DuplicateObj'
example_wrap.o:example_wrap.c:(.text+0x1c33): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x1c70): undefined reference to `_imp__Tcl_DuplicateObj'
example_wrap.o:example_wrap.c:(.text+0x1c8e): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x1cb0): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x1cd7): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x1d3b): undefined reference to `_imp__TclFreeObj'
example_wrap.o:example_wrap.c:(.text+0x1dc0): undefined reference to `_imp__Tcl_CreateObjCommand'
example_wrap.o:example_wrap.c:(.text+0x1e3c): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x1e9e): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x1f18): undefined reference to `_imp__Tcl_GetLongFromObj'
example_wrap.o:example_wrap.c:(.text+0x1fc1): undefined reference to `_imp__Tcl_GetDoubleFromObj'
example_wrap.o:example_wrap.c:(.text+0x2043): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x2066): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x2082): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x2145): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x21d8): undefined reference to `_imp__Tcl_AppendResult'
example_wrap.o:example_wrap.c:(.text+0x2201): undefined reference to `_imp__Tcl_GetDoubleFromObj'
example_wrap.o:example_wrap.c:(.text+0x2243): undefined reference to `_imp__Tcl_GetLongFromObj'
example_wrap.o:example_wrap.c:(.text+0x22b1): undefined reference to `_imp__Tcl_NewIntObj'
example_wrap.o:example_wrap.c:(.text+0x22e9): undefined reference to `_imp__Tcl_NewStringObj'
example_wrap.o:example_wrap.c:(.text+0x233e): undefined reference to `_imp__Tcl_NewDoubleObj'
example_wrap.o:example_wrap.c:(.text+0x235c): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x2382): undefined reference to `_imp__Tcl_SetVar2'
example_wrap.o:example_wrap.c:(.text+0x23ab): undefined reference to `_imp__TclFreeObj'
example_wrap.o:example_wrap.c:(.text+0x23db): undefined reference to `_imp__Tcl_NewStringObj'
example_wrap.o:example_wrap.c:(.text+0x2401): undefined reference to `_imp__Tcl_ObjGetVar2'
example_wrap.o:example_wrap.c:(.text+0x242d): undefined reference to `_imp__TclFreeObj'
example_wrap.o:example_wrap.c:(.text+0x2567): undefined reference to `_imp__Tcl_SetObjResult'
example_wrap.o:example_wrap.c:(.text+0x26b4): undefined reference to `_imp__Tcl_SetObjResult'
example_wrap.o:example_wrap.c:(.text+0x2721): undefined reference to `_imp__Tcl_SetObjResult'
example_wrap.o:example_wrap.c:(.text+0x2a7d): undefined reference to `_imp__Tcl_InitHashTable'
example_wrap.o:example_wrap.c:(.text+0x2bd8): undefined reference to `_imp__Tcl_InitHashTable'
example_wrap.o:example_wrap.c:(.text+0x2c72): undefined reference to `_imp__Tcl_PkgProvide'
example_wrap.o:example_wrap.c:(.text+0x2ce7): undefined reference to `_imp__Tcl_CreateObjCommand'
example_wrap.o:example_wrap.c:(.text+0x2d3c): undefined reference to `_imp__Tcl_SetVar'
example_wrap.o:example_wrap.c:(.text+0x2d86): undefined reference to `_imp__Tcl_TraceVar'
example_wrap.o:example_wrap.c:(.text+0x2dd0): undefined reference to `_imp__Tcl_TraceVar'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: example_wrap.o: bad reloc address 0x0 in section `.data'
collect2.exe: error: ld returned 1 exit status

C:\Cplusplus\swigwin-2.0.11>

Open in new window



and on Cygwin editor I get

vbhagat@USTP2NB29224 ~
$ gcc -shared example.o  example_wrap.o -Wl,  -o example.dll
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find : Invalid argument
collect2.exe: error: ld returned 1 exit status

Open in new window

0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
jgdvishnuSoftware ArchitectAuthor Commented:
how(what are the steps) do we link gcc to TCL Library

currently the command is

$ gcc -shared example.o  example_wrap.o -o example.dll

Open in new window

and output is
example_wrap.o:example_wrap.c:(.text+0x91b): undefined reference to `_imp__Tcl_ResetResult'
example_wrap.o:example_wrap.c:(.text+0x92f): undefined reference to `_imp__Tcl_SetObjResult'
example_wrap.o:example_wrap.c:(.text+0x953): undefined reference to `_imp__Tcl_SetErrorCode'
example_wrap.o:example_wrap.c:(.text+0x968): undefined reference to `_imp__Tcl_ResetResult'
example_wrap.o:example_wrap.c:(.text+0x98c): undefined reference to `_imp__Tcl_SetErrorCode'
example_wrap.o:example_wrap.c:(.text+0x9b7): undefined reference to `_imp__Tcl_AppendResult'
example_wrap.o:example_wrap.c:(.text+0x9d4): undefined reference to `_imp__Tcl_NewStringObj'
example_wrap.o:example_wrap.c:(.text+0x9fc): undefined reference to `_imp__Tcl_ObjSetVar2'
example_wrap.o:example_wrap.c:(.text+0xa88): undefined reference to `_imp__Tcl_InitHashTable'
example_wrap.o:example_wrap.c:(.text+0xb32): undefined reference to `_imp__Tcl_DeleteHashEntry'
example_wrap.o:example_wrap.c:(.text+0xbb1): undefined reference to `_imp__Tcl_VarEval'
example_wrap.o:example_wrap.c:(.text+0xbc2): undefined reference to `_imp__Tcl_GetObjResult'
example_wrap.o:example_wrap.c:(.text+0xbda): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0xbee): undefined reference to `_imp__Tcl_ResetResult'
example_wrap.o:example_wrap.c:(.text+0xc1c): undefined reference to `_imp__Tcl_VarEval'
example_wrap.o:example_wrap.c:(.text+0xc2f): undefined reference to `_imp__Tcl_ResetResult'
example_wrap.o:example_wrap.c:(.text+0xc46): undefined reference to `_imp__Tcl_ResetResult'
example_wrap.o:example_wrap.c:(.text+0xc5d): undefined reference to `_imp__Tcl_GetObjResult'
example_wrap.o:example_wrap.c:(.text+0xc6f): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0xd5d): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0xdf3): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0xef9): undefined reference to `_imp__Tcl_NewStringObj'
example_wrap.o:example_wrap.c:(.text+0xf8f): undefined reference to `_imp__Tcl_NewStringObj'
example_wrap.o:example_wrap.c:(.text+0xfc2): undefined reference to `_imp__Tcl_GetVar'
example_wrap.o:example_wrap.c:(.text+0x1040): undefined reference to `_imp__Tcl_SetVar'
example_wrap.o:example_wrap.c:(.text+0x10bc): undefined reference to `_imp__TclFreeObj'
example_wrap.o:example_wrap.c:(.text+0x110f): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x1133): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x11e0): undefined reference to `_imp__Tcl_DeleteCommandFromToken'
example_wrap.o:example_wrap.c:(.text+0x13f8): undefined reference to `_imp__TclFreeObj'
example_wrap.o:example_wrap.c:(.text+0x143e): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x1462): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x151c): undefined reference to `_imp__TclFreeObj'
example_wrap.o:example_wrap.c:(.text+0x1561): undefined reference to `_imp__Tcl_DuplicateObj'
example_wrap.o:example_wrap.c:(.text+0x1572): undefined reference to `_imp__Tcl_SetObjResult'
example_wrap.o:example_wrap.c:(.text+0x15c6): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x15e5): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x162d): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x1666): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x174f): undefined reference to `_imp__TclFreeObj'
example_wrap.o:example_wrap.c:(.text+0x17bc): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x17fa): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x1821): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x1851): undefined reference to `_imp__Tcl_GetStringResult'
example_wrap.o:example_wrap.c:(.text+0x18ea): undefined reference to `_imp__Tcl_AppendElement'
example_wrap.o:example_wrap.c:(.text+0x1988): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x19a6): undefined reference to `_imp__Tcl_GetCommandInfo'
example_wrap.o:example_wrap.c:(.text+0x19d0): undefined reference to `_imp__Tcl_DuplicateObj'
example_wrap.o:example_wrap.c:(.text+0x1a14): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x1a3c): undefined reference to `_imp__Tcl_CreateObjCommand'
example_wrap.o:example_wrap.c:(.text+0x1abf): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x1af6): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x1b7e): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x1c0b): undefined reference to `_imp__Tcl_GetObjResult'
example_wrap.o:example_wrap.c:(.text+0x1c15): undefined reference to `_imp__Tcl_DuplicateObj'
example_wrap.o:example_wrap.c:(.text+0x1c33): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x1c70): undefined reference to `_imp__Tcl_DuplicateObj'
example_wrap.o:example_wrap.c:(.text+0x1c8e): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x1cb0): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x1cd7): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x1d3b): undefined reference to `_imp__TclFreeObj'
example_wrap.o:example_wrap.c:(.text+0x1dc0): undefined reference to `_imp__Tcl_CreateObjCommand'
example_wrap.o:example_wrap.c:(.text+0x1e3c): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x1e9e): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x1f18): undefined reference to `_imp__Tcl_GetLongFromObj'
example_wrap.o:example_wrap.c:(.text+0x1fc1): undefined reference to `_imp__Tcl_GetDoubleFromObj'
example_wrap.o:example_wrap.c:(.text+0x2043): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x2066): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x2082): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x2145): undefined reference to `_imp__Tcl_SetResult'
example_wrap.o:example_wrap.c:(.text+0x21d8): undefined reference to `_imp__Tcl_AppendResult'
example_wrap.o:example_wrap.c:(.text+0x2201): undefined reference to `_imp__Tcl_GetDoubleFromObj'
example_wrap.o:example_wrap.c:(.text+0x2243): undefined reference to `_imp__Tcl_GetLongFromObj'
example_wrap.o:example_wrap.c:(.text+0x22b1): undefined reference to `_imp__Tcl_NewIntObj'
example_wrap.o:example_wrap.c:(.text+0x22e9): undefined reference to `_imp__Tcl_NewStringObj'
example_wrap.o:example_wrap.c:(.text+0x233e): undefined reference to `_imp__Tcl_NewDoubleObj'
example_wrap.o:example_wrap.c:(.text+0x235c): undefined reference to `_imp__Tcl_GetStringFromObj'
example_wrap.o:example_wrap.c:(.text+0x2382): undefined reference to `_imp__Tcl_SetVar2'
example_wrap.o:example_wrap.c:(.text+0x23ab): undefined reference to `_imp__TclFreeObj'
example_wrap.o:example_wrap.c:(.text+0x23db): undefined reference to `_imp__Tcl_NewStringObj'
example_wrap.o:example_wrap.c:(.text+0x2401): undefined reference to `_imp__Tcl_ObjGetVar2'
example_wrap.o:example_wrap.c:(.text+0x242d): undefined reference to `_imp__TclFreeObj'
example_wrap.o:example_wrap.c:(.text+0x2567): undefined reference to `_imp__Tcl_SetObjResult'
example_wrap.o:example_wrap.c:(.text+0x26b4): undefined reference to `_imp__Tcl_SetObjResult'
example_wrap.o:example_wrap.c:(.text+0x2721): undefined reference to `_imp__Tcl_SetObjResult'
example_wrap.o:example_wrap.c:(.text+0x2a7d): undefined reference to `_imp__Tcl_InitHashTable'
example_wrap.o:example_wrap.c:(.text+0x2bd8): undefined reference to `_imp__Tcl_InitHashTable'
example_wrap.o:example_wrap.c:(.text+0x2c72): undefined reference to `_imp__Tcl_PkgProvide'
example_wrap.o:example_wrap.c:(.text+0x2ce7): undefined reference to `_imp__Tcl_CreateObjCommand'
example_wrap.o:example_wrap.c:(.text+0x2d3c): undefined reference to `_imp__Tcl_SetVar'
example_wrap.o:example_wrap.c:(.text+0x2d86): undefined reference to `_imp__Tcl_TraceVar'
example_wrap.o:example_wrap.c:(.text+0x2dd0): undefined reference to `_imp__Tcl_TraceVar'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: example_wrap.o: bad reloc address 0x0 in section `.data'
collect2.exe: error: ld returned 1 exit status

Open in new window

0
 
jgdvishnuSoftware ArchitectAuthor Commented:
The TCL library was not needed. The solution was resolved by rewriting the code again.
The steps to fix the JNI issue in the SWIG link

C:\swigwin-2.0.11>swig -java Test.i

C:\swigwin-2.0.11>gcc -c Test.c Test_wrap.c -I/C:/Installation/Java6/include -I/C:/Installation/Java6/include/win32

C:\swigwin-2.0.11>gcc -shared Test.o  Test_wrap.o -o Test.dll

Open in new window

0
 
jgdvishnuSoftware ArchitectAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for jgdvishnu's comment #a39865746

for the following reason:

The JKR solution worked
0
 
jgdvishnuSoftware ArchitectAuthor Commented:
excellent hint
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.