Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (601)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Does Visual C++ run on multiple platforms?  (Read 1187 times)
0 Members and 1 Guest are viewing this topic.
Offline CogWheelz
« Posted 2014-08-04 22:40:58 »

Today I filled in certain gaps in my java knowledge. I wanted to start using C++ since c# is a microsoft only language. I really like how Visual stuidios looks compared to other compilers but I'm seeing that it wont compile on a mac or linux. I did some reading that it wont compile on mac, but if I code somthing in Visual studios and export the project, will it work on all platforms(windows, mac, linux)?
Offline BurntPizza

« JGO Bitwise Duke »


Medals: 289
Exp: 5 years



« Reply #1 - Posted 2014-08-04 22:45:13 »

You know, you can get answers much faster on google.

http://stackoverflow.com/a/6556122/3517265
Offline princec

« JGO Spiffy Duke »


Medals: 433
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #2 - Posted 2014-08-04 22:51:50 »

Today I filled in certain gaps in my java knowledge. I wanted to start using C++ since c# is a microsoft only language.
C# has been an "open" language for years now (see Mono).

Cas Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline CogWheelz
« Reply #3 - Posted 2014-08-04 23:06:02 »

You know, you can get answers much faster on google.

http://stackoverflow.com/a/6556122/3517265

I did  Undecided , I just didn't find the answer I was looking for.




Today I filled in certain gaps in my java knowledge. I wanted to start using C++ since c# is a microsoft only language.
C# has been an "open" language for years now (see Mono).

Cas Smiley

I know about mono, but I mean software alone, not games.
Offline princec

« JGO Spiffy Duke »


Medals: 433
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #4 - Posted 2014-08-04 23:11:24 »

You're thinking about Unity or MonoGame. Mono itself is a straightforward cross-platform implementation of the C# CLR - nothing to do with games.

Cas Smiley

Offline CogWheelz
« Reply #5 - Posted 2014-08-04 23:17:43 »

You're thinking about Unity or MonoGame. Mono itself is a straightforward cross-platform implementation of the C# CLR - nothing to do with games.

Cas Smiley

Oh, I thought mono was only for xna conversion. Cheesy I'm so excited!
Offline HeroesGraveDev

JGO Kernel


Medals: 309
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #6 - Posted 2014-08-05 02:36:28 »

If you're wanting to do cross-platform development on Windows, stay away from Microsoft products/tools.

Have a look at MinGW+MSYS, or Cygwin to allow some use of important UNIX tools. (Sorry, too lazy to provide links.)

The LLVM and GCC toolchains are probably about equal. LLVM is fresher and better designed for cross-platform development, but GCC has been around longer and is pretty solid

EDIT: Alternatively, you could have a look at Rust, which aims to be a competitor with C++.

Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #7 - Posted 2014-08-05 08:11:12 »

Today I filled in certain gaps in my java knowledge. I wanted to start using C++ since c# is a microsoft only language. I really like how Visual stuidios looks compared to other compilers but I'm seeing that it wont compile on a mac or linux. I did some reading that it wont compile on mac, but if I code somthing in Visual studios and export the project, will it work on all platforms(windows, mac, linux)?

You can write cross-platform C++ using Visual Studio IDE (no 's') and use the Visual Studio compiler and debugger to compile and debug under windows. You'd then take the same code and use a different IDE+compiler to build and run on other platforms like linux and mac (for mac, have a look at XCode).

The main snags are:
1. Unlike java, you'll need to compile separately on each platform. Cross compilers exist but for desktop platforms aren't usually that good. For big projects you'd typically have a build machine that runs different OSs in virtual machines to do all your builds.

2. It's much harder to write cross platform C++. There are very few cross-platform apis, and even the ones that are cross platform need hand tweeking with per-platform #ifdefs (eg. BSD socket code on windows uses *slightly* different types than on linux and osx). If you go this route you'll need to either write lower level code for each platform, or use a library (such as libpng) which provides cross-platform functionality for you. Additionally, different compilers have different quirks and handle standard C++ slightly differently, meaning you have to compile and test for each platform much more.

I would be incredibly careful about heading down this route. C++ is exceptionally low level, and writing a full game requires a *lot* of system level functionality. You *will* spend at least half a year just getting a basic pong game compiling and running identically on windows/linux/mac.

What problem are you looking to solve, exactly?

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Online ags1

JGO Wizard


Medals: 75
Projects: 3
Exp: 5 years


Make code not war!


« Reply #8 - Posted 2014-08-05 10:19:28 »

Vaguely on topic, personally I loathe the days I have to open Visual Studio. Compared to Java IDEs it feels so primitive and klunky.

If you want to do cross-platform, use a cross-platform ecosystem like Java.

Offline relminator
« Reply #9 - Posted 2014-08-05 10:54:40 »

You can use Visual Studio as an IDE for GCC.  You have to use makefiles(and I used MSVS 2k8 so I'm not sure if this works on newer versions).  With makefiles, you can set your arch targets(not that I'm good with makefiles).

I really don't like to use MSVS as an IDE(except for when coding in C#). Why not use Eclipse CDT?  I personally use CodeLite with Mingw though(Lightweight and cross-platform).
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

« JGO Spiffy Duke »


Medals: 433
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #10 - Posted 2014-08-05 11:07:04 »

I used the Eclipse CDT to develop the Steampuppy libraries (well, to compile them on Linux, at least) and it made a lot of hair-pulling and wrangling incomprehensible commandline stuff go away. Wretchedly I had to use Xcode on the Mac. I think I cried the whole time.

Cas Smiley

Offline CogWheelz
« Reply #11 - Posted 2014-08-05 13:12:52 »

@Orangy Tang I just wanted to dabble with other languages. I remember I started out with c#, and as a begginer switched languages every time i had a problem. I did have a Java textbook so i stayed with Java Tongue . I thought c++ was the foundation of most languages and when you code in it, it compiles on any OS. Is that only with the JVM?


@princec
Gosh, what a a pain.
Offline SHC
« Reply #12 - Posted 2014-08-05 13:27:41 »

I simply installed TDM GCC on windows and installed Code Blocks. The same IDE on Linux and also on Mac. (Installing XCode on mac also installs GCC) so it works the same way.

Offline princec

« JGO Spiffy Duke »


Medals: 433
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #13 - Posted 2014-08-05 14:10:45 »

@Orangy Tang I just wanted to dabble with other languages. I remember I started out with c#, and as a begginer switched languages every time i had a problem. I did have a Java textbook so i stayed with Java Tongue . I thought c++ was the foundation of most languages and when you code in it, it compiles on any OS. Is that only with the JVM?
There are compilers for just about any OS you care to mention ... the trouble is each OS works in rather different ways, so you have to put various macros in to your source for each difference to smooth over the cracks. Worse, you have to also accommodate occasional changes in machine architecture which C++ does not smooth over for you, either, eg. endianness, memory coherency behaviour, etc. (though the very latest C++ standard has apparently standardised on that last one at last). All of this stuff was helpfully abstracted over by higher-level programming languages such as the CLR and JVM.

In short it's a royal pain.

There are two sorts of programmers you find in the wild: the ones that work in the bowels of the machine, covered in soot and oil and with odd personality disorders, tics and twitches - these are the guys that do the difficult stuff in C++ or C or even assembly. Then there are the ones like us, who live in the fresh air above and build beautiful castles atop the dangerous, dark, oily works beneath the earth. We are the lucky ones.

Cas Smiley

Offline Roquen
« Reply #14 - Posted 2014-08-05 14:46:41 »

I was going to post saying:  yeah I hate C++, but let's not exaggerate.  Basically you only have two OS families to think about unix-like and windows.  And only two CPU families intel-a-likes and arm.  So the #if defined(...) blocks aren't so bad if you plan a little.  And I was going to go on and lay out how you can work with C++ in a limited way and not cause yourself too much grief.  You know what?  Screw that.
Pages: [1]
  ignore  |  Print  
 
 

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (30 views)
2014-12-15 09:26:44

Mr.CodeIt (20 views)
2014-12-14 19:50:38

BurntPizza (42 views)
2014-12-09 22:41:13

BurntPizza (76 views)
2014-12-08 04:46:31

JscottyBieshaar (37 views)
2014-12-05 12:39:02

SHC (51 views)
2014-12-03 16:27:13

CopyableCougar4 (48 views)
2014-11-29 21:32:03

toopeicgaming1999 (115 views)
2014-11-26 15:22:04

toopeicgaming1999 (103 views)
2014-11-26 15:20:36

toopeicgaming1999 (30 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!