• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem in calling a c function from java program using jni

 
john schildt
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello all.....i m trying my best to explain my problem so please dont get annoyed by the extra elaboration...
i have a c project made up large no of files ...each file doing some function....they r called by main function.....
i have a java program(a gui) which has to call few of these functions to perform its functioning.... first i made one function native and changed its prototype to java_java.func_c.func()....and did all other things but when i tried to build a dll of my project it is giving an error in the main of c program
:unresolved symbol name c.func()//this is the function whose protoytpe i have changed
now what should i do so that thsi error can b removed.......
also if this done i will have to add other function also in my java prog ....can i make two diff function native....they r in the same project i.e dll is same???
please help me
 
john schildt
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i tried to solve my problem by making the main function native and then doing all the things i was successful in making a dll but on running the java program it is giving :-
Exception in thread "main" java.lang.UnsatisfiedLinkError:cmain
at finalopenpic.cmain(Native Method)
at finalopenpic.main(finalopenpic.java:33)
camin is the name of my main function in c project....i changed its name from main to cmain....i guess i did not commit any horrible mistake by doing that...
any help in solving this problem???
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!