Topic: Win7 - 1.4.2 - Error with library file

Hello,

I compiled the libnfc 1.4.2 on Windows 7 (64 bit) using the manual provided, but there is no nfc.lib or any other library file created. How to generate the nfc.lib file?


I thought that the libnfc.dll.a was the library file, but when I rename it to libnfc.lib and use it in my project, it tries to find different entrypoints that don't exist in the libnfc.dll (for example, I use Gdiplus, and it will try and find GdipFree in libnfc.dll)


(exact error message)

---------------------------
Entry Point Not Found
---------------------------
The procedure entry point GdiplusShutdown could not be located in the dynamic link library libnfc.dll.
---------------------------
OK   
---------------------------

removing gdi+ to test, will result in the failing of sqlite


Only errors out in Release, works fine in debug

Last edited by Anon122 (2011-02-23 13:50:32)

Re: Win7 - 1.4.2 - Error with library file

Are you sure ?
Inside the compiling folder you can find libnfc\libnfc.dll.a file.
To semplify your life I suggest you to type mingw32-make package and create a setup package so every new version you can remove it simply.
You will need NSIS installed.

Re: Win7 - 1.4.2 - Error with library file

Well, I might have explained it wrong because of the edits.

Under debug the libnfc.dll.a works fine, under release it gives the entrypoint errors...

Later i'm going to try and figure out which setting is causing this behaviour (vs c++ 2010)

[Edit]
When in release, you set References in Linker-->Optimization from Yes to No, it will also work in Release...

I have no clue why this is, might be an error with make under windows, that it will generate a not completly valid library file?

Last edited by Anon122 (2011-02-23 17:01:02)

Re: Win7 - 1.4.2 - Error with library file

I cannot find any GdiPlusShutdown entry in libnfc-1.4.2 sources in any file !!!
As far I could see I could compile libnfc with no errors.
May be it's a problem with your project and Visual Studio.

Re: Win7 - 1.4.2 - Error with library file

As indicated, it could be a VS2010 thing or a error by cmake.

Versions:
-cmake 2.8.4
-mingw64-runtime (mingw64-runtime-tdm64-gcc45-r3427)
-libusb 0.1.12.2

As an extra note, the older precompiled versions never had this problem.

Re: Win7 - 1.4.2 - Error with library file

I compiled libnfc-1.4.2 with

cmake 2.8.4
mingw64 4.5.1 (tdm64-gcc45-svn3485)
libusb 0.1.12.2

on Windows 7 Professional 32 bit.

What do you mean with "older precompiled version" ?

Re: Win7 - 1.4.2 - Error with library file

I mean version 1.3.9 for example, in the deprecated download list

Re: Win7 - 1.4.2 - Error with library file

So, does it works ?

Romuald Conty

Re: Win7 - 1.4.2 - Error with library file

No, it does not work as expected, you can't enable all optimisations in the compiler.

The library file created under windows (libnfc.dll.a) cannot be included in a C++ 2010 project with the setting set to release when the linker optimization is enabled.

Re: Win7 - 1.4.2 - Error with library file

Does the development version for subversion's trunk solved the problem ?
If not, do you know how to fix it ?

Romuald Conty