From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8269 invoked by alias); 1 Apr 2009 13:23:19 -0000 Received: (qmail 8134 invoked by uid 22791); 1 Apr 2009 13:23:17 -0000 X-SWARE-Spam-Status: No, hits=0.0 required=5.0 tests=BAYES_50 X-Spam-Check-By: sourceware.org Received: from ihemail2.lucent.com (HELO ihemail2.lucent.com) (135.245.0.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 01 Apr 2009 13:23:10 +0000 Received: from umail.lucent.com (h135-3-40-61.lucent.com [135.3.40.61]) by ihemail2.lucent.com (8.13.8/IER-o) with ESMTP id n31DN8C7005244 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 1 Apr 2009 08:23:08 -0500 (CDT) Received: from alcatel-lucent.com (duanwang-c1.inse.lucent.com [152.148.63.218]) by umail.lucent.com (8.13.8/TPES) with ESMTP id n31DN7Ss000141; Wed, 1 Apr 2009 08:23:08 -0500 (CDT) Message-ID: <49D36ABB.90507@alcatel-lucent.com> Date: Wed, 01 Apr 2009 13:23:00 -0000 From: Duan Wang User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 MIME-Version: 1.0 To: gcc-help@gcc.gnu.org CC: Duan Wang Subject: link error Content-Type: multipart/mixed; boundary="------------040307080906060208050308" Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2009-04/txt/msg00007.txt.bz2 This is a multi-part message in MIME format. --------------040307080906060208050308 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1731 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 --------------040307080906060208050308 Content-Type: text/plain; name="idn.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="idn.c" Content-length: 731 /*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 #include 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); } --------------040307080906060208050308--