Solved

generate DLL using cygwin or MinGW

Posted on 2014-02-15
7
1,114 Views
Last Modified: 2014-02-17
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
Comment
Question by:jgdvishnu
  • 5
  • 2
7 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 39862233
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
 

Author Comment

by:jgdvishnu
ID: 39862320
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
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 39862886
'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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:jgdvishnu
ID: 39863589
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
 

Author Comment

by:jgdvishnu
ID: 39865746
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
 

Author Comment

by:jgdvishnu
ID: 39865753
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
 

Author Closing Comment

by:jgdvishnu
ID: 39865754
excellent hint
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
simple java question 3 55
Issues with C++ Class 19 92
VS2015 Redefinition errors 4 47
tomcat not starting 6 45
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now