Linking Error / outportb [modified]
-
Hello everyone, Thank you for your suggestions in my previous message.It's working.As next step, i want to send my uint8 values here to serial port.For that i added two lines into my code (bold) but i receive this error, [Linker Error] Unresolved external '_outportb' referenced from H:\INTERFACE\INTERFACE.OBJ (Interface is the name of my file in which i saved my code and files) I didnt get the cause of problem,what's wrong?. If anyone has an idea, would be pleased! #include #include #include #include // system() int transmit (double x); int i; system(); outportb(int port, unsigned int); int transmit (double x) { union ifas { double d; unsigned char u8value[8]; }; union ifas member; member.d = x; printf("\nmember.d=%d\n",member.d); for ( i=0 ; i<8 ; i++) { printf("\nmember.u8value[%d]=%f\n",i,member.u8value[i]); outportb(port,member.u8value[i]); } return 0; } int main(int argc, char* argv[]) //Console { double var; scanf("%lf",&var); transmit(var); system("pause"); return 0; } Regards, Cahit -- modified at 11:37 Thursday 17th August, 2006
-
Hello everyone, Thank you for your suggestions in my previous message.It's working.As next step, i want to send my uint8 values here to serial port.For that i added two lines into my code (bold) but i receive this error, [Linker Error] Unresolved external '_outportb' referenced from H:\INTERFACE\INTERFACE.OBJ (Interface is the name of my file in which i saved my code and files) I didnt get the cause of problem,what's wrong?. If anyone has an idea, would be pleased! #include #include #include #include // system() int transmit (double x); int i; system(); outportb(int port, unsigned int); int transmit (double x) { union ifas { double d; unsigned char u8value[8]; }; union ifas member; member.d = x; printf("\nmember.d=%d\n",member.d); for ( i=0 ; i<8 ; i++) { printf("\nmember.u8value[%d]=%f\n",i,member.u8value[i]); outportb(port,member.u8value[i]); } return 0; } int main(int argc, char* argv[]) //Console { double var; scanf("%lf",&var); transmit(var); system("pause"); return 0; } Regards, Cahit -- modified at 11:37 Thursday 17th August, 2006
%d format specifier is signed decimal integer. For your double, use %f. For your unsigned ints, use %u -- modified at 8:35 Thursday 17th August, 2006 Well, actually, since you have chars in your union you should use %c instead of %u.
Cheers Steen. "Are you gonna check your makeup when you're done whining?" John Simmons, 05/31/2006
-
Hello everyone, Thank you for your suggestions in my previous message.It's working.As next step, i want to send my uint8 values here to serial port.For that i added two lines into my code (bold) but i receive this error, [Linker Error] Unresolved external '_outportb' referenced from H:\INTERFACE\INTERFACE.OBJ (Interface is the name of my file in which i saved my code and files) I didnt get the cause of problem,what's wrong?. If anyone has an idea, would be pleased! #include #include #include #include // system() int transmit (double x); int i; system(); outportb(int port, unsigned int); int transmit (double x) { union ifas { double d; unsigned char u8value[8]; }; union ifas member; member.d = x; printf("\nmember.d=%d\n",member.d); for ( i=0 ; i<8 ; i++) { printf("\nmember.u8value[%d]=%f\n",i,member.u8value[i]); outportb(port,member.u8value[i]); } return 0; } int main(int argc, char* argv[]) //Console { double var; scanf("%lf",&var); transmit(var); system("pause"); return 0; } Regards, Cahit -- modified at 11:37 Thursday 17th August, 2006