Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

errno on RedHat 9, nigpib-linux-0.8.4

programs with libgpib ver 0.8.4 do not compile on RedHat 9 due to unresolved "errno". Is it possible to recompile at least cib.c with "include " instead of "extern int errno"? Or better to recompile libgpib.a for RedHat 9? At the moment, there are serious difficulties to define errno and set it to correct address.

Thanks,

Andrej
0 Kudos
Message 1 of 7
(3,957 Views)
Hi Andrej,

You should be able to get your programs to compile by simply defining errno in your app. If it is extern'd in libgpib.a, all that means is that "someone else will define this variable that I am going to use". If you dig through errno.h, you can see that it is really just a bunch of #defines and I do not believe it will change the problem you are currently facing.

Hope this helps out!

Best Regards,
Aaron K.
Application Engineer
National Instruments
Message 2 of 7
(3,957 Views)
It is not that simple. I have to link also to a bunch of other libraries, which break due to threads with segmentation violation as soon as I try to define errno.
For example, something like:

extern "C" {
extern int* __errno_location(void) throw () __attribute__ ((__const__));
int *errno(void) {
return __errno_location();
};
}
0 Kudos
Message 3 of 7
(3,957 Views)
Hi Andrefj,

I am going to look into this further, but this will take some time. In the mean time, one idea that may work is to open up the libgpib.a file and replace all of the errno strings you see with NoErr and then define that in your main application.

I believe that this will work until I can get you a better solution.

Best Regards,
Aaron K.
Application Engineer
National Instruments
0 Kudos
Message 4 of 7
(3,957 Views)
Hi Aaron K,
I've got the same problem with libgpib.a in that I get an unresolved reference to 'errno' under Redhat Linux 9.0. Could you elaborate on the utilities and procedures under Linux to "open up the libgpib.a file and replace all of the errno strings you see with NoErr"?

Thanks for your help,
Thundt
0 Kudos
Message 5 of 7
(3,957 Views)
Aaron K,
I've located the problem with the libgpib.a file that downloads with nigpib-linux-0.8.5. The archive file holds 7 copies of cib.o with dates that range from April 17 to June 18 with the last version the same size as the latest copy of that file. Use the following commands to rebuild the archive.

mv libgpib.a libgpib.a.orig
ar qv libgpib.a cib.o
cp libgpib.a /usr/local/lib

Good Luck,
Thundt
0 Kudos
Message 6 of 7
(3,957 Views)
Wow, this really works. Perhaps one of the developers could get around to fixing the tarball so that everyone else does not have to hunt for this fix. It can't take any more than about five minutes to do so.
0 Kudos
Message 7 of 7
(3,957 Views)