• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1202
  • Last Modified:

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

0
jgdvishnu
Asked:
jgdvishnu
  • 5
  • 2
1 Solution
 
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
 
jkrCommented:
'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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now