-
Notifications
You must be signed in to change notification settings - Fork 132
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 on Windows #163
Comments
Do you need a native build of Artery on Windows 10, or would a virtualised setup using Docker or Vagrant be suitable as well? I have no resources to actively maintain and test Artery on Windows; however, I am happy to include the necessary patches to make our build system compatible. For example, the run_artery.sh related errors are probably easy to fix, e.g. by omitting this script on Windows and/or when particular CMake generators are used. |
Dear Raphael, |
I am willing to support any efforts to get Artery running on Windows 10; however, I cannot take the lead on this topic because I rarely develop on Windows systems. |
Update: I managed to get rid of the errors what I had, and managed to generate with cmake. I had to omit run_artery.sh (I don't know if it will cause other problems for building the solution or not.) Also in the ROOT folder's CmakeLists.txt I added the line unset(CMAKE_IMPORT_LIBRARY_SUFFIX) which dealt with these types of errors:
If I try to cmake --build . I get the following:
I guess it can't run some exe files and some of the build will be missing, causing a lot of errors later. Update 2: If I use cmake-gui, I can set the omnet message compiler manually, so the build process will initialize it correctly. Unfortunatley I still get tons of warnings and errors.
I don't know if it generates a full log of this. But the console is running out, so I cant paste it here and I don't even want to because it is super long. (Most of the content are warnings btw) |
Have you built OMNeT++ with VC++ or with MinGW64 shipped with OMNeT++? |
With the shipped MinGW64. |
Then you have to build Artery and its dependencies with MinGW64 as well, instead of MSVC. As far as I know, you cannot mix C++ libraries built with MinGW64 and MSVC. |
Dear Raphael, I would like to use the asn1 CAM message structure from your vanetza project in omnet with veins_inet. (I wanted to use artery because of this.) I put every asn1 related files in my omnet project. I include the CAM.h in my VeinsInetSampleApplication.cc, so I can access the CAM structure and I can fill CAM fields with values. Then I would like to encode it with the der_encode_to_buffer() function. The problem is, that I get undefined reference error for the function. I tried to include a lot of things. I think it should be a compiler/linker problem, because omnet++ can see the function. I noticed that it won't make any obj files from .c files, maybe thats the problem? Something should be wrong with this C++ mixed with C thing, but as every header contains extern "C" {}, I think that should work. I also tried to include the complete vanetza pack to try something similar like what I found in the built artery (I managed to build it on a virtual linux mint.) I saw that you have a wrapper around this asn1 CAM structure (which is something like a black magic for me :) ) So I would be really happy if I could just simply generate the encoded CAM message by including the asn1 CAM. Sorry for bothering you with this. And if it should be at the vanetza project, then I can create a topic there. Here is a link to a picture of my error: https://imgur.com/a/uuNZwS4 |
You can copy the directories vanetza/asn1/support and vanetza/asn1/its to your project. These folders contain only code generated by asn1c based on the ASN.1 grammar, i.e. it is not specific to Vanetza. I ship these files with Vanetza because it can be quite cumbersome to generate the code correctly. |
I did that exactly. My problem is, that I don't know where can I set omnetpp's compiler (clang right now) to compile and link .c source files too. I added the its and support folders just under my project's src folder and put those folders in my projects makemake options in the include path -I under compile and under link tabs. In my out folder it doesn't create any of the folders with the .o files. My generated make file looks like this:
I think omnet++ just skips .c files. Workspace settings contain .c files as source files, so I don't really understand why it is not working. |
Hm, |
I tried that earlier, but it produces a tons of new errors like:
Fixing these errors in every .cc file would be a little painful :D |
Okay, so the asn1 generated code cannot be compiled with a C++ compiler. You could compile the asn1 stuff with a separate Makefile and link them to a "standalone" library. Then, you can instruct Edit: You may now understand why I am using CMake instead of |
I will try it. Yeah I definitely understand it :) I'm just really a newbie in the world of compilers. The amount of options and possibilities are really high for me right now :D Opening these makefiles make me feel like I'm reading a foreign language. |
Okay, so I created a makefile:
Which created the .o objects for me and the libasn1c.a library. I tried to add it to omnet++ with additional libraries to link (-l). I also tried to link with the created object files. I noticed, that the reqired .h files were appearing in the mingw environments include folder, so my code can recognize |
I think linking to a static library like libasn1c.a is the less cumbersome way to go: You don't have to worry about runtime paths to look up the library then. Your Makefile looks reasonable to me. |
I added the library path and the library itself in makemake options under compile tab Include directories and in Link tab Additional libraries to link with. and the modified one:
Edit: the makefile generating cmd: My makefile was using clang to create the library. And omnet++ uses clang++ is that a problem? |
Maybe it works with |
Okay I think it found it. Now I get some new errors (just in case if I didn't have enough of them :) ):
I found this: https://sourceforge.net/p/asn1c/discussion/357921/thread/de1dfec6/
Shall I just exclude the GeneralizedTime.c from the library build? I feel like it's a never ending error train what Im sitting on. |
Just try omitting GeneralizedTime.c then. Beware, there be dragons… |
Dragons like it was built without errors in Omnet++ now, but the simulation fails without any error message, just saying Simulation terminated with exit code: -1073741819 ? :D I will try to go in debug mode and find out what the hell is happening. If I just use the CAM_t I can assign values to anything it runs without a problem. When I call the encode function it crashes. EDIT: |
Hello @OrmandiTamas, how did you solve the -1073741819 error? AFAIK it is 0xC0000005 in hex which is an error Regards, |
Hello, unfortunatley I dont think you have the same problem. If I remember well, my issue was mainly related to OMNeT++ and not knowing how to use the CAM structure properly. Thats why I got the memory access violation errors. |
Thanks for quick response. I think the problem is not the same but the solution might be. I have found your paper about generating CAM messages directly and I think I will solve it as you did - fill in the CAM_t structure directly without using the Vanetza's wrapper classes. I might have been using the structures somehow incorrectly too. |
Dear @OrmandiTamas , |
Dear @adel0049 , you can use (ASN1C) to generate the CAM structure's C++ compatible C code from the ASN1 standard. However the source is also available in many places, so you can just download it directly (like this one). What I did, is that I built a static library ( .a format on windows) from the source files, that can be linked to the OMNeT++ project. Once it is done, you can just include the CAM.h in your application code. You can fill, encode and decode the created CAM structure. |
Dear all,
I'm trying to build artery in Windows 10 (unfortunatley I need Windows). I built and installed every required libraries and software. When I'm running cmake .. in the build directory, I get the following errors:
Did anybody install artery on Windows successfully? Can somebody help with this?
The text was updated successfully, but these errors were encountered: