View Full Version : LINK : fatal error LNK1104

08-13-2007, 01:54 PM
Hi, I just switched over to VNI and I am trying to link to the IMSL library. When I am trying to run an example i get the following link-ing problem

1 LINK : fatal error LNK1104: cannot open file 'netapi32.lib'

What should I do about it? Thank you.


08-13-2007, 04:10 PM
My first guess is that you don't have the correct build of IMSL for your platform. We support many different compiler/OS/hardware combinations and many of them require their own builds of the library.

To get started, can you answer a couple questions: What IMSL product and part number do you have? What platform are you running on (OS version, compiler version, hardware)?

08-14-2007, 08:34 AM
That is one of the C runtime libs that are required by the FlexLM license manager (there are several, see the CNL readme.txt file). But, if you are just evaluating CNL or can build dynamically, you should try to use the CNL DLLs and build dynamically. Those projects are much easier to build as they do not require nearly as many Visual C run times to be linked into your project. They are already built in when the DLL was built. Please see the CNL readme.txt file for examples on how to build a project both dynamically and statically.


08-14-2007, 12:17 PM
Hello Brisne,

As pate and ed mentioned this is a runtime library required by the FlexLm license manager. The port (product configuration - compiler, processor, etc.) information is important is because there are hardware optimizations and library requirements for each product.

I'm not sure if your using the C or Fortran Numerical Libraries (CNL and FNL respectively), but assuming CNL this is a common problem with the Microsoft Visual C++ Express compiler. The runtime libraries that are in the library path of the standard integrated development environment (IDE - in this case Microsoft Visual Studio) are not delivered with the Express versions.

The Studio environment adds the following to it's $Path variable:


Of course the relevant IMSL system dependencies exist in these directories. Since the Express compilers do not include these files, the typical Visual C++ Express install is incompatible and unsupported.

There are a set of steps that must be completed in order to build Win32 application with MSVC++E Using Visual C++ 2005 Express (http://msdn2.microsoft.com/en-us/express/aa700735.aspx). Actually you should be able to download and install the Platform SDK (http://www.microsoft.com/downloads/details.aspx?familyid=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&displaylang=en) install and move the required files (msvcrt.lib kernel32.lib user32.lib netapi32.lib advapi32.lib gdi32.lib comdlg32.lib comctl32.lib oldnames.lib wsock32.lib) to the C:\Program Files\Microsoft Visual Studio 8\VC\lib directory. Either way the system files must be available in the path and/or MSVC++E.