0

I am trying to add external libraries to my project but I always get this error LINK : fatal error LNK1104: cannot open file 'C:\Users\Lubdmila\Desktop\OpenMAT-1.3.4\lib\x86.obj'. I was following these instructions: (I was given these instructions ) The LpSensor library contains classes that allow a user to integrate LPMS devices into their own applications. The standard library is a Windows 32-bit C++ library for MS Visual C++ (express) 2010. Should you require a binary of the library to work on another operating system or 64-bit applications, please contact LP-RESEARCH.

Compiling applications that use the LpSensor library requires the following components:

Header files (usually in C:/OpenMAT/include):

LpmsSensorManagerI.h Contains the interface for the LpmsSensorManager class.

LpmsSensorI.h Contains the interface for the LpmsSensor class

ImuData.h Structure for containing output data from a LPMS device

LpmsDefinitions.h Macro definitions for accessing LPMS

DeviceListItem.h Contains the class definition for an element of a LPMS device list

LIB files (usually in C:/OpenMAT/lib/x86):

LpSensorD.lib LpSensor library (Debug version)

LpSensor.lib LpSensor library (Release version)

DLL files (usually in C:/OpenMAT/lib/x86): LpSensorD.dll LpSensor library (Debug version)

LpSensor.dll LpSensor library (Release version)

PCANBasic.dll PeakCAN library DLL for CAN interface communication (optional).

ftd2xx.dll The FTDI library to communicate with an LPMS over USB.

To compile the application please do the following:

  1. Include LpmsSensorManagerI.h.

  2. Add LpSensor.lib (or LpSensorD.lib if you are compiling in debug mode) to the link libraries file list of your application

  3. Make sure that you set a path to LpSensor.dll / LpSensorD.dll, PCANBasic.dll (optional) and ftd2xx.dll so that the runtime file of your application can access them.

  4. Build your application.

I am using MS Visual Studio 2010 express 32-bit.And this is what I have done:

1) Project/Properties/Configuration Properties/C/C++/General/Additional Include Directories path---C:\Users\Lubdmila\Desktop\OpenMAT-1.3.4\include

2)Project/Properties/Configuration Properties/Linker/General/Additional Library Directories---C:\Users\Lubdmila\Desktop\OpenMAT-1.3.4\lib\x86

3)Project/Properties/Configuration Properties/Linker/Input/Additional Dependencies---C:\Users\Lubdmila\Desktop\OpenMAT-1.3.4\lib\x86

4) Project/Properties/Configuration Properties/VC++ Directories/General/ Include Directories path---C:\Users\Lubdmila\Desktop\OpenMAT-1.3.4\include

5) include "LpmsSensorManagerI.h"

I have tried to add quotes around the paths but it did not help.I have no clue why I am getting this error.

Does anyone know what I am doing wrong? Thank you

userMilka
  • 37
  • 1
  • 7
  • Well, does `C:\Users\Lubdmila\Desktop\OpenMAT-1.3.4\lib\x86.obj` exist or not? – Andy Brown Oct 27 '15 at 09:50
  • C:\Users\Lubdmila\Desktop\OpenMAT-1.3.4\lib\x86 it think it is just a path where lib and dll files are stored (LpSensor.lib, LpSensorD.lib.....) ... Could you explain me why there is .obj extension.. I tried to put "LpSensor.lib" on its own but it did not work..I got the same error .. – userMilka Oct 27 '15 at 12:11
  • I have manage to build it once successfully but I think I am missing this bit: Make sure that you set a path to LpSensor.dll / LpSensorD.dll, PCANBasic.dll (optional) and ftd2xx.dll so that the runtime file of your application can access them. How can I set the path to .dll files in Visual Studio?? Also I want to thank all of you for answering my question .. – userMilka Oct 27 '15 at 13:03

3 Answers3

0

It seems you have mistakenly added " C:\Users\Lubdmila\Desktop\OpenMAT-1.3.4\lib\x86 " to the additional dependencies under

" Properties/Linker/Input/Additional Dependencies- "

In this section you should simply list your additional library names, such as

" LpSensor.lib "

The path " C:\Users\Lubdmila\Desktop\OpenMAT-1.3.4\lib\x86 " is already set in " Properties/Linker/General/Additional Library Directories--- " for the linker to look for.

harry2680
  • 1
  • 3
  • I tried it..but it did not work I got the same error. – userMilka Oct 27 '15 at 12:12
  • I created a new project and started all over again .. did the same things 1) Project/Properties/Configuration Properties/C/C++/General/Additional Include Directories path---C:\Users\Lubdmila\Desktop\OpenMAT-1.3.4\include 2)Project/Properties/Configuration Properties/Linker/General/Additional Library Directories---C:\Users\Lubdmila\Desktop\OpenMAT-1.3.4\lib\x86 – userMilka Oct 27 '15 at 12:41
  • 3)Project/Properties/Configuration Properties/Linker/Input/Additional Dependencies---" LpSensorD.lib " 4) Project/Properties/Configuration Properties/VC++ Directories/General/ Include Directories path---C:\Users\Lubdmila\Desktop\OpenMAT-1.3.4\include And now iam getting this error: error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup – userMilka Oct 27 '15 at 12:44
0

It works now. I created a new project did the same steps but I changed step 3 as harry 268 advised and then I added path to dll files. Here's the link to the solution: How to add a path to dll files

Visual Studio: how to set path to dll?

Community
  • 1
  • 1
userMilka
  • 37
  • 1
  • 7
0

In my case I had fatal error LNK1104: cannot open file 'C:\Users\..\proj.exe'

in order to solve this issue, I just copied whole proj folder and renamed it. and that is working now

Zrn-dev
  • 99
  • 5