The project doesn't recognize libraries
-
- CodeLite Curious
- Posts: 9
- Joined: Sun Jan 26, 2020 3:04 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
The project doesn't recognize libraries
I have a solution which contains two static libraries, and one application.
I am trying to link the two static libraries with that application but always it doesn't recognize libraries and show me that message:
And here are my settings:
Also, the library files in this way:
Note that I am using ubuntu + Codelite v14.0.2.
How to solve that problem?
I am trying to link the two static libraries with that application but always it doesn't recognize libraries and show me that message:
And here are my settings:
Also, the library files in this way:
Note that I am using ubuntu + Codelite v14.0.2.
How to solve that problem?
-
- CodeLite Plugin
- Posts: 819
- Joined: Wed Sep 03, 2008 7:26 pm
- Contact:
Re: The project doesn't recognize libraries
Hi,
It would be far easier to answer this sort of question if you would attach a tarball of your failing Project, so that we can test it. Or, if you prefer, alter one of the template projects supplied by CodeLite so that it fails in the same way.
Guesses:
David
It would be far easier to answer this sort of question if you would attach a tarball of your failing Project, so that we can test it. Or, if you prefer, alter one of the template projects supplied by CodeLite so that it fails in the same way.
Guesses:
- Does /home/lionking/myProjects/<BlurredOutPath>/build-Debug/bin/AppTest exist on the file system? Your first screenshot suggests it doesn't.
- Does <BlurredOutPath> contain spaces? If so, either remove them or create a symlink work-around.
- In the second screenshot, what is the full line that starts with '/usr/bin/g++ -o ' (the one above 'cannot find -lcore') ?
David
- Jarod42
- CodeLite Expert
- Posts: 240
- Joined: Wed Sep 30, 2009 5:54 pm
- Genuine User: Yes
- IDE Question: C++
- Location: France
- Contact:
Re: The project doesn't recognize libraries
Shouldn't the output libraries be named libfile.a libcore.a?
-
- CodeLite Curious
- Posts: 9
- Joined: Sun Jan 26, 2020 3:04 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: The project doesn't recognize libraries
The path is existing but the executable application itself does not exist because when compiling the two static libraries succeed but the executable application fails because it couldn't find the libraries' files "(see picture 2)" although the libraries files have been compiled successfully.
No, there are no spaces in the entire path, BlurredOutPath is like this "word-world".
Code: Select all
--------Building project:[ AppTest - Debug ]----------
make[1]: Entering directory '/home/lionking/MyProjects/BlurredOutPath/AppTest'
/usr/bin/g++ -o ../build-Debug/bin/AppTest @../build-Debug/AppTest/ObjectsList.txt -L/home/lionking/MyProjects/BlurredOutPath/build-Debug/lib -lcore -lfile
usr/bin/ld: cannot find -lcore
/usr/bin/ld: cannot find -lfile
-
- CodeLite Curious
- Posts: 9
- Joined: Sun Jan 26, 2020 3:04 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: The project doesn't recognize libraries
I already did it as follow:
But there are error messages appear something like
Code: Select all
undefined reference to `az::Binary::Binary(unsigned long)'
undefined reference to `az::Binary::Length()'
............
- Jarod42
- CodeLite Expert
- Posts: 240
- Joined: Wed Sep 30, 2009 5:54 pm
- Genuine User: Yes
- IDE Question: C++
- Location: France
- Contact:
Re: The project doesn't recognize libraries
Where are `az::Binary::Binary(unsigned long)` defined? Are you sure you have implemented them?
From which project error comes from (core/file/appTest)
From which project error comes from (core/file/appTest)
-
- CodeLite Curious
- Posts: 9
- Joined: Sun Jan 26, 2020 3:04 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: The project doesn't recognize libraries
- "Binary" is one of the classes that related to the "core" project (static library). it has .h and .cpp files and has been implemented too.
- The errors come from "AppTest" project.
-
- CodeLite Plugin
- Posts: 819
- Joined: Wed Sep 03, 2008 7:26 pm
- Contact:
Re: The project doesn't recognize libraries
It might be a problem with how you enter the library names.
I just created a new GUI template project, 'StaticlibLinking'. It doesn't need a static lib, but I'm telling the linker to add one anyway: one from an old wx3.0.3 static build. Its filepath is /home/david/devel/wxWidgets-3.0.3/udb3static/lib/libwxscintilla-3.0.a
So I've put '/home/david/devel/wxWidgets-3.0.3/udb3static/lib/' in the Libraries Search Path field, and tried different library names in the Libraries field.
Entering either wxscintilla-3.0.a or wxscintilla-3.0 built successfully,
but the linker could not find wxscintilla.
What are the actual names of your two static libraries? And what do you call them in the Libraries field?
I just created a new GUI template project, 'StaticlibLinking'. It doesn't need a static lib, but I'm telling the linker to add one anyway: one from an old wx3.0.3 static build. Its filepath is /home/david/devel/wxWidgets-3.0.3/udb3static/lib/libwxscintilla-3.0.a
So I've put '/home/david/devel/wxWidgets-3.0.3/udb3static/lib/' in the Libraries Search Path field, and tried different library names in the Libraries field.
Entering either wxscintilla-3.0.a or wxscintilla-3.0 built successfully,
Code: Select all
/usr/bin/g++ -o ../build-Debug/bin/StaticlibLinking @../build-Debug/StaticlibLinking/ObjectsList.txt -L. -L/home/david/devel/wxWidgets-3.0.3/udb3static/lib/ -lwxscintilla-3.0 -L/usr/lib/x86_64-linux-gnu -pthread -lwx_gtk2u_unofficial_xrc-3.1 -lwx_gtk2u_unofficial_html-3.1 -lwx_gtk2u_unofficial_qa-3.1 -lwx_gtk2u_unofficial_core-3.1 -lwx_baseu_unofficial_xml-3.1 -lwx_baseu_unofficial_net-3.1 -lwx_baseu_unofficial-3.1
What are the actual names of your two static libraries? And what do you call them in the Libraries field?
You do not have the required permissions to view the files attached to this post.
-
- CodeLite Curious
- Posts: 9
- Joined: Sun Jan 26, 2020 3:04 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: The project doesn't recognize libraries
What are the actual names of your two static libraries? And what do you call them in the Libraries field?
-
- CodeLite Plugin
- Posts: 819
- Joined: Wed Sep 03, 2008 7:26 pm
- Contact:
Re: The project doesn't recognize libraries
So they really are 'core' and 'file', rather than libcore, libfile (or libcore.a etc). As Jarod42 sensibly implied, it is normal for the name of a static lib to start with lib and end in .a.
Testing here, I renamed libwxscintilla-3.0.a to wxscintilla and put that in the 'Libaries' field. It failed to link, probably because the linker was automatically prepending 'lib'.
I suggest you rename the two static libraries as above, and try again.
Testing here, I renamed libwxscintilla-3.0.a to wxscintilla and put that in the 'Libaries' field. It failed to link, probably because the linker was automatically prepending 'lib'.
I suggest you rename the two static libraries as above, and try again.