-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[log4cplus] Linking error #6775
Comments
Probably due to |
Nope, sorry, didn't work... |
What I mean is that log4cplus is setting CMAKE_CXX_STANDARD so you must set your CMAKE_CXX_STANDARD to the same value. |
I see what you mean. I installed log4cplus as a vcpkg, so I don't have direct control. I checked the CMakeLists.txt of log4cplus however and it is indeed set to CMAKE_CXX_STANDARD 17, and I modified it in my CMakeLists.txt to match. To no avail, unfortunately. |
build logs also tell me that |
Thanks for your help, but unfortutely still not working. Installed the x64-windows-static variant and modified my CMakeLists.txt:
But still the same stuff:
I also find it weird that I have no problems when I start a new clean Visual Studio project. Then it works. It's just when I use CMake it gives the linker errors. |
Missing?
also:
That means it is missing some library to link to but that also what the error says. In VS the whole lib folder gets linked into the project. Could you check the link command if the required linked libraries are added? |
That is just a warning on the usage of log4cplus on Windows, would cause problems when running, but not during compiling/linking. With respect to the link command. It seems fine (the library file also exists):
Also tried to see what the workign VS solution looked like, but couldn't figure out where that gets the libary from. It's a system wide thing it seems. The solution generated by CMake is definetly different, also when I look at it in Visual Studio. |
Found something else by looking at the error and the exported symbols from the library. From the error: And from the library:
The difference between the two being something with the basic_string@_WU and basic_string@DU and other string related things. Is this some compiler options that's set in VS? |
After looking at the log4cplus macro defintions, I found in tchar.h that that is typedef'd to either char or wchar_t depending on whether UNICODE is defined. After defining UNICODE in my main.cpp, the linker succeeds. |
@yuggieg: That means that the log4cplus target is not correctly setup to provide the required compiler definitions/flags for downstream targets. Maybe report that upstream? |
@Neumann-A yeah, I'll report it to the log4cplus guys. Thanks for your help! |
Hi @yuggieg, thanks for reporting this issue! Thanks. |
I'm still getting errors with log4cplus 2.1.1
I had to specify {
"name": "log4cplus",
"features": ["unicode"]
} Sharing to help others. |
cc @Cheney-W to confirm whether this issue still exist. |
I have issues linking against the log4plus library on Windows, x64, running visual studio 2017.
When using the following main.cpp:
and the accompanying CMakeListst.txt:
Running CMake as follows:
cmake -G "Visual Studio 15 2017 Win64" ..
And building:
cmake --build . --config Release
Give the following linking error:
Any ideas? I also use the cpprestsdk vcpkg and that is not giving me any problems. When creating a new project in Visual Studio and using that instead of CMake, it also works.
The text was updated successfully, but these errors were encountered: