Reputation: 11278
In the process of porting a C project from Linux to Windows
Have installed MinGW
Have compiled my shared library using a Makefile
This produces libExample.so
Now I'm trying to link this shared library to a test harness so I can see if everything is working as expected
In the harness Makefile I specify the location of the library, e.g. -LE:/libExample_dir
and the name of the library -lExample
but its complaining it cannot find the library, i.e. linker is failing with cannot find -lExample
- is there some difference with windows regarding .so
and .dll
or perhaps pathnames that I am missing?
Upvotes: 0
Views: 541
Reputation: 169833
You need to fix the make file so shared libraries are generated with a .dll
extension.
If I had to guess, I'd say that while renaming the generated file is enough to make the linker happy, the loader still expects the .so
extension because that's the name that was compiled in...
Upvotes: 2
Reputation: 11278
Using MinGw to compile C code to produce a shared library, remember to rename the output from libExample.so
to libExample.dll
otherwise the linker will fail to find your library
Upvotes: 1