Comments (5)
In the end I was able to solve it changing the content of the Math.h file like this:
#include <cmath>
#if defined(_WIN32) || defined(_WIN64)
#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#endif
@Framstag I could create a PR so if you consider it is worthy and there is no other solution, maybe you could add it to master,
Thanks
from libosmscout.
The clean solution would be to use https://en.cppreference.com/w/cpp/numeric/constants - but we are not yet C++20 :-(
For our builds we set the define via compiler options (take a look at meson.build for example). So this is fixed a cenral place. Would this solution possible for you, too?
from libosmscout.
I'm actually using CMake, and I can see the macro definition is included in the CMakelist of this project. The compilation of the library for windows is done as follows:
if not exist "%LIBOSMSCOUT_SOURCE_PATH%" git clone %LIBOSMSCOUT_REPO% %LIBOSMSCOUT_SOURCE_PATH%
if not exist "%LIBOSMSCOUT_VSPROJECT_PATH%" mkdir "%LIBOSMSCOUT_VSPROJECT_PATH%"
cd "%LIBOSMSCOUT_VSPROJECT_PATH%"
cmake -G "Visual Studio 16 2019"^
-DCMAKE_INSTALL_PREFIX="%DEPENDENCIES_INSTALLATION_PATH:\=/%"^
-DCMAKE_CXX_FLAGS_RELEASE="/EHsc"^
-DOSMSCOUT_BUILD_TOOL_STYLEEDITOR=OFF^
-DOSMSCOUT_BUILD_TOOL_OSMSCOUT2=OFF^
-DOSMSCOUT_BUILD_TESTS=OFF^
-DOSMSCOUT_BUILD_CLIENT_QT=OFF^
-DOSMSCOUT_BUILD_DEMOS=OFF^
"%LIBOSMSCOUT_SOURCE_PATH%"
cmake --build . --config=Release --target install
This process is done correctly. The library get installs in my project, however, after that, when compiling my project itself, some lines below in the .bat file. So far, everything seems to be configured correctly, but the error is still comming up, as far as I don't include the lines stated in the previuos comment. I'm sure there is something I'm doing in the worng way or missing something...
Thank you so much for your quick reply!
from libosmscout.
The relevant code for libosmscout is in the CMakeList.txt in the root directory in line 154
add_definitions(-D_USE_MATH_DEFINES)
It is possible, that you add this you build, too?
from libosmscout.
Finally solved. As you mentioned, I had to add add_definitions(-D_USE_MATH_DEFINES)
to my CMake file as I was including the math.h header indirectly within my project, so my project needed the _USE_MATH_DEFINES
macro to be activated.
Thanks.
from libosmscout.
Related Issues (20)
- Why so many build techs? HOT 2
- BoundingBox of imported database too big HOT 6
- What about make Qt 6 the default in CMakelists.txt? HOT 6
- Importing data into an existing database / merging databases HOT 8
- Bounding box and Speed HOT 2
- PlaneMapRenderer redraws map only on center change, not on zoom change HOT 1
- Rendering Maldives lags libosmscout and gives a lot font errors HOT 8
- Rendering way of type "_route" is masked by bridges HOT 6
- Implementing a tile server via libosmcout HOT 7
- Layer rendering issues with tile rendering HOT 1
- Lots of "Warning: Unknown type" HOT 18
- Question regarding RoutingDatabase::GetRouteNodes() HOT 2
- Way missing in MapService query HOT 5
- `MapService::LoadMissingTileData()` produces more data than expected HOT 7
- Missing forest near Swedish national park Muddus HOT 1
- Compilation issues for iOS and XCode 15 HOT 5
- Add libosmscout to Taginfo Projects HOT 2
- Searching for "Zbraslavice 255" in Czechia give no results, but "Zbraslavice Zbraslavice 255" yes
- Compilation error for libosmscout-client on MacOS HOT 3
- Build fails because Config.h isn't installed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libosmscout.