Web lists-archives.com

Re: [Mingw-users] Problems creating linkable file from MSVC .lib




Thanks John.

Here's the output of nm on the object linking against that lib:

$ nm VectorDriver.o | grep ncd
         U __imp__ncdActivateChannel
         U __imp__ncdCloseDriver
         U __imp__ncdClosePort
         U __imp__ncdGetDriverConfig
         U __imp__ncdGetReceiveQueueLevel
         U __imp__ncdOpenDriver
         U __imp__ncdOpenPort
...

While the linker still gives errors like this:
undefined reference to `_imp__ncdGetDriverConfig'


The command used to link:
g++  -o dist/sidtest build/SIDTest_Windows/MinGW-Windows/source/candevice/windows/VectorDriver.o <...more of my .o files...> lib/windows/ia32/libvcinpl.a lib/windows/ia32/libvcand32.a -static -static-libgcc -static-libstdc++

Both libvcinpl.a and libvcand32a were generated by me, from reimp/dlltool (and as to add the obj file reimp left me) in the former case which works and gendef/dlltool in the latter which doesnt.

I did get the project linking and running fine yesterday (even when I call functions from that lib) by just linking against the dll instead for the second library (vcand32.dll). This doesn't work for the first library (vcimpl.dll). I got the idea from this page https://www.sourceware.org/binutils/docs-2.21/ld/WIN32.html in the section "direct linking to a dll"... 

So now my link command looks like this:
g++  -o dist/sidtest build/SIDTest_Windows/MinGW-Windows/source/candevice/windows/VectorDriver.o <...more of my .o files...> lib/windows/ia32/libvcinpl.a lib/windows/ia32/vcand32.dll -static -static-libgcc -static-libstdc++


I guess it's not clear to me though what `ln` is able to figure out about the DLL that I wasn't able to, or why this method works for one of my DLLs but not the other.

Chris

On Fri, Feb 19, 2016 at 3:46 AM, John Brown <johnbrown105@xxxxxxxxxxx> wrote:
1) Run nm on the object files that you are trying to link to the
import library and compare the names with those in the library.

2) Post the command line that you use to link to the library.

Regards,
John Brown.
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe