-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Compile Issue with OS Defines in VS Code #1481
Comments
here is a diff of changes that allowed me to successfully compile with tests enabled in windows. Probably not the best way to go about it but just to show it works... |
I have the following Preprocessor Definitions
|
You have to set it manually: https://code.visualstudio.com/docs/cpp/c-cpp-properties-schema-reference |
Ok so VS Code configuration thing, I guess! The extra compile guards could take away the need for that manual step if that's desirable in the future, but this makes sense to me. |
A bit late, but the Windows builds are run on AppVeyor: |
https://github.com/eclipse/paho.mqtt.c/blob/6b1e202a701ffcdaa277b5644ed291287a70a7aa/test/thread.c#L28
At first, trying to build on Windows 10 machine with OpenSSL variables passed in. Testing is enabled by default but would cause the build to fail at compile time. Probably should also check for
_WIN32
because I don't think_WINDOWS
was being defined. When I added it in manually to the CMakeLists.txt then it could successfully compile. I also tried alternatively adding checks to the test files to guard windows compilation better.I made changes to make the statements
#if !defined(_WINDOWS) && !defined(_WIN32) && !defined(_WIN64)
and#if defined(_WINDOWS) || defined(_WIN32) || defined(_WIN64)
which successfully compiled and ran the tests for me.Current work around is to skip it in my compilation with the command:
cmake -G "Unix Makefiles" -B build -DCMAKE_INSTALL_PREFIX=/ -DPAHO_BUILD_STATIC=TRUE -DPAHO_ENABLE_TESTING=FALSE -DPAHO_WITH_SSL=TRUE -DOPENSSL_ROOT_DIR="C:\Program Files\OpenSSL-Win64\"
then:
cmake --build build/ --target install
which worked as well.
The text was updated successfully, but these errors were encountered: