Skip to content
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

Building Vanetza on Windows #128

Open
HpLightcorner opened this issue May 11, 2021 · 5 comments
Open

Building Vanetza on Windows #128

HpLightcorner opened this issue May 11, 2021 · 5 comments

Comments

@HpLightcorner
Copy link

Hi @riebl,
Linked to our discussion: riebl/artery#184

I am currently building Vanetza on Windows, I finally got everything to build except ASN1:

return asn__format_to_callback(cb, app_key,

It fails with:

[build] C:/_work/repos/artery/extern/vanetza/vanetza/asn1/support/INTEGER.c: In function 'INTEGER__dump':
[build] C:/_work/repos/artery/extern/vanetza/vanetza/asn1/support/INTEGER.c:156:9: error: expected ')' before 'PRIdMAX'
[build]   156 |      "%" ASN_PRIdMAX " (%s)", value, el->enum_name);
[build]       |         ^
[build]       |         )

It seems like a preprocessor error?
If I got it right, this should somehow be replaced to the correct formatting-string: "%" ASN_PRIdMAX " (%s)" - for this example this should be: %i (%s) - right?

@HpLightcorner
Copy link
Author

Found the issue... An include-statement was missing... I had to add #include <inttypes.h> to asn_system.h.
However, I fail to link with errors coming from GeneralizedTime.c.

There are a lot of preprocessor-defines present to distinguish between platforms, so I got the following questions now:

  • When defining for CYGWIN, I guess we can add MINGW32 here as well?
  • The code is using setenv and unsetenv, both seem to be missing on MSYS2/OMneT++ Windows environment. Any suggestions?

Quite hard to find the missing link without fully understanding the code. Also, I assume that I can Ingnore all those warnings like localtime_r is implemented via localtime(), which may be not thread-safe?

@riebl
Copy link
Owner

riebl commented May 11, 2021

I also think it is "safe" to ignore the warnings about thread safety.
The ASN.1 code is either generated by asn1c or skeleton code provided by asn1c, i.e. manual changes are likely to get overwritten at some point. If changes are necessary, I have to incorporate them into CMake to always get properly patched generated code.
Honestly speaking, I don't know if there are differences between CYGWIN and MINGW32.
Regarding the setenv and unsetenv issue: This code is not actively used by Vanetza. Any stub implementation doing nothing would be an acceptable workaround from my point of view.

@HpLightcorner
Copy link
Author

Hmm, fixing hat in CMake is then for sure necessary.
I will focus a few days on getting the CMake Package down before patching Vanzeta for Windows Builds adding stub implementation, but that should be an easy fix.

@khevessy
Copy link
Contributor

khevessy commented Oct 12, 2022

Hi @HpLightcorner,

I have some other issues building Vanetza on Windows. I am using MSVC, so you probably do not know, but as you also attempted this, did you by any chance come across similar issue? I have problems with CryptoPP library.
#169

Thanks,
Karel

@riebl
Copy link
Owner

riebl commented Oct 18, 2022

For Windows builds, I would try to use Conan for the build process. Handling all the library dependencies manually on Windows is no fun at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants