I have read all the previous replies or solutions for the same linker problem. I understand that the Linker is unable to access the library file that has the functions defined but still I have no luck in solving it!

The errors:

```
1>trial_12th.obj : error LNK2019: unresolved external symbol _viStatusDesc@12 referenced in function _main
1>trial_12th.obj : error LNK2019: unresolved external symbol _viClose@4 referenced in function _main
1>trial_12th.obj : error LNK2019: unresolved external symbol _viRead@16 referenced in function _main
1>trial_12th.obj : error LNK2019: unresolved external symbol _viWrite@16 referenced in function _main
1>trial_12th.obj : error LNK2019: unresolved external symbol _viOpen@20 referenced in function _main
1>trial_12th.obj : error LNK2019: unresolved external symbol _viOpenDefaultRM@4 referenced in function _main
1>C:\Users\41kchoudhary\Documents\Visual Studio 2010\Projects\trial_12th\Debug\trial_12th.exe : fatal error LNK1120: 6 unresolved externals

```

I am trying to send and receive data from a mixed-signal oscilloscope. In doing so I am required to write a .cpp file using the pre-defined commands/functions defined using Microsoft Visual Studio C++. I have read the user manual for using these commands, and I also have the header files and libraries required to implement it.

I am using the following code:

```
#include <visa.h>
#include "stdafx.h"
#include <stdio.h>
#include <memory.h>

int main(int argc, char* argv[])
{
     ViSession rm = VI_NULL, vi = VI_NULL;
     ViStatus status;
     ViChar buffer[256];
     ViUInt32 retCnt;

     // Open a default session
     status = viOpenDefaultRM(&rm);
     if (status < VI_SUCCESS) goto error;

     // Open the GPIB device at primary address 1, GPIB board 8
     status = viOpen(rm, "USB::0x0699::0x0377::C011104::INSTR", VI_NULL, VI_NULL,
     &vi);
     if (status < VI_SUCCESS) goto error;

     // Send an ID query.
     status = viWrite(vi, (ViBuf) "*idn?", 5, &retCnt);
     if (status < VI_SUCCESS) goto error;

     // Clear the buffer and read the response
     memset(buffer, 0, sizeof(buffer));
     status = viRead(vi, (ViBuf) buffer, sizeof(buffer), &retCnt);
     if (status < VI_SUCCESS) goto error;

     // Print the response
     printf("id: %s\n", buffer);

     // Clean up
     viClose(vi); // Not needed, but makes things a bit more

     // understandable
     viClose(rm); // Closes resource manager and any sessions

     // opened with it
     return 0;

     error:
         // Report error and clean up
             viStatusDesc(vi, status, buffer);
             fprintf(stderr, "failure: %s\n", buffer);
             if (rm != VI_NULL) {
                 viClose(rm);
             }
             return 1;
}

```
['https://Stackoverflow.com/questions/15982291', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2276161/']
You could use the [`zero?`](http://ruby-doc.org/core-2.0/File.html#method-c-zero-3F) method:

```
File.zero?("test.rb")

```
`File.size?('test.rb')` evaluates to `nil` if the file is empty `or` it does not exist. `File.zero?('test.rb')` will return true is the file is empty, but it will return false if the file is not found. Depending on your particular needs you should be careful to use the correct method.

As an example in the topic creator's question they specifically asked, "What is the best way to check in Ruby that a file is empty?" The accepted answer does this correctly and will raise a `No such file or directory` error message if the file does not exist. 

In some situations we may consider the lack of a file to be "equivalent" to an empty file.