IS C++ a cross-platform language? [closed]

If I create a game in C++ on a mac using a library which is the same for both windows and osx, will the game be playable on both windows and os x or it will only work in os x because I done it in Xcode?

Is SDL a great library to do your first game after learning the basics and syntax of C++ (I found syntax to be close to Java)?

1

Yes, C++ is a cross-platform language in the sense that there exist compilers for many platforms.

Not all features/versions/libraries are implemented in every compiler or available on all platforms, so in that sense: No, C++ is not a cross-platform language.

Now to your implicit question: “Can I develop a game with SDL for graphics and sound abstraction on Mac OS X and compile the game for Windows?”

Yes, that is in fact possible, provided you are sticking to a defined subset of features and libraries that are available on both platforms. Using MXE, you can compile your Windows version on Linux/BSD/Mac OS X for Windows, and MXE includes SDL.

C++ is a multi-platform language in the sense that the source code can often be successfully compiled for multiple, distinct, platforms. The binaries you create are generally not portable between platforms.

When targeting multiple platforms, you need to take care that you stay away from platform-specific and compiler-specific code. Also all third-party libraries you use should be documented to support all relevant targets.

As long as you stay away from low-level (i.e. platform specific) operations and platform-specific system calls (i.e. only call lib functions in your cross-platform lib) you should be fine. There may be some minor compiler issues requiring you to modify a bit of syntax here and there (porting code is rarely a matter of copy-and-recompile, there are usually one or two minor wrinkles to iron out) but that should be trivial.

Yes. C++ is a cross-platform programming language. You can compile C++ code in many platforms, there exist compilers for most of the platforms. Having said that, the code you write should be cross-platform, you should keep yourself away from platform-dependent features, if you want your code to be platform-independent. For example, you should not use COM if you want to be able to compiler your code on MAC or Linux. And otherwise C++ and the libraries like STL, boost are available from any platform.

I don’t really think of C++ as being “cross-platform” because you have to compile a different version for each platform. Sure, there’s a compiler for every platform, but that doesn’t mean it’s as simple as “port code then hit the compile button”. It’s not remotely that simple.

If you want to do indie game programming, you probably don’t want to reinvent the wheel: there are already free licence physics engines built upon game engines built upon graphics renderers. Why try to build all that on your own?

I recommend JMonkeyEngine. I don’t think you need C++ or DirectX to make fast graphics games anymore unless you are trying for cutting-edge games like Skyrim; and even then you could still do most of the work in Java and add patches from other languages.

EDIT: Also, if you understand “basics and syntax of C++” this is not an indication that you understand C++ as well as you understand Java. C++ has a large number of nuances to it. Like, if you declare and assign a variable on one line vs. two lines this may change whether an overloaded assignment operator vs. a copy constructor gets called. For this reason, C++ programmers usually need to know a lot more about the language than Java programmers in order to program safely in the language.

None of this is dissing C++, but you need to know what to expect if you want to use it. Also, if you use DirectX rather than OpenGL, and if you want to do it on your own without using an open-license rendering engine, then god help you.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật