[Developers] Building Plug-ins for OpendTect with Microsoft Visual Studio 8.0
Ranojay Sen
ranojay.sen at dgbes.com
Tue Oct 20 12:30:46 CEST 2009
Dear All,
Last month we released OpendTect version 4.0 which is a major release till date.
This release comes with numerous new features in the field of Open Source
Seismic Interpretation system. The Windows version of the software now uses
Microsoft Visual Studio 8.0 for building the binaries instead of GCC compiler
from Cygwin. This brings some new tools and environments for plug-in developers
who wish to use Visual Studio to build their own Plug-ins for OpendTect 4.0.
This is a brief discussion for building Plug-ins for OpendTect with Microsoft
Visual Studio Ver 8.0
These are a few things that would help an OpendTect plugin developer
who wants to use MSVC for building his/her plugins:
To begin with the development, we first need to download the
developers package which is available at the download centre on our
website ( http://www.opendtect.org/index.php/download.html ). Now start
OpendTect and go to "Utilities->Tools -> Create Devel.Env...", this will
create a work directory (usually called 'ODWork'), and necessary files
and folders for your development environment. An environment variable
WORK has to be set to let the compiler find the header files and library
files for compiling the code. To do this, right-click on 'My Computer',
select 'Properties', 'Advanced' tab and click on the button 'Environment
variables'. Add a new variable WORK and set its value to the directory
created by the 'Create Devel Env' tool.
To build OpendTect Plugins with MSVC please refer to the
"Tutorial" solution file under the Plugins\msvc directory. The project
settings necessary to build OpendTect Plugins with MSVC are mentioned
here in brief. First we have to set the necessary header files needed by
our code; to do that go to Project settings, select "Additional Include
directories" and add include folders your code is dependent on, for e.g
if it is dependent on Basic then add "$(WORK)\include\Basic", similarly
add other folders as required. Now , it is time to add library path and
library files.To set up the library, go to project settings Linker
option, select "Additional Library Directories" and add
"$(WORK)\msvc\Win32\debug" or "$(WORK)\msvc\Win32\release" depending on
your build configuration. Also add the .lib files in the Linker->Input
Item -> "Additional Dependency" option, for e.g. if it is dependent on
Basic, then just type Basic.lib.
We are now almost done, just one option has to be set: as our code uses
plenty of function pointers, we have to add /vmg compiler command line
option in the project properties -> C\C++-> command line option.
I guess this is enough to start building plugins with MSVC, in case
you have any questions or further comments please do not hesitate to
contact me.
Regards
Ranojay
--
Ranojay Sen
dGB Earth Sciences - India
304, Gateway Plaza
Hiranandani Gardens, Powai
Mumbai-400076
India
Phone: +91 22 25704984
Mobile: +91 9930834087
More information about the Developers
mailing list