Not able to link with phidget21.lib

C, C++, and Visual C++
Vineet_MGSL
Fresh meat
Posts: 1
Joined: Sun Jun 08, 2014 5:16 am
Contact:

Not able to link with phidget21.lib

Postby Vineet_MGSL » Sun Jun 08, 2014 5:40 am

Hi there,

I am using gcc (under minGW) on Windows 8. In trying to build the HelloWorld.c program using the following command (as suggested from the Phidgets site):

gcc HelloWorld.c -o HelloWorld -I"C:\Program Files\Phidgets" -L"C:\Program Files\Phidgets" -lphidget21

However, I have been unable to link with the phidget21.lib. I have previously done the installation and was able to see the Phidgets panel etc which gives me the confidence that the setup is find. And I do have the phidget21.lib file in the C:\Program Files\Phidgets directory. After several unsuccessful attempts, I moved to Code Blocks IDE, but the outcome is the same. The code compiles but I get errors during the linking process.

Here is the Code Blocks output:

||=== Build: Debug in test (compiler: GNU GCC Compiler) ===|
obj\Debug\examples_unzipped\HelloWorld.o||In function `AttachHandler@8':|
D:\MGSL\Phidgets_gcc\examples_unzipped\HelloWorld.c|17|undefined reference to `_imp__CPhidget_getDeviceName@8'|
D:\MGSL\Phidgets_gcc\examples_unzipped\HelloWorld.c|19|undefined reference to `_imp__CPhidget_getSerialNumber@8'|
obj\Debug\examples_unzipped\HelloWorld.o||In function `DetachHandler@8':|
D:\MGSL\Phidgets_gcc\examples_unzipped\HelloWorld.c|32|undefined reference to `_imp__CPhidget_getDeviceName@8'|
D:\MGSL\Phidgets_gcc\examples_unzipped\HelloWorld.c|34|undefined reference to `_imp__CPhidget_getSerialNumber@8'|
obj\Debug\examples_unzipped\HelloWorld.o||In function `LocalErrorCatcher':|
D:\MGSL\Phidgets_gcc\examples_unzipped\HelloWorld.c|64|undefined reference to `_imp__CPhidget_getErrorDescription@8'|
obj\Debug\examples_unzipped\HelloWorld.o||In function `main':|
D:\MGSL\Phidgets_gcc\examples_unzipped\HelloWorld.c|81|undefined reference to `_imp__CPhidgetManager_create@4'|
D:\MGSL\Phidgets_gcc\examples_unzipped\HelloWorld.c|84|undefined reference to `_imp__CPhidgetManager_set_OnAttach_Handler@12'|
D:\MGSL\Phidgets_gcc\examples_unzipped\HelloWorld.c|88|undefined reference to `_imp__CPhidgetManager_set_OnDetach_Handler@12'|
D:\MGSL\Phidgets_gcc\examples_unzipped\HelloWorld.c|92|undefined reference to `_imp__CPhidgetManager_set_OnError_Handler@12'|
D:\MGSL\Phidgets_gcc\examples_unzipped\HelloWorld.c|99|undefined reference to `_imp__CPhidgetManager_open@4'|
D:\MGSL\Phidgets_gcc\examples_unzipped\HelloWorld.c|107|undefined reference to `_imp__CPhidgetManager_close@4'|
D:\MGSL\Phidgets_gcc\examples_unzipped\HelloWorld.c|109|undefined reference to `_imp__CPhidgetManager_delete@4'|
||=== Build failed: 12 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

Any suggestions/help/debug thoughts will be greatly appreciated! Thanks in advance.

Vineet

pflieger
Fresh meat
Posts: 1
Joined: Tue Jan 12, 2016 12:31 pm
Contact:

Re: Not able to link with phidget21.lib

Postby pflieger » Tue Jan 12, 2016 12:40 pm

I'm having the same issue. It appears that gcc can't find the library - phidget21.lib. I had tried to move it into the actual directory with the code, but gcc chose to ignore it. I had to create a subdirectory, place the library there, then build using the -L option to specify a relative path.

Also, it gave me the same response if I linked the 64 bit library.

Now I get a System Error telling me phidget21.dll is missing - even though it's clearly there in /Windows/System32/

:?


Return to “C/C++”

Who is online

Users browsing this forum: No registered users and 2 guests