Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Dynamic and Static libraries(Working to compile an external library)
Dynamic and Static libraries [message #1827737] Fri, 22 May 2020 07:01 Go to next message
Keyara Edwards is currently offline Keyara EdwardsFriend
Messages: 8
Registered: May 2020
Junior Member
So I've tried adding both a static and dynamic libraries in eclipse using the MinGw linker and gcc++ compiler with limited success would anybody be able to clearly explain how to correctly do so. The errors i've run into area:

- the file type was not supported
-file could not be found

and then this wonderful error message as well:

-C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.1.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lD:\workspace\Libraries\C++\SDL2-2.0.12-win32-x64\SDL2.dll

Which after labeling clearly where everything was in the project manager has made me want to smash my pc, please help if possible.

Side note: I have added path in the path&symbols and in the tools under build with correct path to library.

Side note to side note: I might have not done it correctly but there are no compile errors like previous about file not found till the above one.
Re: Dynamic and Static libraries [message #1827740 is a reply to message #1827737] Fri, 22 May 2020 09:17 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
FWIW: I haven't used MinGW in a long time
but I don't think you can include a path in the -l (small L) option.
It's meant to be a shorthand notation of libXXX.a (or a Windows equivalent)
For MinGW, it's a bit more complicated.
https://stackoverflow.com/questions/15852677/static-and-dynamic-shared-linking-with-mingw/15853231#15853231

Are you telling the linker to use a DLL?
You can't use a Windows DLL with MinGW that was generated with MSVC++
http://www.mingw.org/wiki/MSVC_and_MinGW_DLLs
https://stackoverflow.com/questions/2472924/linking-to-msvc-dll-from-mingw/2473242

Some additional reading:

http://www.mingw.org/wiki/HOWTO_Specify_the_Location_of_Libraries_for_use_with_MinGW
https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order
http://www.mingw.org/wiki/specify_the_libraries_for_the_linker_to_use

http://www.mingw.org/wiki/sampleDLL

This forum is for addressing issues with CDT.
Issues involving using external tools are generally off-topic.
While CDT allows you to specify options so that it can generate makefile recipes,
it is assumed you know what those options mean and how to apply them.




Re: Dynamic and Static libraries [message #1838840 is a reply to message #1827740] Sat, 06 March 2021 03:06 Go to previous messageGo to next message
Keyara Edwards is currently offline Keyara EdwardsFriend
Messages: 8
Registered: May 2020
Junior Member
I am truly sorry for the late reply but almost all the websites your recommended are gone as in the page doesn't load.
Re: Dynamic and Static libraries [message #1838843 is a reply to message #1838840] Sat, 06 March 2021 08:02 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Well the http and the MinGW ones seem to be.
I don't have the time to research this again.
As I originally mentioned, it's off-topic as it is a "how-to" for third party tools.

Try changing the http to https.
Suggest trying a web search for using dll mingw or similar
Re: Dynamic and Static libraries [message #1838929 is a reply to message #1838843] Tue, 09 March 2021 18:14 Go to previous messageGo to next message
sydney faria is currently offline sydney fariaFriend
Messages: 54
Registered: March 2013
Member
No Message Body
Re: Dynamic and Static libraries [message #1838930 is a reply to message #1838929] Tue, 09 March 2021 18:20 Go to previous messageGo to next message
sydney faria is currently offline sydney fariaFriend
Messages: 54
Registered: March 2013
Member
I just looked at a couple of UTube videos on this very same subject!!! They discussed static and dynamic libraries, their differences (which I didn't know about), and how to make and use them in Eclipse! Some of them are oriented towards using Linux and others are oriented towards Windows. All are very informative. I can send you links to these videos is you can't find them on UTube.
wt1v
Re: Dynamic and Static libraries [message #1838931 is a reply to message #1838930] Tue, 09 March 2021 18:20 Go to previous message
sydney faria is currently offline sydney fariaFriend
Messages: 54
Registered: March 2013
Member
No Message Body
Previous Topic:break point
Next Topic:Debugger console: GDB bad font rendering
Goto Forum:
  


Current Time: Tue Apr 16 12:35:41 GMT 2024

Powered by FUDForum. Page generated in 0.22582 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top