Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Cross-Platform Development - Best Practices?

Reply
Thread Tools

Cross-Platform Development - Best Practices?

 
 
Andreas Wenzke
Guest
Posts: n/a
 
      04-05-2010
So I've ditched the idea of implementing my own XML parser in the end.
Now I'm going to use TinyXML instead (unless you have a better suggestion):
http://www.grinninglizard.com/tinyxml/index.html

Now what would be the best way to integrate that into my project?
I could of course include the header and link against the library, but
how would I make sure my project would compile both under Linux and Windows?
The lecturer wants me to include a Makefile, whilst I want to use Visual
Studio for development.

I don't want to learn Autoconf for this - should I just include to
different Makefiles with a variable "TINYXML_LIB" pointing to different
library files (.lib and .a or whatever is the Linux file extension)?
Or should I somehow include the source in my project?
After all, a TinyXML comes with its own Makefile - but then again, how
would I include that in Visual Studio?

And what about the filesystem structure - I currently have something
like this:

My project
|
+---src
|
+---include
|
+---doc
|
+---data
|
+---bin

Should I add a new directory "lib"?
And if so, what would I put there, only the library or the header file
as well?

Thanks.
 
Reply With Quote
 
 
 
 
Andreas Wenzke
Guest
Posts: n/a
 
      04-05-2010
Leigh Johnston schrieb:
> If you want to keep things simple you could use a header file only XML
> library (no need to worry about makefiles and linking with libs then).


Any suggestion?
 
Reply With Quote
 
 
 
 
Andreas Wenzke
Guest
Posts: n/a
 
      04-05-2010
Christian Hackl schrieb:
> For your own code, the answer is: by testing your program with both
> compilers and by making sure that you disable all compiler extensions.
> For example, by invoking VC with /Za.
>
> Other than that, it depends on the libraries you use.


Assuming that linking against the library is enough:
Would you provide two Makefiles (one for CL and one for G++), or would
you use a different approach?

>> The lecturer wants me to include a Makefile, whilst I want to use Visual
>> Studio for development.

>
> The lecturer must tell you what you have to hand in when using a 3rd
> party library.
>
> If I was a lecturer, I would require students to hand in a copy of the
> library and to document exactly how to install and use it on the target
> platform.


Install? I don't want to install anything.
Also, I'm only talking about static linking.

> I would explicitly forbid integrating the library into the
> application project itself.


Ok.

> Your lecturer may handle things differently. Of course, this means an
> awful lot of trouble for the lecturer, which is why I'd except 3rd party
> libraries to be forbidden altogether in a beginner's course...


Third-party libraries are generally forbidden, but when he handed out
the assignment I asked whether integrating an XML parser was ok, he said
yes, adding that the integration effort would probably equal what would
have to be done if one wrote the parser by oneself.

> Questions about conversion of Visual Studio project files into Makefiles
> are off-topic here and should instead be posted to
> microsoft.public.vc.language.


I actually think automatic conversion would be overkill as I only have a
couple of files anyway.

> Before asking, however, you should be aware of the fact that Makefiles
> are not restricted to Linux and/or GCC. One can happily use Makefiles
> with VC on Windows.


I know, Microsoft even include their own make implementation, NMAKE.
 
Reply With Quote
 
Andrew Schetinin
Guest
Posts: n/a
 
      04-06-2010
Hi,

CMake is certainly a good choice for a cross-platform C/C++ project -
it saves a lot of unnecessary manual work.

A good cross-platform C++ library with abstractions for threads/file
system/IO is usually also very useful.

But for the learning purposes it would be useful to learn how to write
make files manually

Regards,

Andrew Schetinin
 
Reply With Quote
 
Jorgen Grahn
Guest
Posts: n/a
 
      04-06-2010
On Mon, 2010-04-05, Andreas Wenzke wrote:
> So I've ditched the idea of implementing my own XML parser in the end.
> Now I'm going to use TinyXML instead (unless you have a better suggestion):
> http://www.grinninglizard.com/tinyxml/index.html


Weren't you the guy who wasn't even allowed to use more than a
crippled subset of C++ because the lecturer wanted to focus on
algorithm design? What happened?

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
 
Reply With Quote
 
Jorgen Grahn
Guest
Posts: n/a
 
      04-10-2010
On Tue, 2010-04-06, Jorgen Grahn wrote:
> On Mon, 2010-04-05, Andreas Wenzke wrote:
>> So I've ditched the idea of implementing my own XML parser in the end.
>> Now I'm going to use TinyXML instead (unless you have a better suggestion):
>> http://www.grinninglizard.com/tinyxml/index.html

>
> Weren't you the guy who wasn't even allowed to use more than a
> crippled subset of C++ because the lecturer wanted to focus on
> algorithm design? What happened?


Already answered in Message-ID:
<4bb88894$0$6764$>

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Web Application development vs windows client development cabernet123@hotmail.com ASP .Net 0 11-17-2005 12:09 AM
enterprise application development versus traditional software development jrefactors@hotmail.com Java 2 01-15-2005 10:45 PM
enterprise application development versus traditional software development jrefactors@hotmail.com Java 5 01-15-2005 09:08 PM
development environment architecture for ASP.NET development team Akhlaq Khan ASP .Net 4 09-27-2004 01:33 PM
Re: Development best practices and knowing when to exercise control over development Kevin Spencer ASP .Net 2 08-06-2003 09:33 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57