Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » cannot find-lABC(Emergency)
cannot find-lABC [message #1826860] Sat, 02 May 2020 21:32 Go to next message
imb 45 is currently offline imb 45Friend
Messages: 6
Registered: May 2020
Junior Member
Hi guys , i need your help please
So i want to add external library to my project in order to compile correctly.
The problem is that my library is "ABC.LIB" don't link properly :
Solution 1
add in setting -> MinGW C Linker -> Libraries the path of the library(-L) and since the library doesn't start with "lib" i left the (-l) tab empty and added the library in Miscellaneous-> Other object but the problem is when i build the project i got the error ''undefined reference to xxx" i think it's due to the fact that the gcc start with object files before library

gcc "-LC:\\User\\Desktop\\CCmpUTest\\src\\Env\\Dependencies\\lib" -o aaa.exe "src\\Cmp\\hello1.o" "src\\Cmp\\hello2.o" "..\\src\\Env\\Dependencies\\lib\\ABC.LIB"

Solution 2
I tried to rename the lib file to "libabc.lib" or change extension to "libabc.a" but i got the error cannot find-labc

Can someone help me please with this issue, i've been stuck with it for a while :/
Re: cannot find-lABC [message #1826877 is a reply to message #1826860] Sun, 03 May 2020 18:30 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
The .lib suffix suggests that the library is not a normal library for the GNU toolset. Are you sure that it is in proper format to link with the GNU ld?

--

Tauno Voipio
Re: cannot find-lABC [message #1826959 is a reply to message #1826877] Tue, 05 May 2020 11:07 Go to previous messageGo to next message
imb 45 is currently offline imb 45Friend
Messages: 6
Registered: May 2020
Junior Member
Hi Tauno,
Thank you for your response, actually i don't know but the .lib fie is result of compilation by MS Visual C++
Re: cannot find-lABC [message #1826961 is a reply to message #1826959] Tue, 05 May 2020 11:26 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
That's it. MS C++ binaries do not link with GCC object code.

--

Tauno Voipio
Re: cannot find-lABC [message #1826963 is a reply to message #1826961] Tue, 05 May 2020 12:00 Go to previous messageGo to next message
imb 45 is currently offline imb 45Friend
Messages: 6
Registered: May 2020
Junior Member
But i need informations (explicit functions) only defined in those .lib files to build my c project correctly. Is there a way to do it ?
Re: cannot find-lABC [message #1826966 is a reply to message #1826963] Tue, 05 May 2020 13:03 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
If you're going to use the functions in the library, you *do* need to link with the binary format. The function definitions should be in the header file.

Sorry, no win here.


--

Tauno Voipio
Re: cannot find-lABC [message #1826968 is a reply to message #1826966] Tue, 05 May 2020 13:09 Go to previous messageGo to next message
imb 45 is currently offline imb 45Friend
Messages: 6
Registered: May 2020
Junior Member
Sorry, that's what i meant i need to use functions already defined in header files. I've searched on the internet for a way to convert those *.lib files into *.a files but it doesn't seem to work or i'm doing it wrong :/
Re: cannot find-lABC [message #1826974 is a reply to message #1826968] Tue, 05 May 2020 14:28 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
You're stuck.
http://www.mingw.org/wiki/Interoperability_of_Libraries_Created_by_Different_Compiler_Brands

Even MS VC++ files from different versions of Visual C++ won't necessarily link with each other.
https://stackoverflow.com/questions/4782714/gcc-vs-ms-c-compiler-for-maintaining-api-backwards-binary-compatibility/4782874#4782874
https://stackoverflow.com/a/4833439

Switch to MSVC++ for your toolchain or try to find the lib source and rebuild with g++.


[Updated on: Tue, 05 May 2020 18:06]

Report message to a moderator

Re: cannot find-lABC [message #1827076 is a reply to message #1826974] Wed, 06 May 2020 16:07 Go to previous messageGo to next message
imb 45 is currently offline imb 45Friend
Messages: 6
Registered: May 2020
Junior Member
How to use MSVC++ for toolchain, i didn't find it on tools suggested in the toolchain tab
Re: cannot find-lABC [message #1827081 is a reply to message #1827076] Wed, 06 May 2020 19:11 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
I did this long ago and can't remember what I did.
The Eclipse documentation says all you need is to install Windows SDK.
Under Help-->Install New Software-->Programming Languages there is a selection for Visual C++ Support.
I'm not using currently using Windows so I can't try it myself.

index.php/fa/38059/0/

This thread might help:
https://stackoverflow.com/questions/41401515/visual-studio-toolchain-in-eclipse-for-c
https://stackoverflow.com/a/60646506


Previous Topic:TrustZone Debug Thread Reserved
Next Topic:How to make Errors (Problems) from Build persistent until next build - Custom Error Parser
Goto Forum:
  


Current Time: Fri Apr 19 14:59:33 GMT 2024

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

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

Back to the top