Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » link libraries missing on link command ( no -l ) (can't get libraries to be linked. No -l option on command line)
link libraries missing on link command ( no -l ) [message #59441] Tue, 27 December 2022 13:59 Go to next message
polydev is currently offline  polydev
Messages: 1
Registered: December 2022
Junior Member
I am trying to build a simple SFML example.

So no UPP on this.

SFML is under D:\sfml and build of static libs are under D:\sfml\build\lib

Assembly is uppdev with only D:\upp;D:\sfml as nests.

I have a main package named lab01 under D:\upp\lab0

I have added D:\sfml\build\lib as lib path under build methods.
I have added sfml-window-s, sfml-main, sfml-graphics-s under project/Package Organizer ( tried with and without a when option )
I have added PROTOTYPE under project/Main Package Configuration.

Compilation is OK but link fails as the -l option with libraries names is missing. Only -L is present:
Here is build log :
---- lab01 ( PROTOTYPE MAIN CLANG DEBUG DEBUG_FULL BLITZ WIN32 )
cd D:\upp\lab01
lab01.cpp
c++ -c  -I"D:\upp" -I"D:\sfml" -I"D:\sfml\build\lib" -I"D:\sfml\include" -I"D:\sfml\examples\include" -I"D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype" -DflagPROTOTYPE -DflagMAIN -DflagCLANG -DflagDEBUG -DflagDEBUG_FULL -DflagBLITZ -DflagWIN32 -gcodeview -fno-limit-debug-info -g2 -static   -fexceptions -D_DEBUG  -x c++ -std=c++17 "D:\upp\lab01\lab01.cp
    p"  -o "D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o"
compiled in (0:00.01)
C:\tools\upp\bin/clang/bin\c++.exe -c  -I"D:\upp" -I"D:\sfml" -I"D:\sfml\build\lib" -I"D:\sfml\include" -I"D:\sfml\examples\include" -I"D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype" -DflagPROTOTYPE -DflagMAIN -DflagCLANG -DflagDEBUG -DflagDEBUG_FULL -DflagBLITZ -DflagWIN32 -gcodeview -fno-limit-debug-info -g2 -static   -fexceptions -D_DEBUG  -x c++ -s
    td=c++17 "D:\upp\lab01\lab01.cpp"  -o "D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o"
lab01: 1 file(s) built in (0:01.01), 1016 msecs / file
Linking...
c++ -static -mthreads -mconsole -o "D:\out\uppdev\CLANGx64.Debug.Debug_Full.Prototype\lab01.exe" -Wl,-pdb= -L"D:\sfml\build\lib" -Wl,--stack,20000000   "D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o" -Wl,--start-group  -Wl,--end-group
ld.lld: error: undefined symbol: __declspec(dllimport) sf::VideoMode::VideoMode(sf::Vector2<unsigned int> const&, unsigned int)
>>> referenced by D:\upp\lab01\lab01.cpp:33
>>>               D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o:(main)

ld.lld: error: undefined symbol: __declspec(dllimport) sf::String::String(char const*, std::__1::locale const&)
>>> referenced by D:\upp\lab01\lab01.cpp:33
>>>               D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o:(main)

ld.lld: error: undefined symbol: __declspec(dllimport) sf::Window::Window(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)
>>> referenced by D:\upp\lab01\lab01.cpp:33
>>>               D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o:(main)

ld.lld: error: undefined symbol: __declspec(dllimport) sf::Window::setActive(bool) const
>>> referenced by D:\upp\lab01\lab01.cpp:36
>>>               D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o:(main)

ld.lld: error: undefined symbol: __declspec(dllimport) sf::Window::~Window()
>>> referenced by D:\upp\lab01\lab01.cpp:188
>>>               D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o:(main)
>>> referenced by D:\upp\lab01\lab01.cpp:188
>>>               D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o:(main)

ld.lld: error: undefined symbol: __declspec(dllimport) sf::Context::getFunction(char const*)
>>> referenced by D:\upp\lab01\lab01.cpp:46
>>>               D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o:(main)

ld.lld: error: undefined symbol: __declspec(dllimport) sf::WindowBase::getSize() const
>>> referenced by D:\upp\lab01\lab01.cpp:66
>>>               D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o:(main)
>>> referenced by D:\upp\lab01\lab01.cpp:66
>>>               D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o:(main)
>>> referenced by D:\upp\lab01\lab01.cpp:71
>>>               D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o:(main)
>>> referenced 1 more times

ld.lld: error: undefined symbol: __declspec(dllimport) sf::Clock::Clock()
>>> referenced by D:\upp\lab01\lab01.cpp:138
>>>               D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o:(main)

ld.lld: error: undefined symbol: __declspec(dllimport) sf::WindowBase::isOpen() const
>>> referenced by D:\upp\lab01\lab01.cpp:141
>>>               D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o:(main)

ld.lld: error: undefined symbol: __declspec(dllimport) sf::WindowBase::pollEvent(sf::Event&)
>>> referenced by D:\upp\lab01\lab01.cpp:144
>>>               D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o:(main)

ld.lld: error: undefined symbol: __declspec(dllimport) sf::Window::close()
>>> referenced by D:\upp\lab01\lab01.cpp:148
>>>               D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o:(main)
>>> referenced by D:\upp\lab01\lab01.cpp:152
>>>               D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o:(main)

ld.lld: error: undefined symbol: __declspec(dllimport) sf::Clock::getElapsedTime() const
>>> referenced by D:\upp\lab01\lab01.cpp:176
>>>               D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o:(main)
>>> referenced by D:\upp\lab01\lab01.cpp:177
>>>               D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o:(main)
>>> referenced by D:\upp\lab01\lab01.cpp:178
>>>               D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o:(main)

ld.lld: error: undefined symbol: __declspec(dllimport) sf::Window::display()
>>> referenced by D:\upp\lab01\lab01.cpp:184
>>>               D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o:(main)
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
C:\tools\upp\bin/clang/bin\c++.exe -static -mthreads -mconsole -o "D:\out\uppdev\CLANGx64.Debug.Debug_Full.Prototype\lab01.exe" -Wl,-pdb= -L"D:\sfml\build\lib" -Wl,--stack,20000000   "D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o" -Wl,--start-group  -Wl,--end-group
Error executing C:\tools\upp\bin/clang/bin\c++.exe -static -mthreads -mconsole -o "D:\out\uppdev\CLANGx64.Debug.Debug_Full.Prototype\lab01.exe" -Wl,-pdb= -L"D:\sfml\build\lib" -Wl,--stack,20000000   "D:/out/uppdev/lab01/CLANGx64.Debug.Debug_Full.Main.Prototype\lab01.o" -Wl,--start-group  -Wl,--end-group
Exitcode: 1

There were errors. (0:01.12)

Also as a minor thing -Wl shows up twice one by itself and once in a --start-group .. --end-group contruct.
Thanks for help.
Paul

Re: link libraries missing on link command ( no -l ) [message #59527 is a reply to message #59441] Tue, 17 January 2023 11:30 Go to previous message
jjacksonRIAB is currently offline  jjacksonRIAB
Messages: 219
Registered: June 2011
Experienced Member
polydev wrote on Tue, 27 December 2022 13:59
I am trying to build a simple SFML example.
I have added sfml-window-s, sfml-main, sfml-graphics-s under project/Package Organizer ( tried with and without a when option )


Did you add them as "Libraries" or as "Static Libraries"? Also keep in mind that linker order is relevant so make sure you're linking your libs in the correct order or symbols may not be found.

sfml-audio, sfml-graphics, sfml-window, sfml-system.

SFML documentation also says you must define SFML_STATIC if you're using the static version.

Those __declspec(dllimport) sections suggest you may not have that defined but I'm not sure. You'll have to look at your SFML documentation.
Previous Topic: Assertion failed
Next Topic: how to update IDE?
Goto Forum:
  


Current Time: Fri Mar 29 05:51:44 CET 2024

Total time taken to generate the page: 0.01153 seconds