1

How can I use c++ class in ActionScript3? I want to use the BulletPhysics physics library (C++) in my ActionScript3 game. How can I do it and compile my game (AS3) main class as document class (create main.cpp and addChild as3 main class? how?) in CrossBridge (without FlasCC, only CMD, Makefile and Notepad++)?

  • Not clear what you want with *CrossBridge without FlasCC* because CrossBridge **is** FlashCC: http://adobe-flash.github.io/crossbridge/ There's a link to GitHub repository on that page, and there are **./samples** folder with about 20 presumably compilible sample projects. – Organis Aug 30 '17 at 19:33
  • "C:\CrossBridge_15.0.0.3\sdk\usr\bin\gcc.exe" hello.c -o hello.exe – Gaspar Vardanyan Aug 30 '17 at 20:37
  • Does not working! – Gaspar Vardanyan Aug 30 '17 at 20:38
  • Error: http://imgur.com/a/CtKdW – Gaspar Vardanyan Aug 30 '17 at 20:39
  • @GasparVardanyan try to copy/paste the CMD error text into your question (via [**editing**](https://stackoverflow.com/posts/45967158/edit)). Are you saying GCC does not compile `hello.c`? Is that your real question, how to compile a C program with Crossbridge? Also instead of **gcc.exe** running in `cmd.exe` window, shouldn't it be running via terminal tool like `bash.exe` or `mintty.exe`? I haven't done this for around 3 years after a couple of small projects (mine was about using AS3 code inside a C program, yours is other way around). – VC.One Aug 30 '17 at 22:02
  • Please check my makefile syntax: – Gaspar Vardanyan Aug 30 '17 at 22:09
  • $make FLEX=/cygdrive/c/flexairsdk/4.6.0+25.0.0 FLASCC=/cygdrive/c/CrossBridge_15.0.0.3/sdk "/cygdrive/c/flascc/sdk/usr/bin/gcc" -Werror -Wno-write-strings -Wno-trigraphs hello.c -o hello.exe "/cygdrive/c/flascc/sdk/usr/bin/gcc" -Werror -Wno-write-strings -Wno-trigraphs hello.c -emit-swf -swf-size=200x200 -o hello.swf – Gaspar Vardanyan Aug 30 '17 at 22:09
  • how to compile hello.cpp using crossbridge? please give me full cmd code. – Gaspar Vardanyan Aug 30 '17 at 22:10
  • (1) To copy text from command line, right-click inside windows and choose `mark` to select the text (selected has white highlight) and press `[enter]` to copy. Paste the error message text into your question. The picture cuts off some information (maybe important?)... – VC.One Aug 31 '17 at 16:55
  • (2) To compile, don't use `cmd.exe` as terminal. Crossbridge works in a Linux/Unix environment so you must install CygWin as a sort of emulator (if you cancelled before, you'll have to do it again). Once installed, there should be some icon on your desktop called `Cygwin Terminal`. Use that terminal app (`mintty.exe`) to compile. Test if ready to compile by typing `gcc` and press [enter] it should say _"No input files"_ or you can type `ls` then if it does **not** say _"bash: ls: command not found"_ but instead shows you some filenames then you know it works okay. – VC.One Aug 31 '17 at 17:05
  • (3) Compile `.c` files by using the C compiler **gcc** ... and compile `.cpp` files by using the C++ compiler **g++**. For `hello.cpp` open the Cygwin terminal and type `g++ hello.cpp -o hello.exe` (I don't remember ever needing to use a makefile when compiling. For some code like their included bitmap demo, I had to increase Java memory by options but that was on 32-bit XP years ago). – VC.One Aug 31 '17 at 17:18

0 Answers0