Cafu visual studio solution?
Hi, I've just downloaded the Cafu source and built it, everything was ok; but where are the VC++ .vcproj and .sln files? Or is there a way to use SCons to generate them? Apart from using the VC++ (2008) compiler I would like to use the IDE too, and the debugger (even more important). Thanks for your support.
Re: Cafu visual studio solution?
Hi BRabbit,
welcome to the Cafu forums!![Welcome :welcome:](./images/smilies/welcome.gif)
The big advantage of SCons is that it allows us to build Cafu on all supported platforms with all supported compilers, without us having to address all those (very many, very different, and sometimes very weird) platform-specific build tools.
I've been considering switching to other build tools though in order to make building Cafu even simpler, such as Waf, Premake, CMake, etc., but so far I've never found the time to dig into them.
Especially the debugger can be used stand-alone with just the executable files; when it breaks, it will automatically show you the proper place in the code.
If you use the Express Edition of VC++, you may want to install WinDbg as a port-mortem (or "just-in-time") debugger, please see http://www.cafu.de/forum/viewtopic.php?p=3765#p3765 for more details.
welcome to the Cafu forums!
![Welcome :welcome:](./images/smilies/welcome.gif)
Unfortunately I don't know of a way to create .vcproj and .sln files from SCons (although that would certainly be very helpful).BRabbit wrote:Hi, I've just downloaded the Cafu source and built it, everything was ok; but where are the VC++ .vcproj and .sln files? Or is there a way to use SCons to generate them?
The big advantage of SCons is that it allows us to build Cafu on all supported platforms with all supported compilers, without us having to address all those (very many, very different, and sometimes very weird) platform-specific build tools.
I've been considering switching to other build tools though in order to make building Cafu even simpler, such as Waf, Premake, CMake, etc., but so far I've never found the time to dig into them.
I think you can do all that even without the .vcproj and .sln files - just open the related files in the IDE.Apart from using the VC++ (2008) compiler I would like to use the IDE too, and the debugger (even more important).
Especially the debugger can be used stand-alone with just the executable files; when it breaks, it will automatically show you the proper place in the code.
If you use the Express Edition of VC++, you may want to install WinDbg as a port-mortem (or "just-in-time") debugger, please see http://www.cafu.de/forum/viewtopic.php?p=3765#p3765 for more details.
Best regards,
Carsten
Carsten
Re: Cafu visual studio solution?
Just for completeness to the above post, and for future references:
Another build system candidate is gyp (and, less so, bakefile and qmake).
The most attractive ones seem to be waf, cmake and gyp, and there is a very insteresting thread about them at https://lists.webkit.org/pipermail/webk ... .html#8881
In essence, I think we should look into these and just try them out.
Another build system candidate is gyp (and, less so, bakefile and qmake).
The most attractive ones seem to be waf, cmake and gyp, and there is a very insteresting thread about them at https://lists.webkit.org/pipermail/webk ... .html#8881
In essence, I think we should look into these and just try them out.
Best regards,
Carsten
Carsten
Re: Cafu visual studio solution?
Well, i know it's against cross-platform code, but I managed to make a VC++ solution with all the Cafu code, and it was pretty straight, tough. I have built all the code with no problems, but when it comes to the linking...mm..well, i found the library dependencies looking at the SConscript file, which says -in a rather complicated manner- what libraries are used by each of Cafu program (let's say, CaWE, the Cafu executable itself, the DLLs). So i compiled, linked and ran CaWE using my Visual Studio solution.
Anyway, there are some parts, specifically right now the OpenGL12 Renderer library that I couldn't link and I receive those 'unresolved externals' and 'conflicts with other libraries' nasty errors. I know that it must be some missing libraries, but i'm pretty sure I'm using all the libraries at least defined in the SConscript file.
So, Carsten, I would like to know:
-Are every program and library in Cafu Unicode? (Maybe this is a problem with the character set)
-Could you post what are the libraries needed?
I'm gonna put here a zipped complete solution (with no source code, so you can add the lastest code from the tracker), because i know some people including me are really conformed with MSW-only builds and used to some VC (the IDE part) features, like find and replace, debugging breakpoints (you are right when you say I can debug my program by waiting for the error to appear, but sometimes that's not the case), etc.
Anyway, there are some parts, specifically right now the OpenGL12 Renderer library that I couldn't link and I receive those 'unresolved externals' and 'conflicts with other libraries' nasty errors. I know that it must be some missing libraries, but i'm pretty sure I'm using all the libraries at least defined in the SConscript file.
So, Carsten, I would like to know:
-Are every program and library in Cafu Unicode? (Maybe this is a problem with the character set)
-Could you post what are the libraries needed?
I'm gonna put here a zipped complete solution (with no source code, so you can add the lastest code from the tracker), because i know some people including me are really conformed with MSW-only builds and used to some VC (the IDE part) features, like find and replace, debugging breakpoints (you are right when you say I can debug my program by waiting for the error to appear, but sometimes that's not the case), etc.
Re: Cafu visual studio solution?
That's great to hear.BRabbit wrote:Well, i know it's against cross-platform code, but I managed to make a VC++ solution with all the Cafu code, and it was pretty straight, tough.
I've been investigating the above mentioned SCons alternatives, especially CMake, Premake and waf, but the big problem with all of them is that I have not yet found a way to make them build wxWidgets (as a part of the Cafu build process).
Nonetheless, if you'd manage to create e.g. a Premake4 (or CMake) script for Cafu, I'd be very interested in hearing about it!
Note that neither Cafu nor CaWE directly link to the Renderer or Sound DLLs. These DLLs are linked dynamically at run-time: there is no need to account for them at link time.Anyway, there are some parts, specifically right now the OpenGL12 Renderer library that I couldn't link and I receive those 'unresolved externals' and 'conflicts with other libraries' nasty errors. I know that it must be some missing libraries, but i'm pretty sure I'm using all the libraries at least defined in the SConscript file.
You essentially need the libraries mentioned at
http://trac.cafu.de/browser/cafu/trunk/ ... ev=174#L87
and for Cafu:
http://trac.cafu.de/browser/cafu/trunk/ ... v=174#L100
http://trac.cafu.de/browser/cafu/trunk/ ... v=174#L101
and for CaWE:
http://trac.cafu.de/browser/cafu/trunk/ ... v=174#L158
http://trac.cafu.de/browser/cafu/trunk/ ... v=174#L162
The source code files only use the lower 128 ASCII values, so they should be encoding agnostic. Cafu and CaWE both use some Unicode features, but that should not be a problem (especially not at the linking stage).So, Carsten, I would like to know:
-Are every program and library in Cafu Unicode? (Maybe this is a problem with the character set)
Well, you're on the right track, and the most complete and accurate description is in the two files that you already considered:-Could you post what are the libraries needed?
http://trac.cafu.de/browser/cafu/trunk/SConstruct
http://trac.cafu.de/browser/cafu/trunk/SConscript
(also mind the code beginning at http://trac.cafu.de/browser/cafu/trunk/ ... v=174#L305)
Yes, I'd be happy about that!I'm gonna put here a zipped complete solution (with no source code, so you can add the lastest code from the tracker),
![Smile :-)](./images/smilies/icon_smile.gif)
![Wink ;-)](./images/smilies/icon_wink.gif)
Best regards,
Carsten
Carsten
Re: Cafu visual studio solution?
Yes, that's true. The thing is that i was actually linking the DLL itself.Carsten wrote: Note that neither Cafu nor CaWE directly link to the Renderer or Sound DLLs. These DLLs are linked dynamically at run-time: there is no need to account for them at link time.
![Razz :P](./images/smilies/icon_razz.gif)
OMG!!Carsten wrote:
Yes, I'd be happy about that!(but a PreMake or CMake file would be even better
).
![Shocked :shock:](./images/smilies/icon_eek.gif)
![Shocked :shock:](./images/smilies/icon_eek.gif)
By Wikipedia:
"CMake takes script files named "CMakeLists.txt" as input. It can generate makefiles and projects for many platforms and IDEs including Unix, Windows, Mac OS X, MSVC, Cygwin, MinGW and XCode. The platform's native build tools are used for the actual building."
This is what we need! A cross-platform build system but using the platform's ide (Visual Studio, XCode).
So you are right, I better make the CMakeList than a VC solution. Posting it soon!
Re: Cafu visual studio solution?
BRabbit wrote:This is what we need! A cross-platform build system but using the platform's ide (Visual Studio, XCode).
![Cheesy Grin :cheesy:](./images/smilies/icon_cheesygrin.gif)
Note that there is also Premake: http://industriousone.com/premake
My preliminary and certainly incomplete check left me with the impression that CMake is more mature, has more features, larger user base, and probably is able to deal also with corner cases.
However, it is also poorly documented (I got the book!), and the custom macro language is somewhat unfortunate as well.
Premake4, in contrast, uses (just like Cafu) the very elegant Lua programming language for its input description, and the documentation is straightforward. I'm not sure though if it can examine the target system in Autotools-style, which seems to be required for building wxWidgets.
Probably the only definitive way to learn which one is better (for our purposes) is to try them both. I've not yet had the time to do so, but if you made a start, it would certainly be a huge help.
(And note that initially, it would be enough to build the applications, e.g. CaWE and Cafu. This would still depend on having the libs build in a prior step (using SCons), but it would be a good beginning nevertheless.)
Best regards,
Carsten
Carsten
Re: Cafu visual studio solution?
Premake seems to be even easier than CMake. Here's information about building wxWidgets with premake: http://wiki.wxwidgets.org/Premake4
Re: Cafu visual studio solution?
Unfortunately, this is a Premake example for building an application that uses wxWidgets.BRabbit wrote:Here's information about building wxWidgets with premake: http://wiki.wxwidgets.org/Premake4
It does not deal with building wxWidgets itself.
(The example is a good start, but ideally and eventually, we must be able to build wxWidgets itself with CMake or Premake as well.
![Wink ;-)](./images/smilies/icon_wink.gif)
Best regards,
Carsten
Carsten
-
- Posts:1
- Joined:2011-02-01, 14:53
Re: Cafu visual studio solution?
I'm a little new to this engine, and appear to be right for my purpose =).
I searched in forum and found this topic perfect for my question...
In a solution are needed: entry point (main, winmain, and so on...), files cpp and h (#include), libraries (link).
If i build a myself solution (with a standard entry point where attach all next, libraries and inclusions), where can i found all these needed?
Have BRabbit make that solution for Visual Studio? I hope XD
(I'm not so advanced in C++ programming XD)
I searched in forum and found this topic perfect for my question...
In a solution are needed: entry point (main, winmain, and so on...), files cpp and h (#include), libraries (link).
If i build a myself solution (with a standard entry point where attach all next, libraries and inclusions), where can i found all these needed?
Have BRabbit make that solution for Visual Studio? I hope XD
(I'm not so advanced in C++ programming XD)
Re: Cafu visual studio solution?
Hi Master Kira,
welcome to the Cafu forums!![Welcome :welcome:](./images/smilies/welcome.gif)
As outlined above, I'm still open to it, but is there any problem with using SCons?
I know it feels foreign at first, but it's simple and convenient, and solves the problem well (you can still use the VS IDE for editing the files etc.; optionally also see this post: http://www.cafu.de/forum/viewtopic.php?p=4271#p4271)
welcome to the Cafu forums!
![Welcome :welcome:](./images/smilies/welcome.gif)
The problem is that Cafu consists of many libraries (just look in subdirectoriesMaster Kira wrote:In a solution are needed: entry point (main, winmain, and so on...), files cpp and h (#include), libraries (link).
If i build a myself solution (with a standard entry point where attach all next, libraries and inclusions), where can i found all these needed?
Libs/
and ExtLibs/
), and many executables -- making a VS proj or sln file had to cover them all.As outlined above, I'm still open to it, but is there any problem with using SCons?
I know it feels foreign at first, but it's simple and convenient, and solves the problem well (you can still use the VS IDE for editing the files etc.; optionally also see this post: http://www.cafu.de/forum/viewtopic.php?p=4271#p4271)
Sorry, I don't know how far he got.Have BRabbit make that solution for Visual Studio? I hope XD
(I'm not so advanced in C++ programming XD)
Best regards,
Carsten
Carsten
Re: Cafu visual studio solution?
I created an Visual Studio Soloution for myself now.
It still uses scons to build but atleast it enables you to use Intellisense and you can use the Debugger more comfortably and ofc you can build directly from VC![Wink ;)](./images/smilies/icon_wink.gif)
I made it for win32 and VC9 (2008) so if you use a different version you need to update the debug paths for all projects and build options (Project->Settings->Configuration->Debugging->Command).
The archive needs to be unpacked to your Cafu root folder!
If you want you can add it to the SVN repository.
It still uses scons to build but atleast it enables you to use Intellisense and you can use the Debugger more comfortably and ofc you can build directly from VC
![Wink ;)](./images/smilies/icon_wink.gif)
I made it for win32 and VC9 (2008) so if you use a different version you need to update the debug paths for all projects and build options (Project->Settings->Configuration->Debugging->Command).
The archive needs to be unpacked to your Cafu root folder!
If you want you can add it to the SVN repository.
- Attachments
-
Cafu Engine VC9.rar
- (12.08KiB)Downloaded 484 times
Who is online
Users browsing this forum: No registered users and 39 guests