-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUILD_SHARED_LIBS & POCO_STATIC cause #pragma comment(lib, "PocoUtil" POCO_LIB_SUFFIX) to be invalid #4754
Comments
Dear Matejk, |
Ok I just tested and the behaviour is the same. The linker is still asking for 'PocoFoundation.lib' and not 'PocoFoundationmd.lib' Can you clarify one point: |
So, if I understand correctly, you
Is this correct? |
not sure what you mean exactly by "Poco CMake files", I
and:
But the target link library configuration seems useless for Poco due to It has to be noted that currently I have fixed the linker issue defining POCO_STATIC in my project build configuration (not in POCO build where I use BUILD_SHARED_LIBS=OFF). |
@athaa, when installing Poco after compiling it creates CMake files that you shall use in your project to use Poco with CMake using find_package like:
Poco CMake files are generated according to the specified configuration, including If compiling and linking using this way doesn't work properly then we shall investigate the cause. |
Hello Poco Team,
Describe the bug
The visual studio compiler/linker ask for Foundation.lib instead of Foundationmd.lib
To Reproduce
I build poco from source, as static, with cmake, using BUILD_SHARED_LIBS =OFF. I keep MT=OFF (to use system/compiler dll).
I got files ending with md.lib and mdd.lib => this is what I expected
I add lib and include dependencies to my project (visual studio) using cmake
I add
#include "Foundation.h"
in the main
call compiler OK
call linker NOT OK
Expected behavior
The linker shoud ask for PocoFoundationmd.lib, not for :
Logs
Please add relevant environment information:
Additional context
From what I can see it is due to the check performed in Foundation.h
It cause the following:
#pragma comment(lib, "PocoUtil" POCO_LIB_SUFFIX)
To be invalid (and all similar #pragma) since POCO_LIB_SUFFIX is created using POCO_DLL.
I supposed it should not use POCO_STATIC here because it is deprecated according the cmakefile:
message(WARNING "POCO_STATIC has been deprecated. Please use BUILD_SHARED_LIBS=NO to build static libraries.")
, but use BUILD_SHARED_LIBS (or a combination of both until complete removal)
BTW, I know the documentation :https://docs.pocoproject.org/current/99150-WindowsPlatformNotes.html
ask to use POCO_STATIC, but I guess the code is supposed to be more up to date. I'm right ?
Sorry if I miss something obvious.
Thanks by advance,
Have a good day
The text was updated successfully, but these errors were encountered: