public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Duan Wang <duanwang@alcatel-lucent.com>
To: gcc-help@gcc.gnu.org
Cc: Duan Wang <duanwang@alcatel-lucent.com>
Subject: link error
Date: Wed, 01 Apr 2009 13:23:00 -0000	[thread overview]
Message-ID: <49D36ABB.90507@alcatel-lucent.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1731 bytes --]

Hi gcc experts,

I try to compile a sample .c file that communicates with the GPIB 
interface (see attached c file) by using
GCC type of compilers, such as cygwin, Dev-Cpp, MinGW, and C-Free4. Then 
I got the same sort
of error messages - the low level drivers were not found, see the log below:

gcc.exe "C:\Program Files\Agilent\IO Libraries 
Suite\ProgrammingSamples\C\VISA\idn.c" -o "C:\Program Files\Agilent\IO 
Libraries Suite\ProgrammingSamples\C\VISA\idn.exe"   -ansi  
-I"C:\Program Files\VXIPNP\WINNT\include"   -L"C:\Program 
Files\VXIPNP\WINNT\lib\msc"
C:\DOCUME~1\duanwang\LOCALS~1\Temp/ccOycaaa.o(.text+0x59):idn.c: 
undefined reference to `viOpenDefaultRM@4'
C:\DOCUME~1\duanwang\LOCALS~1\Temp/ccOycaaa.o(.text+0x86):idn.c: 
undefined reference to `viOpen@20'
C:\DOCUME~1\duanwang\LOCALS~1\Temp/ccOycaaa.o(.text+0x9c):idn.c: 
undefined reference to `viPrintf'
C:\DOCUME~1\duanwang\LOCALS~1\Temp/ccOycaaa.o(.text+0xb9):idn.c: 
undefined reference to `viScanf'
C:\DOCUME~1\duanwang\LOCALS~1\Temp/ccOycaaa.o(.text+0xda):idn.c: 
undefined reference to `viClose@4'
C:\DOCUME~1\duanwang\LOCALS~1\Temp/ccOycaaa.o(.text+0xe8):idn.c: 
undefined reference to `viClose@4'
collect2: ld returned 1 exit status

The low level drivers, such as viPrintf and viScanf  are in the file of 
visa32.lib that is seated in the directory of ...\lib\msc.
I mean the drivers are sit there but he compiler complains that the 
drivers were not found. And the same error happens
either in windows application or in DOS window. Is there something 
wrong? Please advise. What I expect is to produce
an .exe file that will talk to the instrument that is connected with the 
pc with a GPIB interface.

Thanks,

Duan Wang
Alcatel-Lucent
978-952-7057

[-- Attachment #2: idn.c --]
[-- Type: text/plain, Size: 731 bytes --]

/*idn.c
  This example program queries a GPIB device for an identification string 
  and prints the results. Note that you must change the address. */

#include <visa.h>
#include <stdio.h>

int main () {

  ViSession defaultRM, vi;
  char buf [256] = {0};
  

  /* Open session to GPIB device at address 3 */
  viOpenDefaultRM (&defaultRM);
  viOpen (defaultRM, "GPIB1::3::INSTR", VI_NULL,VI_NULL, &vi);

  /* Initialize device */
  /*viPrintf (vi, "*RST\n");*/

  /* Send an *IDN? string to the device */
  viPrintf (vi, "*IDN?\n");
  
  /* Read results */
  viScanf (vi, "%t", &buf);

  /* Print results */
  printf ("Instrument identification string: %s\n", buf);

  /* Close session */
  viClose (vi);
  viClose (defaultRM);
}

             reply	other threads:[~2009-04-01 13:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-01 13:23 Duan Wang [this message]
2009-04-01 13:42 ` Axel Freyn
     [not found] <AANLkTiniPnQ-ioijpQXhMC1ygSqNSZsEGW2O-OVS5Qa8@mail.gmail.com>
2010-08-12 10:18 ` Link error Andrew Haley
  -- strict thread matches above, loose matches on Subject: below --
2008-08-15 20:39 Vardhan, Sundara (GE Infra, Energy)
2008-07-24 21:03 Vardhan, Sundara (GE Infra, Energy)
2008-07-24 23:55 ` Rob Sherry
2008-07-25 13:32   ` Vardhan, Sundara (GE Infra, Energy)
2008-07-28 11:41     ` Andrew Haley
2008-07-28 12:14       ` Vardhan, Sundara (GE Infra, Energy)
2008-07-28 13:26         ` Andrew Haley
2008-07-29  8:56           ` Ralf Wildenhues
2008-07-29 11:49             ` Andrew Haley
2008-07-29 13:43               ` Vardhan, Sundara (GE Infra, Energy)
2008-07-24 10:04 Vardhan, Sundara (GE Infra, Energy)
2005-10-21 20:22 link error Moon Hwang
2005-10-21 23:08 ` Brian Dessent
2002-10-17  8:11 Link error HKOELMAN
2002-08-13  6:54 Link Error Tom Browder
2002-08-13  7:16 ` Ish Rattan
2002-08-13  7:30   ` Tom Browder
2002-08-13  7:59     ` Ish Rattan
2001-06-05 14:22 link error Alex Fridman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49D36ABB.90507@alcatel-lucent.com \
    --to=duanwang@alcatel-lucent.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).