How do I link OBJ to DLL in VC++?
843829Feb 25 2004 — edited Apr 13 2004If anyone can help me with this, it will help me so much.
I am trying to write a GPIB wrapper and I found this on a website.
http://www.evaluationengineering.com/archive/articles/0603pc.htm
This page helped me understand what I need to do, but I am still a bit puzzled
when it comes to linking file in C.
One of the comments in a C header file says to LINK "gpib-32.obj" file for windows.
Since I am not familar with C, I have no idea how to do that.
If anyone knows how to do this, can you please point me to a right direction?
I am trying to use VC++ compiler to do this.
Thanks alot.
Here is the C header file.
#include "nigpib_javaGPIB.h"
#include <stdio.h>
#include <string.h>
/* must link with cib.o for Linux*/
#include "ugpib.h" /* if using Linux */
/* must link gpib-32.obj for Windows*/
/*#include <windows.h>/*if using Windows */
/*#include "Decl-32.h" /*if using Windows */
void main(){
}
JNIEXPORT jint JNICALL
Java_nigpib_javaGPIB_ibdev(JNIEnv * env, jobject callingObj, jint boardaddr, jint primaddr, jint scndaddr, jint timout, jint eotx, jint eostr)
{
int dev;
dev=ibdev((int)boardaddr, (int)primaddr, (int)scndaddr, (int)timout, (int)eotx, (int)eostr);
return (jint) dev;
}
JNIEXPORT jint JNICALL
Java_nigpib_javaGPIB_ibonl(JNIEnv * env, jobject callingObj, jint dev, jint state)
{
int stat;
stat = ibonl((int)dev,(int)state);
return (jint) stat;
}