From: Fergus, P. <P.F...@lj...> - 2009-02-05 10:29:15
|
Hi William, Thanks for your reply. I managed to get it working yesterday. I made a stupid mistake - I did not realise that you had to have the example.c and example_wrap.c files in the same project before you compile. I simply added the example_wrap.c file and that is why I was getting the following errors. Error 1 error LNK2001: unresolved external symbol _My_variable example_wrap.obj MyTimeDLL Error 2 error LNK2019: unresolved external symbol _fact referenced in function _Java_exampleJNI_fact@12 example_wrap.obj MyTimeDLL Error 3 error LNK2019: unresolved external symbol _my_mod referenced in function _Java_exampleJNI_my_1mod@16 example_wrap.obj MyTimeDLL Error 4 error LNK2019: unresolved external symbol _get_time referenced in function _Java_exampleJNI_get_1time@8 example_wrap.obj MyTimeDLL Error 5 fatal error LNK1120: 4 unresolved externals C:\Users\tocaloshi\Documents\JNIProjects\SWIG Examles\Fact Example\Hello World\Debug\MyTimeDLL.dll MyTimeDLL Again thank you for your help. Kind Regards, Paul -----Original Message----- From: William Fulton [mailto:wi...@fu...] On Behalf Of William S Fulton Sent: 04 February 2009 21:44 To: Fergus, Paul Cc: swi...@li... Subject: Re: [Swig-user] Getting the Tutorial working Fergus, Paul wrote: > Dear All, > > I have managed to fix this problem - there was rtf data in the file because I was using WordPad. Once I switched to Notepad all formatting information was removed and I was able to process the example.i file. > > I know have another problem. I am trying to create a dll from the .c file created using Visual Studio 2008. > > 1) Created a Visual C++/Win32 Project > 2) Application Type: dll > 3) I then simply delete the .cpp file created with the project and add the .c file created by SWIG to the dl > We have Visual Studio project files you can use. Please see http://www.swig.org/Doc1.3/Windows.html which explains how to use the examples. William |