Basically, in Visual Studio, create a new project of type Win32 Console Application, and click "DLL" in the wizard. Uncheck the "Precompiled Header" and "Security Development Lifecycle (SDL) checks" boxes. This will open a new project containing a few empty documents. Add all
.cpp Files to the "Source Files" filter, and all
.h files to the "Header Files" filter. Then remove the files that Windows generated for you, they are not used.
If you click "Build", Visual Studio will generate a
libpedsim.lib and a
Such a solution file is located in the "msvc15" folder. If you have installed Visual Studio, double click
libpedsim.sln. Then, once the IDE has opened, use "Build Solution F7" from the menu. This will generate a folder called "x64" (on a 64bit system), with a subfolder called "Debug". In there are the compiled library files. Copy
libpedsim.lib into the
/pedsim/libpedsim/ folder (where the
.h files are).
Again, create a new Win32 Console Application project. This time, do not check he "DLL" box (still uncheck the others). I think the default is "Console Application" here; leave that as it is. Again, remove the auto-generated files, and add e.g. the file
Now here comes the tricky part. You have to specify the include and library directories. Go to "Project Properties Alt+F7". You probably have to select the item below the top item in the menu at the left. The first is the "solution", the second is the "project" which is what we need. Once opened, there is a window with "Configuration
Properties". Go to "VC++ Directories". Add the path to the libpedsim source files to the "Include Directories". This is where the
.h files are. Then, do the same with "Library Directories", where you add the path to the libpedsim.lib file generated while compiling libpedsim.
A bit further down should be a tab called "Linker", and "Input". There you have to add
libpedsim.lib to the list of libraries to include ("Additional Dependencies).
Now you should be able to build the example. Again, one sample project file is in the examples folder. Theoretically, it should be possible to open that using Visual Studio, and just click on "Build Solution
F7" to compile
Once you have generated the
example03.exe file, you need to copy the
libpedsim.dll file into that folder (next to the
.exe). This is because
libpedsim.dll is not installed in one of the system-wide folders.
2dvis is built on Qt. If you want to use all the features (especially charts), you need Qt 5.7 or above. It should be possible to compile it using an older version. However, you will not see the metrics charts in 2dvis then.
Download the latest version of Qt, and install it. I think you only need the msvc15 files, about 3.0 GB. I assume Visual Studio has been installed in the steps above. It is possible to use e.g. Cygwin, but that is beyond the scope of that short introduction.
Once Qt is installed, simply double click the
2dvis.pro file. This will open Qt Creator with the project loaded, where you can build
2dvis.exe. Before you can start the application, you need to copy various
Qt libraries into the same directory. Easiest is to just double click the
2dvis.exe file, and see what happens. These
qt5*d.dll libraries are somewhere in your Qt installation folder, located (probably) under
C:\Qt\...\bin. Once the required ones are there, start 2dvis using the command line:
Run 2dvis from the command line:
This starts a 2dvis that is listening on network port 2222 for incoming data (used by the Ped::UDPOutputWriter class of libpedsim in the examples).
(c) Christian Gloor [ c|h|g|l|o|o|r|@|s|i|l|m|a|r|i|l|.|o|r|g| ]