OMNETPP compilation in Windows

Source: Internet
Author: User
1. Set msvc.
Choose> Tools> Custom)
Click the add-ins and macro files tab to check the OMNETPP option.
Return to the Command (commands) tab, and the category menu in the upper-left corner of the page will have more macro (macros) options.
Select the macro (macros) option to see the addnedfiletoproject macro,
Click the addnedfiletoproject macro and drag it to the toolbar,
Select a proper location, and click OK.
After completing the last two steps, you have set the VC environment.
2. Start from scratch.
1), create a project folder
2). Next, define *. Ned. Use a text tool or create a graph in omnet ++ Gend and set it. In the project folder.
3), start to build the project.
Copy. DSW and. DSP workspace to the project folder in the omnet installation directory/sample.
The purpose of copying work space is that the example work space has already set the compiler required for omnet compilation, linking the flag, tkenv/cmdenv parameters, and so on.
Click. DSW to enter the VC editing screen. After clearing the file name in (File View), you can start editing the new project.
4) start the project
First, add the *. Ned file to the project with the addnedfiletoproject macro set. The *. cpp file is automatically formed, open and edit it, and write the program.
5) compile the project
Click "open" in "start" -- "cmd"
Switch to the project directory in the DOS environment, and type opp_nmakemake-e CPP
The following prompt is displayed:
Opp_nmakemake: You have both. CC and. cpp files -- use-e cc or-e CPP option
Select which set of files to use
E:/work/programs/omnet/tictor> opp_nmakemake-e CPP
Creating makefile. VC in E:/work/programs/omnet/tictor...
Makefile. VC created.
Please type 'nmake-F makefile. VC depend' now to add dependencies!
Makefile. VC is successfully formed.
Type nmake-F makefile. VC and the output is as follows:
Microsoft (r) program maintenance utility version 6.00.8168.0
Copyright (c) Microsoft Corp 1988-1998. All rights reserved.
Cl.exe/nologo-C/ehs/ gr/FD/zm250/O2/dndebug/d_crt_secure_no_dep
Recate-ic:/omnet ++/include/TP titctor_n.cpp
Titctor_n.cpp
Link.exe/nologo/subsystem: console/OPT: Noref titctor_n.obj/libpath
: C:/omnet ++/lib envir. Lib tkenv. Lib tcl84.lib tk84.lib/libpath: "C:/omnet ++/lib"
Sim_std.lib nedxml. Lib libxml2.lib iconv. Lib wsock32.lib/out: tictor.exe
Creating library tictor. lib and object tictor. Exp
You will find the *. EXE file in the project folder.
But it is not complete yet.
6), set parameters
Write an OMNETPP. ini file in notepad and pass in the required parameters. For detailed operation code, see the omnet document.
7), run. The window is displayed. Select the parameter and run it. If you need to collect simulation data, you can set it in OMNETPP. ini to automatically generate *. VEC record file for statistics.
8) recompile the project
The old makefile. VC file exists in the compiled and outdated folders. You can type opp_nmakemake-F to forcibly override makefile. VC.
To clear outdated links before compilation, you can enter
Nmake makefile. VC clean can also use the menu/build/clean option in VC to clear outdated links.
Over.
Note: To make it easier to see the simulation results, you can switch the simulation to the tkenv environment using the following methods:
Menu/build/set active project configuration
Select XX-Win32 release tkenv from the four options
(But it is not successful yet. After compilation, it is executed in DOS)
There is another method, successful,
Select, set up, prepare, and delete the XX-Win32 release CMD files. The build file can be run on the graphic section.
Refer:
1. omnet ++ Manual
2. omnet/doc/Readme-MSVC.txt

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.