Setting up for Visual Studio 2008

Hello all,

I am looking to use the OpenCascade libraries along with Microsoft Visual Studio 2008 (not express) with Windows XP OS. (First Question - Is C++ my only options or our these libraries available in C# as well?)

I've looked over this website, the forums, and some of the documentation and this looks very promising for our project. The only problem is I am having a very difficult time getting things set up so I can test things out and move forward.

My first goal would be able to get the Tutorial example project to compile and run. From there I would have a nice base to play around and test somethings and be able to add and modify code from other examples.

So what I am asking for is if someone would be willing to take some time to talk me though this process step-by-step with a good amount of detail from the very beginning. Let's assume all I have is Microsoft Visual Studio 2008 installed and the OpenCascade libraries downloaded and ready to install. I've tried following various threads from these forums but always end up with a project that won't compile or link properly or some instruction that doesn't quite make enough sense for me to carry on with.

I've tried following http://www.opencascade.org/org/forum/thread_17331/ and a few other threads that I can not find again.

I think my main issue is setting up the system variables, and setting up visual stdio with all the proper dependencies, etc. What all do I need (Qt, Tix, Tlc, etc)?

I know I am asking a lot but if anyone is willing to help with the order of downloads and installs, and how to set up Visual Studio 2008 it would be greatly appreciated. I'll be checking this tread often (hopefully to look at replies) so if there are follow up questions I will try to provide timely answers. Also, if someone has successfully done this (be able to compile and run the tutorial or similar project using Visual Studio 2008), and used links or threads that were helpful to them, those could be provided. I've searched but it is possible I have missed some link that already explains this.

I thank you all in advance.

P Dolbey's picture
lanchfn21's picture

Thank you for the reply Pete.

I have run into my first issue while following the instructions from the provided link.

1. I have Visual Studio, the Microsoft .NET Framework, and the Microsoft Windows SDK.

2. I downloaded and installed the Java SE Development Kit Update 16. After doing that, I set a up the environment variable. (Variable = JAVAHOME, Value = C:\Java\jdk1.6.0_16)

3. I then downloaded and installed Tcl and Tk using the link provided. The exe I used was ActiveTcl8.5.7.1.291226-win32-ix86-threaded.exe. I installed that to C:\Tcl. I then followed the link provided and downloaded and installed Tix. I made sure to install that into C:\Tcl also. The exe I used was tix-8.2.0b1-setup.exe

4. This is where I encountered my first problem. Using the link provided I downloaded fltk. I used file fltk-1.3.x-r6916.tar.bz2. I unpacked and extracted the contents to a folder called C:\fltk-1.3.x-r6916

Following the steps, I navigated through the folders looking for a folder called "VC2005". C:\fltk-1.3.x.r6916\fltk-1.3.x.r6916\ide\vc2005 is where I found it.

In that folder was a file called fltk.sln. I opened that up and Visual Studio 2008 wanted to convert it. I went through the conversion process and no errors were reported (some warnings).

I then followed these instructions: "Load the FLTK solution in Visual Studio and go to Tools > Options > Projects and Solutions > VC++Directories and under "Show directories for:" select "Include files". Select the top directory listed and click the folder icon to insert a new line at the top; enter “D:\fltk-1.3.x-r6350\fltk-1.3.x-r6350”. Now select "Library files", select the top directory listed and click the folder icon to insert a new line at the top; enter “D:\fltk-1.3.x-r6350\fltk-1.3.x-r6350\lib”. Build the solution (F7) and start it (CONTROL-F5). If you are successful, CubeViewd should execute."

Once I went to Build the solution I was given a numerous amount of errors (767). "fatal error C1083: Cannot open include file 'cairo-win32.h': No Such file or directory", "cannot update program database...", etc. This leads me to believe there are a few more steps that must be done in Visual Studio so these files are "seen" or I am using the wrong project.

Any tips or suggestions on what I can do to get past this obstacle?

Thanks for the help.

GOURILLON's picture

Hi Tester. I just have the same problem as you... did you found out a solution ?

QbProg's picture

btw have you tryed the cmake based builder? At least for common libraries it works well! :)

GOURILLON's picture

Thank you very much for your answer Thomas.

In fact, cmake files does exist in my version of fltk, butI don't know how to use them... I looked at this adress to build up this web site: http://fltk.org/articles.php?L834+I0+T+P1+Q but in my version fltk-1.3.x-r7606, foo.cxx foo.cxx,ui.fl and callbacks.cxx don't exist I didn't succeed in finding them on the web.

here is what I've done until now to use open cascade6.3 with visual studio 2008:

I downloaded and installed (using these files):
-Visual Studio with SP1: (VS2008SP1FRAx1512965.iso)
-JAVA JDK (not JRE):(jdk-6u20-windows-i586.exe)
-Tcl, Tk and Tix:(ActiveTcl8.5.8.1.291945-win32-ix86-threaded.exe and tix-8.2.0b1-setup.exe)
-fltk:(fltk-1.3.x-r7606)
-Qt4.x.x(no pb with it)
-Microsoft .NET framework 2.0(I installed .NET framework 4.0: dotNetFx40_Full_setup.exe)
-Microsoft Windows SDK (version 6.1)

then I tried to build the fltk project for VS2005 that I found. I had about 200 errors, telling me that files were missing in my project: I downloaded and unpacked:
cairo-1.8.10.tar.gz
caro-dev_1.8.10-3_win32.zip
caro_1.8.10-3_win32.zip

then I added include source files to my project getting 100 errors

few files were missing, then I downloaded and added:
inactive.h
preferences.h
ratio.h
resize.h
tabs.h
valuators.h
fast_slow.h

with their correspondant cpp

now here is the error I got (in french):

1>------ Début de la génération : Projet : fltkdll, Configuration : Debug Cairo Win32 ------
2>------ Début de la génération : Projet : mandelbrot, Configuration : Debug Cairo Win32 ------
2>mandelbrot : warning PRJ0009 : Le journal de génération n'a pas pu être ouvert en écriture.
2>Assurez-vous que le fichier n'est pas ouvert par un autre processus et qu'il n'est pas protégé en écriture.
2>Édition des liens en cours...
1>Édition des liens en cours...
2>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual class Fl_Device * __thiscall Fl_Abstract_Printer::set_current(void)" (?set_current@Fl_Abstract_Printer@@UAEPAVFl_Device@@XZ)
2>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual int __thiscall Fl_Abstract_Printer::start_job(int,int *,int *)" (?start_job@Fl_Abstract_Printer@@UAEHHPAH0@Z)
2>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual int __thiscall Fl_Abstract_Printer::start_page(void)" (?start_page@Fl_Abstract_Printer@@UAEHXZ)
2>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual int __thiscall Fl_Abstract_Printer::printable_rect(int *,int *)" (?printable_rect@Fl_Abstract_Printer@@UAEHPAH0@Z)
2>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual void __thiscall Fl_Abstract_Printer::margins(int *,int *,int *,int *)" (?margins@Fl_Abstract_Printer@@UAEXPAH000@Z)
2>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual void __thiscall Fl_Abstract_Printer::origin(int,int)" (?origin@Fl_Abstract_Printer@@UAEXHH@Z)
2>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual void __thiscall Fl_Abstract_Printer::scale(float,float)" (?scale@Fl_Abstract_Printer@@UAEXMM@Z)
2>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual void __thiscall Fl_Abstract_Printer::rotate(float)" (?rotate@Fl_Abstract_Printer@@UAEXM@Z)
2>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual void __thiscall Fl_Abstract_Printer::translate(int,int)" (?translate@Fl_Abstract_Printer@@UAEXHH@Z)
2>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual void __thiscall Fl_Abstract_Printer::untranslate(void)" (?untranslate@Fl_Abstract_Printer@@UAEXXZ)
2>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual int __thiscall Fl_Abstract_Printer::end_page(void)" (?end_page@Fl_Abstract_Printer@@UAEHXZ)
2>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual void __thiscall Fl_Abstract_Printer::end_job(void)" (?end_job@Fl_Abstract_Printer@@UAEXXZ)
2>../../test/mandelbrotd.exe : fatal error LNK1120: 12 externes non résolus
1> Création de la bibliothèque ../../test/fltkdlld.lib et de l'objet ../../test/fltkdlld.exp
1>Fl_Printer.obj : error LNK2001: symbole externe non résolu "public: virtual class Fl_Device * __thiscall Fl_Abstract_Printer::set_current(void)" (?set_current@Fl_Abstract_Printer@@UAEPAVFl_Device@@XZ)
1>Fl_Printer.obj : error LNK2001: symbole externe non résolu "public: virtual int __thiscall Fl_Abstract_Printer::start_job(int,int *,int *)" (?start_job@Fl_Abstract_Printer@@UAEHHPAH0@Z)
1>Fl_Printer.obj : error LNK2001: symbole externe non résolu "public: virtual int __thiscall Fl_Abstract_Printer::start_page(void)" (?start_page@Fl_Abstract_Printer@@UAEHXZ)
1>Fl_Printer.obj : error LNK2001: symbole externe non résolu "public: virtual int __thiscall Fl_Abstract_Printer::printable_rect(int *,int *)" (?printable_rect@Fl_Abstract_Printer@@UAEHPAH0@Z)
1>Fl_Printer.obj : error LNK2001: symbole externe non résolu "public: virtual void __thiscall Fl_Abstract_Printer::margins(int *,int *,int *,int *)" (?margins@Fl_Abstract_Printer@@UAEXPAH000@Z)
1>Fl_Printer.obj : error LNK2001: symbole externe non résolu "public: virtual void __thiscall Fl_Abstract_Printer::origin(int,int)" (?origin@Fl_Abstract_Printer@@UAEXHH@Z)
1>Fl_Printer.obj : error LNK2001: symbole externe non résolu "public: virtual void __thiscall Fl_Abstract_Printer::scale(float,float)" (?scale@Fl_Abstract_Printer@@UAEXMM@Z)
1>Fl_Printer.obj : error LNK2001: symbole externe non résolu "public: virtual void __thiscall Fl_Abstract_Printer::rotate(float)" (?rotate@Fl_Abstract_Printer@@UAEXM@Z)
1>Fl_Printer.obj : error LNK2001: symbole externe non résolu "public: virtual void __thiscall Fl_Abstract_Printer::translate(int,int)" (?translate@Fl_Abstract_Printer@@UAEXHH@Z)
1>Fl_Printer.obj : error LNK2001: symbole externe non résolu "public: virtual void __thiscall Fl_Abstract_Printer::untranslate(void)" (?untranslate@Fl_Abstract_Printer@@UAEXXZ)
1>Fl_Printer.obj : error LNK2001: symbole externe non résolu "public: virtual int __thiscall Fl_Abstract_Printer::end_page(void)" (?end_page@Fl_Abstract_Printer@@UAEHXZ)
1>Fl_Printer.obj : error LNK2001: symbole externe non résolu "public: virtual void __thiscall Fl_Abstract_Printer::end_job(void)" (?end_job@Fl_Abstract_Printer@@UAEXXZ)
1>../../test/fltkdlld.dll : fatal error LNK1120: 12 externes non résolus
2>Le journal de génération a été enregistré à l'emplacement "file://c:\fltk-1.3.x-r7606\fltk-1.3.x-r7606\ide\vc2005\Debug Cairo\BuildLog.htm"
2>mandelbrot - 13 erreur(s), 1 avertissement(s)
1>Le journal de génération a été enregistré à l'emplacement "file://c:\fltk-1.3.x-r7606\fltk-1.3.x-r7606\ide\vc2005\Debug Cairo\BuildLog.htm"
1>fltkdll - 13 erreur(s), 0 avertissement(s)
3>------ Début de la génération : Projet : editor, Configuration : Debug Cairo Win32 ------
4>------ Début de la génération : Projet : cube, Configuration : Debug Cairo Win32 ------
4>cube : warning PRJ0009 : Le journal de génération n'a pas pu être ouvert en écriture.
4>Assurez-vous que le fichier n'est pas ouvert par un autre processus et qu'il n'est pas protégé en écriture.
3>Édition des liens en cours...
4>Édition des liens en cours...
3>editor.obj : error LNK2019: symbole externe non résolu "public: char const * __thiscall Fl_Native_File_Chooser::filename(void)const " (?filename@Fl_Native_File_Chooser@@QBEPBDXZ) référencé dans la fonction "void __cdecl open_cb(class Fl_Widget *,void *)" (?open_cb@@YAXPAVFl_Widget@@PAX@Z)
3>editor.obj : error LNK2019: symbole externe non résolu "public: __thiscall Fl_Native_File_Chooser::~Fl_Native_File_Chooser(void)" (??1Fl_Native_File_Chooser@@QAE@XZ) référencé dans la fonction "void __cdecl open_cb(class Fl_Widget *,void *)" (?open_cb@@YAXPAVFl_Widget@@PAX@Z)
3>editor.obj : error LNK2019: symbole externe non résolu "public: int __thiscall Fl_Native_File_Chooser::show(void)" (?show@Fl_Native_File_Chooser@@QAEHXZ) référencé dans la fonction "void __cdecl open_cb(class Fl_Widget *,void *)" (?open_cb@@YAXPAVFl_Widget@@PAX@Z)
3>editor.obj : error LNK2019: symbole externe non résolu "public: void __thiscall Fl_Native_File_Chooser::type(int)" (?type@Fl_Native_File_Chooser@@QAEXH@Z) référencé dans la fonction "void __cdecl open_cb(class Fl_Widget *,void *)" (?open_cb@@YAXPAVFl_Widget@@PAX@Z)
3>editor.obj : error LNK2019: symbole externe non résolu "public: void __thiscall Fl_Native_File_Chooser::title(char const *)" (?title@Fl_Native_File_Chooser@@QAEXPBD@Z) référencé dans la fonction "void __cdecl open_cb(class Fl_Widget *,void *)" (?open_cb@@YAXPAVFl_Widget@@PAX@Z)
3>editor.obj : error LNK2019: symbole externe non résolu "public: __thiscall Fl_Native_File_Chooser::Fl_Native_File_Chooser(int)" (??0Fl_Native_File_Chooser@@QAE@H@Z) référencé dans la fonction "void __cdecl open_cb(class Fl_Widget *,void *)" (?open_cb@@YAXPAVFl_Widget@@PAX@Z)
3>../../test/editord.exe : fatal error LNK1120: 6 externes non résolus
3>Le journal de génération a été enregistré à l'emplacement "file://c:\fltk-1.3.x-r7606\fltk-1.3.x-r7606\ide\vc2005\Debug Cairo\BuildLog.htm"
3>editor - 7 erreur(s), 0 avertissement(s)
4>cube.obj : error LNK2019: symbole externe non résolu "public: void __thiscall Fl_Abstract_Printer::print_widget(class Fl_Widget *,int,int)" (?print_widget@Fl_Abstract_Printer@@QAEXPAVFl_Widget@@HH@Z) référencé dans la fonction "void __cdecl print_cb(class Fl_Widget *,void *)" (?print_cb@@YAXPAVFl_Widget@@PAX@Z)
4>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual class Fl_Device * __thiscall Fl_Abstract_Printer::set_current(void)" (?set_current@Fl_Abstract_Printer@@UAEPAVFl_Device@@XZ)
4>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual int __thiscall Fl_Abstract_Printer::start_job(int,int *,int *)" (?start_job@Fl_Abstract_Printer@@UAEHHPAH0@Z)
4>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual int __thiscall Fl_Abstract_Printer::start_page(void)" (?start_page@Fl_Abstract_Printer@@UAEHXZ)
4>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual int __thiscall Fl_Abstract_Printer::printable_rect(int *,int *)" (?printable_rect@Fl_Abstract_Printer@@UAEHPAH0@Z)
4>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual void __thiscall Fl_Abstract_Printer::margins(int *,int *,int *,int *)" (?margins@Fl_Abstract_Printer@@UAEXPAH000@Z)
4>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual void __thiscall Fl_Abstract_Printer::origin(int,int)" (?origin@Fl_Abstract_Printer@@UAEXHH@Z)
4>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual void __thiscall Fl_Abstract_Printer::scale(float,float)" (?scale@Fl_Abstract_Printer@@UAEXMM@Z)
4>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual void __thiscall Fl_Abstract_Printer::rotate(float)" (?rotate@Fl_Abstract_Printer@@UAEXM@Z)
4>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual void __thiscall Fl_Abstract_Printer::translate(int,int)" (?translate@Fl_Abstract_Printer@@UAEXHH@Z)
4>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual void __thiscall Fl_Abstract_Printer::untranslate(void)" (?untranslate@Fl_Abstract_Printer@@UAEXXZ)
4>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual int __thiscall Fl_Abstract_Printer::end_page(void)" (?end_page@Fl_Abstract_Printer@@UAEHXZ)
4>fltkd.lib(Fl_Printer.obj) : error LNK2001: symbole externe non résolu "public: virtual void __thiscall Fl_Abstract_Printer::end_job(void)" (?end_job@Fl_Abstract_Printer@@UAEXXZ)
4>../../test/cubed.exe : fatal error LNK1120: 13 externes non résolus
4>Le journal de génération a été enregistré à l'emplacement "file://c:\fltk-1.3.x-r7606\fltk-1.3.x-r7606\ide\vc2005\Debug Cairo\BuildLog.htm"
4>cube - 14 erreur(s), 1 avertissement(s)
5>------ Début de la génération : Projet : demo, Configuration : Debug Cairo Win32 ------
5>Édition des liens en cours...
5>Incorporation du manifeste en cours...
5>Le journal de génération a été enregistré à l'emplacement "file://c:\fltk-1.3.x-r7606\fltk-1.3.x-r7606\ide\vc2005\Debug Cairo\BuildLog.htm"
5>demo - 0 erreur(s), 0 avertissement(s)
========== Génération : 1 a réussi, 4 a échoué, 70 mis à jour, 0 a été ignoré ==========

Can you tell me how I can built it with files I've got ?

thank you

FR

GOURILLON's picture

I found this tutorial:
http://blog.csdn.net/itroy/archive/2009/01/16/3795862.aspx

in fact, I think the fltk version i chose was too high to be compiled on my VS2008. I took fltk-1.1.10-source.tar.bz2 I it ran well !

thank you all