Hello. :D

I've been working on a project for couple months now, on Linux.
When I invited a new team member, of course he came with his Windows.

I want to hear your opinion on how to make the development easy cross platform. Usually I would just tell him to write a code which works, but since he's not very skilled he needs to be able to compile to check for errors.

Our IDE is NetBeans which is available both on Linux and on Windows.

I heard of CMake, but the configuration files seems as quite a work to set up. It is only two developers in a private project, not a big open source project.

Also I might be interested in setting up a build server if that could be any use, although I'm not completely sure how good that is in this case - never used one before.

Thoughts? :)

NetBeans are we talking Java... ?

Most c++ code is platform independentant and linux implementations normally include use of codes that will work on both windows and linux, so this should be the end goal. That way the windows will be a bit harder but give you what you want in the long run.

Next general programming rules should be your ally here:

Sit down and work out what objects, classes and functions you need.

Some of the classes will e stand alone.
If you start off designing the .h files then you know what methods are available to the rest of your code

Then you each go off and write a separate area say one person does for example:
string_helper.cpp
and the other
number_helper.cpp

Then rather than test the whole project at once you should write a small test class:
test_string_helper.cpp
and then in a separate project check that there are no mistakes in the new code.
Then you can integrate the code together easily

there are open source - source control equivalent to source safe that allow project management but for two of you for a project that is only a couple of months old this is less important just make sure that you keep each other informed.

To build the project on windows - if it is c++ it should be relatively easy using Visual studio express - the danger is that the easy solutions in windows use code that won't work on a linux machine.

But you want to have the source files on both machines and build the project to work. Even if for now you have some classes that have a windows and linux version this is not critical as long as your objects and classes are well designed.

Similarly there is little point in using the same IDE on cross platforms if your compiled source code still does not work out the same. But you might want to put warnings on their highest level.

Hi, thanks for replying.
We are already using SVN for versioning.

NetBeans is excellent for C++, with the C/C++ plugin.
The reason we both use NetBeans is because we both prefer NetBeans over any other IDE.

I would be happy if it was so easy just to copy it over in a test project, but unfortunately it is a game project with ten-thousands of lines of code.

Only a few of our simplest classes are not dependent on other classes.

For the final release it is obvious to me, that with a little push it shouldn't be hard to get a Windows version compiled. But now I have to figure a way for optimal and fast development cross platform.

We have 10 dependency libraries all cross platform and compiled on Windows, yet we didn't succeed at having MinGW compile them.
I suppose it of course is possible to have MinGW compile, but it seems like a lot of work, just to do some work on another PC.

there are several issues that you are bringing-up which are not familiar to me. I have never used minGW. The only other option I can think of is to have a remote logon to the same computer so that the compiling is done for the same platform though again this is something that I have never set-up cross OS.

With the import libraries/dlls there obviously are going to be issues to be resolved but the purpose of a class is not necessarily going to be dependent upon its base classes. You can use simple interface versions of the .h to be switched over once the class is compiled and written.

You will not want to copy projects across just the source code. Now there will be code that will be identical irrespective of windows/linux.

- clearly you need to have a solution that can build on both platforms but this does not need to be the code you use on both systems.

Have a windows version and linux version of files for any specific code such as creating a window. The other files you can put in folders to be copied and SVN

Then you can integrate the code on the linux version to test that it builds with the dependencies added in.

So tell me if I get you right:
You suggest each of us two developers set up our own projects on our respective platform, and yet use the shared source code?

At least that is an easy solution. It's just a lot of work if I were on some other computer.

The remote login thing sounds like something that could be done with a build server. Maybe I should try that out, that'd be a new experience.

Well I'm glad you came with your opinion.

Did you use g++ as the compiler on *nix with NetBeans IDE? If you did, then MinGW is the MS-Windows port of that *nix compiler. Even so, your program may need some tweaking in order to get it to compile with MinGW.

What windowing GUI engine did you use in your program? If you used something cross-platform like wxWidgets then you should have few problems porting to Windows.

Well my dependencies are cross platform.
The only actual problem I've had compiling the project under windows was having MinGW link my .lib/.dll's.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.