Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - bilbosz

Pages: [1]
1
General / Re: Problem with static linking
« on: January 09, 2018, 08:19:58 pm »
I've tried sorted topologically (according to https://www.sfml-dev.org/tutorials/2.4/start-vc.php)
find_package(SFML 2.4.1 REQUIRED system window graphics audio main network)
reversed
find_package(SFML 2.4.1 REQUIRED network main audio graphics window system)
was checking both with
target_link_libraries(${MAIN_TARGET} ${SFML_DEPENDENCIES} ${SFML_LIBRARIES})
and
target_link_libraries(${MAIN_TARGET} ${SFML_LIBRARIES} ${SFML_DEPENDENCIES})
regenerating build each time. If an order would be the reason then linker should complain about reference in the first or last targeted module, not the one in the middle. sf::priv::ImageLoader::writeJpg from ImageLoader.cpp belongs to graphics module. Are you sure order is the reason?

2
General / Re: Problem with static linking
« on: January 09, 2018, 06:56:54 pm »
I did as you said, it doesn't change linking message error.

CMakeLists.txt:
set(SFML_STATIC_LIBRARIES TRUE)
find_package(SFML 2.4.1 REQUIRED window audio graphics main network system)
if (SFML_FOUND)
    include_directories(${SFML_INCLUDE_DIR})
    target_link_libraries(${MAIN_TARGET} ${SFML_LIBRARIES} ${SFML_DEPENDENCIES})
endif()

Do you suggest any particular order?

3
General / Re: Problem with static linking
« on: January 09, 2018, 06:38:18 pm »
It didn't help.

4
General / Problem with static linking
« on: January 09, 2018, 05:08:34 pm »
Hi,

I've tried to move from Microsoft Visual Studio 2015 project to CMake. It's a team project so I wanted to make it portable and easy to build as possible. Static linking would be great because I can skip copying DLLs. I'm using 2.4.1 version of SFML. Here is interesting part of CMakeLists.txt:
set(SFML_STATIC_LIBRARIES TRUE)
find_package(SFML 2.4.1 REQUIRED audio graphics main network system window)
if (SFML_FOUND)
    include_directories(${SFML_INCLUDE_DIR})
    target_link_libraries(${MAIN_TARGET} ${SFML_DEPENDENCIES} ${SFML_LIBRARIES})
endif()
After building it, I'm getting linker messages:
Code: [Select]
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2019: unresolved external symbol _jpeg_std_error referenced in function "private: bool __thiscall sf::priv::ImageLoader::writeJpg(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::vector<unsigned char,class std::allocator<unsigned char> > const &,unsigned int,unsigned int)" (?writeJpg@ImageLoader@priv@sf@@AAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$vector@EV?$allocator@E@std@@@5@II@Z)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2019: unresolved external symbol _jpeg_CreateCompress referenced in function "private: bool __thiscall sf::priv::ImageLoader::writeJpg(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::vector<unsigned char,class std::allocator<unsigned char> > const &,unsigned int,unsigned int)" (?writeJpg@ImageLoader@priv@sf@@AAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$vector@EV?$allocator@E@std@@@5@II@Z)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2019: unresolved external symbol _jpeg_destroy_compress referenced in function "private: bool __thiscall sf::priv::ImageLoader::writeJpg(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::vector<unsigned char,class std::allocator<unsigned char> > const &,unsigned int,unsigned int)" (?writeJpg@ImageLoader@priv@sf@@AAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$vector@EV?$allocator@E@std@@@5@II@Z)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2019: unresolved external symbol _jpeg_stdio_dest referenced in function "private: bool __thiscall sf::priv::ImageLoader::writeJpg(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::vector<unsigned char,class std::allocator<unsigned char> > const &,unsigned int,unsigned int)" (?writeJpg@ImageLoader@priv@sf@@AAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$vector@EV?$allocator@E@std@@@5@II@Z)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2019: unresolved external symbol _jpeg_set_defaults referenced in function "private: bool __thiscall sf::priv::ImageLoader::writeJpg(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::vector<unsigned char,class std::allocator<unsigned char> > const &,unsigned int,unsigned int)" (?writeJpg@ImageLoader@priv@sf@@AAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$vector@EV?$allocator@E@std@@@5@II@Z)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2019: unresolved external symbol _jpeg_set_quality referenced in function "private: bool __thiscall sf::priv::ImageLoader::writeJpg(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::vector<unsigned char,class std::allocator<unsigned char> > const &,unsigned int,unsigned int)" (?writeJpg@ImageLoader@priv@sf@@AAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$vector@EV?$allocator@E@std@@@5@II@Z)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2019: unresolved external symbol _jpeg_start_compress referenced in function "private: bool __thiscall sf::priv::ImageLoader::writeJpg(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::vector<unsigned char,class std::allocator<unsigned char> > const &,unsigned int,unsigned int)" (?writeJpg@ImageLoader@priv@sf@@AAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$vector@EV?$allocator@E@std@@@5@II@Z)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2019: unresolved external symbol _jpeg_write_scanlines referenced in function "private: bool __thiscall sf::priv::ImageLoader::writeJpg(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::vector<unsigned char,class std::allocator<unsigned char> > const &,unsigned int,unsigned int)" (?writeJpg@ImageLoader@priv@sf@@AAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$vector@EV?$allocator@E@std@@@5@II@Z)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2019: unresolved external symbol _jpeg_finish_compress referenced in function "private: bool __thiscall sf::priv::ImageLoader::writeJpg(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::vector<unsigned char,class std::allocator<unsigned char> > const &,unsigned int,unsigned int)" (?writeJpg@ImageLoader@priv@sf@@AAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$vector@EV?$allocator@E@std@@@5@II@Z)
1>freetype.lib(bdf.obj) : error LNK2019: unresolved external symbol _sprintf referenced in function __bdf_parse_properties

In Visual Studio it looks as it should:
Linker - Additional Dependecies:
Code: [Select]
D:\Library\SFML-2.4.1\lib\sfml-audio-s.lib
D:\Library\SFML-2.4.1\lib\sfml-graphics-s.lib
D:\Library\SFML-2.4.1\lib\sfml-main.lib
D:\Library\SFML-2.4.1\lib\sfml-network-s.lib
D:\Library\SFML-2.4.1\lib\sfml-system-s.lib
D:\Library\SFML-2.4.1\lib\sfml-window-s.lib
D:\Library\SFML-2.4.1\lib\freetype.lib
opengl32.lib
winmm.lib
gdi32.lib
ws2_32.lib
D:\Library\SFML-2.4.1\lib\openal32.lib
D:\Library\SFML-2.4.1\lib\flac.lib
D:\Library\SFML-2.4.1\lib\vorbisenc.lib
D:\Library\SFML-2.4.1\lib\vorbisfile.lib
D:\Library\SFML-2.4.1\lib\vorbis.lib
D:\Library\SFML-2.4.1\lib\ogg.lib
There is preprocessor directive:
Code: [Select]
SFML_STATIC
Am I doing it right? Or should I add DLLs anyway.

Thanks

Pages: [1]
anything