SRL Archive - C/C++ Help and Tutorials

How To Compile Smart.


Brandon

2012-07-15 19:38:24

Compiling Smart Tutorial


Background:

  1. This tutorial will teach you how to compile Smart from its source.
  2. This will be useful if you decide to make your own changes to Smart or simply want to build it yourself.
  3. Building it yourself can solve many problems specific to your situation. One such problem is the socket not pairing. Compiling it yourself seems to be a work around for such a problem.


Requirements:

  1. Mingw-x32_x64 SJLJ
  2. MSYS Command-Line
  3. Java JDK 7 OR Java JDK 8
  4. Smart's Source

What you downloaded:
  1. Cross platform x32 and x64 compiler. If you use SEH instead of SJLJ, you will NOT be able to compile x32 code. SEH is better for x64 builds by a lot. However, since Simba uses x32 modules, we need SJLJ.
  2. Msys command-line is a shell that allows us to run unix/linux like commands on Windows.. grep, bash, make, etc..
  3. Java JDK is of course needed to compile Smart's java classes. JDK 6 is deprecated and JDK7 or JDK8+ must be used to compile the latest Smart.
  4. Smart's source is what we will be compiling using the above tools and environments.


Installing Mingw:
  1. Unzip the downloaded .7z file to the C drive.
  2. Rename the folder to mingw64.

Once done, it should look like the following:
[spoiler=ShowImages]

[/spoiler]




Installing MSYS:
  1. Run the MSYS Installer and press yes on the Setup prompt.
  2. Click Next and then YES to the agreement.
  3. Click Next.
  4. Leave the path as: C:\msys\1.0 and click Next.
  5. Put a checkmark in the Don't create any icons check-box and click Next.
  6. Press install.
  7. After a second or two a command-line interface pops up and asks you: Do you wish to continue with the post install? [yn ]
  8. Type y and press Enter.
  9. It will now ask you: Do you have MinGW installed? [yn ].
  10. Type y and press Enter.
  11. Finally, it asks: Where is your MinGW installation?
  12. You will type: C:/Mingw64 and press Enter.
  13. Finally, press any key to continue…
  14. Uncheck the two boxes on the end of the screen and Finish the installation.

Lost or Confused?
See the following Image tutorial for the above steps:
[spoiler=ShowImages]









[/spoiler]




Modifying the PATH environment variable:

Adding entries to the PATH is normally harmless. However, if you delete any existing entries, you may mess up your PATH, and you could compromise the functioning of your computer. Please be careful.

This part of the tutorial is ONLY if your Java installation is NOT configured properly. Follow along and check if it is. If it isn't you will need to make some changes as shown.

  1. Right-click Computer and click properties. Otherwise navigate to: Control Panel\System and Security\System
  2. Click Advanced system settings
  3. Click Environment Variables…
  4. Scroll down the System Variables panel, select the PATH variable and click Edit.
  5. Press Ctrl+A to select all and Copy paste it into a text editor.
  6. Check to see if 'Java' and 'Mingw' is in it by pressing Ctrl + F and typing Java and Ctrl + F and typing Mingw.
  7. —Modifications (Does NOT delete anything)—
  8. If Java or Mingw is missing, we will add them to the end of the path. Each path is separated by a semi-colon as shown below:

  9. ...OtherPaths...;C:\Mingw64\bin;C:\Program Files\Java\jdk1.8.0\bin
  10. If you are unsure, please see the images in the image tutorial below! You do NOT want to mess this up.
  11. When finished modifying the PATH, copy paste it from your text editor back into your environment variable.
  12. —Modification finished.—
  13. If all is well, click OK 3 times to exit all the interfaces and save any changes.

Lost or Confused?
See the following Image tutorial for the above steps:
[spoiler=ShowImages]




(DO NOT add split them into new lines like the below! It is just an illustration)

[/spoiler]




Compiling Smart:

  1. Navigate to the folder containing SMART's source.
  2. Open the Makefile using a text editor.
  3. Change WIN_GPP to g++ and WIN64_GPP to g++ (This step may be confusing, if so see the images tutorial below or copy this makefile).
  4. Save your changes.
  5. Navigate to C:\msys\1.0
  6. Run msys.bat
  7. Change directory to Smart's source using the CD command. (cd "LocationOfSmart's source here" with quotes.)
  8. Run the make command. (make clean windows)

Lost or Confused?
See the following Image tutorial for the above steps:
[spoiler=ShowImages]




[/spoiler]

Makefile I used: http://pastebin.com/raw.php?i=6uX3N8Eb
[spoiler=ShowMake]

# Copyright 2006-2013 by Benjamin J. Land (a.k.a. BenLand100)
#
# This file is part of the SMART Minimizing Autoing Resource Thing (SMART)
#
# SMART is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# SMART is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SMART. If not, see <http://www.gnu.org/licenses/>.

#these compilers work with crossdev on gentoo
WIN_GPP=g++
WIN64_GPP=g++
LIN_GPP=i686-pc-linux-gnu-g++
LIN64_GPP=x86_64-pc-linux-gnu-g++
JAVAC=javac
JAR=jar

DIST=dist
BUILD=build
WIN_NAME=libsmartremote32.dll
WIN64_NAME=libsmartremote64.dll
LIN_NAME=libsmartremote32.so
LIN64_NAME=libsmartremote64.so

JNI_WIN_NAME=libsmartjni32.dll
JNI_WIN64_NAME=libsmartjni64.dll
JNI_LIN_NAME=libsmartjni32.so
JNI_LIN64_NAME=libsmartjni64.so

JAVA_NAME=smart.jar

WIN_COMPILE_ARGS=-DWINDOWS -O3 -s -m32 -c
WIN64_COMPILE_ARGS=-DWINDOWS -O3 -s -m64 -c
LIN_COMPILE_ARGS=-fPIC -DLINUX -O3 -s -c
LIN64_COMPILE_ARGS=-fPIC -DLINUX -O3 -s -c

SRC_DIR=src
LIN_BUILD_DIR=$(BUILD)/linux32
LIN64_BUILD_DIR=$(BUILD)/linux64
WIN_BUILD_DIR=$(BUILD)/windows32
WIN64_BUILD_DIR=$(BUILD)/windows64
JAVA_BUILD_DIR=$(BUILD)/java

CPPSOURCEFILES= \
$(SRC_DIR)/SmartRemote.cpp

JNI_CPPSOURCEFILES= \
$(SRC_DIR)/SmartJNI.cpp

CPPHEADERFILES= \
$(SRC_DIR)/SmartRemote.h \
$(SRC_DIR)/libsmartremote.def

JNI_CPPHEADERFILES= \
$(SRC_DIR)/jni.h \

WINOBJFILES= \
$(WIN_BUILD_DIR)/SmartRemote.o

JNI_WINOBJFILES= \
$(WIN_BUILD_DIR)/SmartJNI.o

WIN64OBJFILES= \
$(WIN64_BUILD_DIR)/SmartRemote.o

JNI_WIN64OBJFILES= \
$(WIN64_BUILD_DIR)/SmartJNI.o

LINOBJFILES= \
$(LIN_BUILD_DIR)/SmartRemote.o

JNI_LINOBJFILES= \
$(LIN_BUILD_DIR)/SmartJNI.o

LIN64OBJFILES= \
$(LIN64_BUILD_DIR)/SmartRemote.o

JNI_LIN64OBJFILES= \
$(LIN64_BUILD_DIR)/SmartJNI.o

JAVASOURCES= \
$(SRC_DIR)/Canvas.java \
$(SRC_DIR)/Main.java \
$(SRC_DIR)/BlockingEventQueue.java \
$(SRC_DIR)/Client.java \
$(SRC_DIR)/ClientStub.java \
$(SRC_DIR)/EventNazi.java \
$(SRC_DIR)/EventRedirect.java \
$(SRC_DIR)/UnblockedEvent.java

JAVACLASSES= \
$(JAVA_BUILD_DIR)/java/awt/Canvas.class \
$(JAVA_BUILD_DIR)/smart/Main.class \
$(JAVA_BUILD_DIR)/smart/BlockingEventQueue.class \
$(JAVA_BUILD_DIR)/smart/Client.class \
$(JAVA_BUILD_DIR)/smart/ClientStub.class \
$(JAVA_BUILD_DIR)/smart/EventNazi.class \
$(JAVA_BUILD_DIR)/smart/EventRedirect.class \
$(JAVA_BUILD_DIR)/smart/UnblockedEvent.class

all:
@echo "Syntax for the SMART makefile:"
@echo " For Windows distributions: make windows windows64"
@echo " For Linux distributions: make linux linux64"
@echo " For All distributions: make everything"
@echo " For test apps: make test-python test-linux test-linux64 test-windows test-windows64"
@echo " For all test apps: make test-all"
@echo " To clean build files: make clean"

everything: linux linux64 windows windows64

test-all: test-python test-windows test-windows64 test-linux test-linux64

linux: $(JAVACLASSES) $(DIST)/$(LIN_NAME) $(DIST)/$(JNI_LIN_NAME)
@echo "Finished Building the Linux 32bit SMART distribution"

linux64: $(JAVACLASSES) $(DIST)/$(LIN64_NAME) $(DIST)/$(JNI_LIN64_NAME)
@echo "Finished Building the Linux 64bit SMART distribution"

windows: $(JAVACLASSES) $(DIST)/$(WIN_NAME) $(DIST)/$(JNI_WIN_NAME)
@echo "Finished Building the Windows 32bit SMART distribution"

windows64: $(JAVACLASSES) $(DIST)/$(WIN64_NAME) $(DIST)/$(JNI_WIN64_NAME)
@echo "Finished Building the Windows 64bit SMART distribution"

test-linux:
@mkdir -p $(DIST)
@$(LIN_GPP) -I $(SRC_DIR) -fPIC -shared -s -o $(DIST)/example-plugin32.so test-apps/example-plugin.cpp
@$(LIN_GPP) -ldl -o $(DIST)/test-plugin-load32 test-apps/test-plugin-load.cpp
@$(LIN_GPP) -ldl -o $(DIST)/test-spawn32 test-apps/test-spawn.cpp
@$(LIN_GPP) -ldl -o $(DIST)/test-eios32 test-apps/test-eios.cpp
@$(LIN_GPP) -ldl -o $(DIST)/test-exports32 test-apps/test-exports.cpp
@echo "Finished building Linux 32bit test files"

test-linux64:
@mkdir -p $(DIST)
@$(LIN64_GPP) -I $(SRC_DIR) -fPIC -shared -s -o $(DIST)/example-plugin64.so test-apps/example-plugin.cpp
@$(LIN64_GPP) -ldl -o $(DIST)/test-plugin-load64 test-apps/test-plugin-load.cpp
@$(LIN64_GPP) -ldl -o $(DIST)/test-spawn64 test-apps/test-spawn.cpp
@$(LIN64_GPP) -ldl -o $(DIST)/test-eios64 test-apps/test-eios.cpp
@$(LIN64_GPP) -ldl -o $(DIST)/test-exports64 test-apps/test-exports.cpp
@echo "Finished building Linux 64bit test files"

test-windows:
@mkdir -p $(DIST)
@$(WIN_GPP) -I $(SRC_DIR) -shared -static-libgcc -static-libstdc++ -s -o $(DIST)/example-plugin32.dll test-apps/example-plugin.cpp
@$(WIN_GPP) -static-libgcc -static-libstdc++ -o $(DIST)/test-plugin-load32.exe test-apps/test-plugin-load.cpp
@$(WIN_GPP) -static-libgcc -static-libstdc++ -o $(DIST)/test-spawn32.exe test-apps/test-spawn.cpp
@$(WIN_GPP) -static-libgcc -static-libstdc++ -o $(DIST)/test-eios32.exe test-apps/test-eios.cpp
@$(WIN_GPP) -static-libgcc -static-libstdc++ -o $(DIST)/test-exports32.exe test-apps/test-exports.cpp
@echo "Finished building Windows 32bit test files"

test-windows64:
@mkdir -p $(DIST)
@$(WIN64_GPP) -I $(SRC_DIR) -shared -static-libgcc -static-libstdc++ -s -o $(DIST)/example-plugin64.dll test-apps/example-plugin.cpp
@$(WIN64_GPP) -static -static-libgcc -static-libstdc++ -o $(DIST)/test-plugin-load64.exe test-apps/test-plugin-load.cpp
@$(WIN64_GPP) -static -static-libgcc -static-libstdc++ -o $(DIST)/test-spawn64.exe test-apps/test-spawn.cpp
@$(WIN64_GPP) -static -static-libgcc -static-libstdc++ -o $(DIST)/test-eios64.exe test-apps/test-eios.cpp
@$(WIN64_GPP) -static -static-libgcc -static-libstdc++ -o $(DIST)/test-exports64.exe test-apps/test-exports.cpp
@echo "Finished building Windows 64bit test files"

test-python:
@mkdir -p $(DIST)
@cp test-apps/test-python.py $(DIST)/test-python
@echo "Finished building Python test files"

clean:
@echo "Cleaning build files..."
@rm -rf $(BUILD) $(DIST)

#### LINUX BUILDING DIRECTIVES ####

$(DIST)/$(LIN_NAME): $(LINOBJFILES)
@echo "Linking Linux Remote object files..."
@mkdir -p $(DIST)
@$(LIN_GPP) -fPIC -shared -s -o $(DIST)/$(LIN_NAME) $(LINOBJFILES)

$(DIST)/$(JNI_LIN_NAME): $(JNI_LINOBJFILES)
@echo "Linking Linux JNI object files..."
@mkdir -p $(DIST)
@$(LIN_GPP) -fPIC -shared -s -o $(DIST)/$(JNI_LIN_NAME) $(JNI_LINOBJFILES)

$(LIN_BUILD_DIR)/SmartRemote.o: $(SRC_DIR)/SmartRemote.cpp $(CPPHEADERFILES)
@echo "Compiling SmartRemote.cpp"
@mkdir -p $(LIN_BUILD_DIR)
@$(LIN_GPP) $(LIN_COMPILE_ARGS) -o $(LIN_BUILD_DIR)/SmartRemote.o $(SRC_DIR)/SmartRemote.cpp

$(LIN_BUILD_DIR)/SmartJNI.o: $(SRC_DIR)/SmartJNI.cpp $(JNI_CPPHEADERFILES)
@echo "Compiling SmartJNI.cpp"
@mkdir -p $(LIN_BUILD_DIR)
@$(LIN_GPP) $(LIN_COMPILE_ARGS) -o $(LIN_BUILD_DIR)/SmartJNI.o $(SRC_DIR)/SmartJNI.cpp


#### LINUX64 BUILDING DIRECTIVES ####

$(DIST)/$(LIN64_NAME): $(LIN64OBJFILES)
@echo "Linking Linux64 Remote object files..."
@mkdir -p $(DIST)
@$(LIN64_GPP) -fPIC -shared -s -o $(DIST)/$(LIN64_NAME) $(LIN64OBJFILES)

$(DIST)/$(JNI_LIN64_NAME): $(JNI_LIN64OBJFILES)
@echo "Linking Linux64 JNI object files..."
@mkdir -p $(DIST)
@$(LIN64_GPP) -fPIC -shared -s -o $(DIST)/$(JNI_LIN64_NAME) $(JNI_LIN64OBJFILES)

$(LIN64_BUILD_DIR)/SmartRemote.o: $(SRC_DIR)/SmartRemote.cpp $(CPPHEADERFILES)
@echo "Compiling SmartRemote.cpp"
@mkdir -p $(LIN64_BUILD_DIR)
@$(LIN64_GPP) $(LIN64_COMPILE_ARGS) -o $(LIN64_BUILD_DIR)/SmartRemote.o $(SRC_DIR)/SmartRemote.cpp

$(LIN64_BUILD_DIR)/SmartJNI.o: $(SRC_DIR)/SmartJNI.cpp $(JNI_CPPHEADERFILES)
@echo "Compiling SmartJNI.cpp"
@mkdir -p $(LIN64_BUILD_DIR)
@$(LIN64_GPP) $(LIN64_COMPILE_ARGS) -o $(LIN64_BUILD_DIR)/SmartJNI.o $(SRC_DIR)/SmartJNI.cpp


#### WINDOWS BUILDING DIRECTIVES ####

$(DIST)/$(WIN_NAME): $(WINOBJFILES)
@echo "Linking Windows Remote object files..."
@mkdir -p $(DIST)
@$(WIN_GPP) -Wl,$(SRC_DIR)/libsmartremote.def -static -static-libgcc -static-libstdc++ -mwindows -shared -s -m32 -o $(DIST)/$(WIN_NAME) $(WINOBJFILES) -lws2_32

$(DIST)/$(JNI_WIN_NAME): $(JNI_WINOBJFILES)
@echo "Linking Windows JNI object files..."
@mkdir -p $(DIST)
@$(WIN_GPP) -Wl,$(SRC_DIR)/libsmartjni.def -static -static-libgcc -static-libstdc++ -mwindows -shared -s -m32 -o $(DIST)/$(JNI_WIN_NAME) $(JNI_WINOBJFILES)

$(WIN_BUILD_DIR)/SmartRemote.o: $(SRC_DIR)/SmartRemote.cpp $(CPPHEADERFILES)
@echo "Compiling SmartRemote.cpp"
@mkdir -p $(WIN_BUILD_DIR)
@$(WIN_GPP) $(WIN_COMPILE_ARGS) -o $(WIN_BUILD_DIR)/SmartRemote.o $(SRC_DIR)/SmartRemote.cpp -lws2_32

$(WIN_BUILD_DIR)/SmartJNI.o: $(SRC_DIR)/SmartJNI.cpp $(JNI_CPPHEADERFILES)
@echo "Compiling SmartJNI.cpp"
@mkdir -p $(WIN_BUILD_DIR)
@$(WIN_GPP) $(WIN_COMPILE_ARGS) -o $(WIN_BUILD_DIR)/SmartJNI.o $(SRC_DIR)/SmartJNI.cpp

#### WINDOWS64 BUILDING DIRECTIVES ####

$(DIST)/$(WIN64_NAME): $(WIN64OBJFILES)
@echo "Linking Windows64 Remote object files..."
@mkdir -p $(DIST)
@$(WIN64_GPP) -Wl,$(SRC_DIR)/libsmartremote.def -static -static-libgcc -static-libstdc++ -mwindows -shared -s -m64 -o $(DIST)/$(WIN64_NAME) $(WIN64OBJFILES) -lws2_32

$(DIST)/$(JNI_WIN64_NAME): $(JNI_WIN64OBJFILES)
@echo "Linking Windows64 JNI object files..."
@mkdir -p $(DIST)
@$(WIN64_GPP) -Wl,$(SRC_DIR)/libsmartjni.def -static -static-libgcc -static-libstdc++ -mwindows -shared -s -m64 -o $(DIST)/$(JNI_WIN64_NAME) $(JNI_WIN64OBJFILES)

$(WIN64_BUILD_DIR)/SmartRemote.o: $(SRC_DIR)/SmartRemote.cpp $(CPPHEADERFILES)
@echo "Compiling SmartRemote.cpp"
@mkdir -p $(WIN64_BUILD_DIR)
@$(WIN64_GPP) $(WIN64_COMPILE_ARGS) -o $(WIN64_BUILD_DIR)/SmartRemote.o $(SRC_DIR)/SmartRemote.cpp -lws2_32

$(WIN64_BUILD_DIR)/SmartJNI.o: $(SRC_DIR)/SmartJNI.cpp $(JNI_CPPHEADERFILES)
@echo "Compiling SmartJNI.cpp"
@mkdir -p $(WIN64_BUILD_DIR)
@$(WIN64_GPP) $(WIN64_COMPILE_ARGS) -o $(WIN64_BUILD_DIR)/SmartJNI.o $(SRC_DIR)/SmartJNI.cpp


#### JAVA BUILDING DIRECTIVES ####

$(JAVACLASSES): $(JAVASOURCES)
@echo "Compiling Java Classes..."
@mkdir -p $(JAVA_BUILD_DIR)
@$(JAVAC) -classpath $(JAVA_BUILD_DIR) -sourcepath $(SRC_DIR) -d $(JAVA_BUILD_DIR) $(JAVASOURCES)
@echo "Creating JAR Archive..."
@mkdir -p $(DIST)
@$(JAR) cfe $(DIST)/$(JAVA_NAME) smart.Main -C $(JAVA_BUILD_DIR) .



[/spoiler]


Your plugins and jar file should now be in the dist folder. Copy paste them to your C:/Simba/Plugins folder and enjoy.

iBlank

2012-07-15 19:45:37

Thank you very much. For those who are going to compile the plugins them self, which I suggest to help learn, make sure you right click and run msys.bat as administrator. When I ran it regular it would not let me use the CD command.

From: Brandon

Add the end of your path, make sure it has a semi colon and then add:

;C:\Program Files (x86)\Java\jdk1.6.0_33\bin;C:\MinGw\bin


Also, for me the jdk1.6.0_33 is in regular Program Files not (x86) so if yours is the same way then use this instead:

;C:\Program Files\Java\jdk1.6.0_33\bin;C:\MinGw\bin

Edit - I also heard you are a big fan of Pretty Little Liars ;)

Brandon

2012-07-15 19:52:07

From: alevere4
Thank you very much. For those who are going to compile the plugins them self, which I suggest to help learn, make sure you right click and run msys.bat as administrator. When I ran it regular it would not let me use the CD command.

Edit - I also heard you are a big fan of Pretty Little Liars ;)



LOL! That was an accident! I was teamviewering a girl's computer and I tried fixing her flashplayer for Firefox 13 on windows 8.. Copied the link for testing rather than the media fire link :c

Kasi

2012-07-15 20:02:12

From: alevere4

Edit - I also heard you are a big fan of Pretty Little Liars ;)


one for the Sig i guess :D

gerauchert

2012-07-16 00:44:27

Hmm, I feel like I'm missing something really easy here… so I apologize in advance, but how do you edit the make file?

Brandon

2012-07-16 00:50:58

From: gerauchert
Hmm, I feel like I'm missing something really easy here… so I apologize in advance, but how do you edit the make file?


I used notepad++ but if you don't have it just use WordPad. Right click then press open. Choose a program from list. Choose Wordpad. Uncheck always open with.

iiNveRsioN

2012-07-16 00:51:10

From: gerauchert
Hmm, I feel like I'm missing something really easy here… so I apologize in advance, but how do you edit the make file?


Open with Simba.

Edit what you need to then save.

Shatterhand

2012-07-16 04:00:28

It works for me. Although I have to open simba first and then open the script. Cant run as admin otherwise. Tested it with an easy bonfire script, login works, but some functions does not, like InPin.

rewopelet

2012-07-16 07:02:27

http://imgur.com/rR7QC

i get 1 error and 2 warning
error -build/java/java/awt/canvas.class

Austin

2012-07-16 07:22:58

Detailed guide with good pics, thanks!

gerauchert

2012-07-16 11:22:16

@Brandon/Iinversion

Thank you very much :) its all working now

Austin

2012-07-16 12:16:05

One problem, after i do everything and open the command prompt though. I changed the directory then did "make windows" then it only compiles Main.cpp and Color.cpp, then while trying to compile Java Classes it comes up with:

make: javac: Command not found
make: *** [build/java/java/awt/Canvas.class] Error 127

So basically the same thing as rewopelet. What should we do?

Brandon

2012-07-16 12:21:44

From: AustnW
One problem, after i do everything and open the command prompt though. I changed the directory then did "make windows" then it only compiles Main.cpp and Color.cpp, then while trying to compile Java Classes it comes up with:

make: javac: Command not found
make: *** [build/java/java/awt/Canvas.class] Error 127

So basically the same thing as rewopelet. What should we do?


You guys never installed Java JDK OR you didn't set your class path like in the pictures.

Austin

2012-07-16 12:23:31

From: Brandon
You guys never installed Java JDK OR you didn't set your class path like in the pictures.

Hmm I was positive I installed it. Let me check then, I'll get back to you later

iBlank

2012-07-16 13:34:19

From: AustnW
Hmm I was positive I installed it. Let me check then, I'll get back to you later


Check if your JDK is in Program Files or Program Files (x86) then use the correct path.

nokkasiili

2012-07-16 13:35:35

And this is how you do it in linux:
cd SMART
make linux
:spot:

rewopelet

2012-07-16 13:36:02

after make windows it only added libsmart32.dll to the dist folder
i686-pc-ming32-g++ not found
what did i do wrong

Brandon

2012-07-16 13:43:34

From: rewopelet
after make windows it only added libsmart32.dll to the dist folder
i686-pc-ming32-g++ not found
what did i do wrong


The instructions say to change it to g++ not mingw32-g++… You have to edit the two makefiles.

rewopelet

2012-07-16 14:12:38

it works now thanks!

Austin

2012-07-16 16:43:05

Thanks! I got it running :) The problem for me was a stupid mistake (probably like it is for most people) I copied your path you had as Program Files (x86), and the Java SDK was just in Program Files. Like i said stupid mistake lol, but it's working for me now, i'll post back if there's any problems or if I find anything else.

[XoL]

2012-07-18 13:42:00

Ah man :p the lazy bum files have been deleted!
Haha

iraqownz

2012-07-19 09:11:50

after i have completed all these steps, then i tried to run a script in simba, and i still get this text:

*** Smart Cannot Spawn Clients ***

:/

Austin

2012-07-19 09:50:29

From: iraqownz
after i have completed all these steps, then i tried to run a script in simba, and i still get this text:

*** Smart Cannot Spawn Clients ***

:/


Then you musn't of done something right

iraqownz

2012-07-19 16:17:38

well.. the compiler, complied without any errors, and created those smart files… i just cant get smart to run, when i save a script.. :/

Arepirpi

2012-07-23 04:00:42

So after doing this I can run scripts without running simba as administrator? I tried and when I try to directly open a script.simba and run, Smart wont run but if I first open simba.exe and open my script, smart will run. Am I doing anything wrong?

Brandon

2012-07-23 06:37:07

From: Arepirpi
So after doing this I can run scripts without running simba as administrator? I tried and when I try to directly open a script.simba and run, Smart wont run but if I first open simba.exe and open my script, smart will run. Am I doing anything wrong?


Nope that's correct. I'm thinking of a better way atm to make smart run from any directory. I'll ask benland if I can pass it different parameters. Maybe something like SmartSpawnClient(PluginsPath,……); etc..

Arepirpi

2012-07-23 07:34:35

Thank you Brandom, you have been very helpful to this community… :)

Scaper

2012-07-24 18:00:11

am i missing somthing follow exact instruction the folder"s" is smart on desktop but says no such file :/


masterBB

2012-07-24 18:04:32

From: Scaper
am i missing somthing follow exact instruction the folder"s" is smart on desktop but says no such file :/


Try / instead of \

Brandon

2012-07-24 18:06:05

From: masterBB
Try / instead of \


This..

@Scaper \ is an escape character. Inorder to represent a back-slash \ in a path you need two..

C:\\Users\\Whatever\\desktop\\smart

C:/Users/Whatever/Desktop/Smart.

Scaper

2012-07-25 06:47:58

Thanks guys I manged I think I downloaded your smart plugins and added them and everything is fine :)

PotentPK

2012-07-27 05:41:08

From: rewopelet
http://imgur.com/rR7QC

i get 1 error and 2 warning
error -build/java/java/awt/canvas.class


I'm getting this too. Idk why.

Edit: Use JDK 6 33

Got the files to compile…

SRL Compiled in 0 msec
** Fatal Error: Pairing Clients; Terminating Script **
Successfully executed.

Crit

2012-08-11 00:26:07

I got the "Could not Spawn Client" error.
A friend recommended this thread but i am having trouble following it.
My makefile already looks like the one in the pic and the files from Github don't have smart/remote…
any help please?
Crit

Abu

2012-08-29 11:25:31

Can't get it to work.

I download the SMART file (from your link) and it is called BenLand100-SMART-v7.1-28-g8d5ba90. I have the same problem as Scaper, however I'm using the correct slashes.

Within that folder there is another folder called BenLand100-SMART-8d5ba90.

Which folder do I link it to? Main or subfolder?

Jakkle

2012-08-29 13:26:35

From: abu_jwka
Can't get it to work.

I download the SMART file (from your link) and it is called BenLand100-SMART-v7.1-28-g8d5ba90. I have the same problem as Scaper, however I'm using the correct slashes.

Within that folder there is another folder called BenLand100-SMART-8d5ba90.

Which folder do I link it to? Main or subfolder?


I would say the sub-folder. Just make sure your pointing to the folder with the make file.

Abu

2012-08-30 18:46:58

From: Jakkle
I would say the sub-folder. Just make sure your pointing to the folder with the make file.


Still doesn't seem to be working. Could it be that there is a period (.) in my username? Or does that have no effect?


EDIT: I'm gonna re - download SMART however the folder looks nothing like Brandons…

Jakkle

2012-09-07 11:00:42

From: abu_jwka
Still doesn't seem to be working. Could it be that there is a period (.) in my username? Or does that have no effect?


EDIT: I'm gonna re - download SMART however the folder looks nothing like Brandons…


Did you get it sorted in the end or are you still having this problem ?

I just downloaded the SMART 8.0 ZIP file from Github, extracted it to my desktop, then renamed the folder to SMART.
After that I did as Brandon said with setting the path after installing mingw.
Then opened msys and directed it to the SMART folder on my desktop making sure the folder I was pointing to had the make file within it. I then entered make windows and it compiled it for me.
If you do that for both make files it should work. Oh and remember to edit the make files to what Brandon has showed in the OP.
Sorry for the late reply

superpinkplant

2012-10-18 04:29:46

Very confused, slightly frustrated. I've been using simba problem free for months, and then bam, I get the "smart cannot spawn clients error". I compiled smart myself following this wonderful guide, placed it in the plugins folder, but the error won't go away. I'm using Smart v8.0, Simba 991, everything's updated, and I run simba as administrator, then opening the script. Does anyone have a clue what's going on?
thanks!

Bixby Sayz

2012-11-09 21:18:07

From: rewopelet
http://imgur.com/rR7QC

i get 1 error and 2 warning
error -build/java/java/awt/canvas.class
Did you ever get this resolved, and if so: how? I get the exact same output/error as you.

Brandon

2012-11-09 21:36:19

From: Bixby Sayz
Did you ever get this resolved, and if so: how? I get the exact same output/error as you.



Do not compile it with Java 7. Java 6 is required to compile Smart.

Bixby Sayz

2012-11-10 19:19:39

From: Brandon
Do not compile it with Java 7. Java 6 is required to compile Smart.
Figured this was the case. Occurred to me after I posted.

NKN

2012-12-23 00:17:40

Edit: Says compiled fine, I replace plugins, no changes. e.e

unknownrpg

2012-12-30 17:11:20

is there something else besides minGW we can use? ive tried installing a few times now and it fails over n over =/ its not able to dl all req files so and also i tried b4 i realized and was unable to find the makefile? in simba folder and smart ?

Brandon

2013-01-01 00:09:35

From: unknownrpg
is there something else besides minGW we can use? ive tried installing a few times now and it fails over n over =/ its not able to dl all req files so and also i tried b4 i realized and was unable to find the makefile? in simba folder and smart ?



Just saw your visitor message on my profile. Is there a particular reason you're compiling smart? This tutorial was made long before Smart 8 was officially out. It was made for Smart 8 because of the problems users had with Spawning clients, but that's all fixed now..

I don't know of anything half as good as Mingw on Windows.


I'm not sure what you're doing wrong but this tutorial still works. There's only 2 DLL's you get when you compile Smart and they are in the dist folder. You drag them to Simba's plugin folder.

unknownrpg

2013-01-02 20:48:22

From: Brandon
Just saw your visitor message on my profile. Is there a particular reason you're compiling smart? This tutorial was made long before Smart 8 was officially out. It was made for Smart 8 because of the problems users had with Spawning clients, but that's all fixed now..

I don't know of anything half as good as Mingw on Windows.


I'm not sure what you're doing wrong but this tutorial still works. There's only 2 DLL's you get when you compile Smart and they are in the dist folder. You drag them to Simba's plugin folder.


i was told maybe some of my functions were not working properly because i didnt have smart 8 but if smart is litterally just for spawning clients do you by chance know of any other reason off the top of your head that certain functions in my simba would not be working with simba installed correctly? are there additional items i need to add into my simba folder to make functions like chooseoption work? its not that they do something wrong they even compile its just when i run the scripts i try to put them in it wont do it its like the line of code was blank?

for example.

program SupaHeata;
{$I SRL/SRL.SIMBA}

var
x,y,IronOre,Coal,Bag: Integer;

begin

SetupSRL;
ActivateClient;

Coal := DTMFromString('mlwAAAHicY2dgYBAAYkYGCOAEYlEglgZiBSBmBWJmIOYFYiEozQFVq6ggwYALcOHBjHgwFAAAgcgBVA==');

if FindDTM(Coal, x, y, MBX1, MBY1, MBX2, MBY2) then
begin
WriteLn('Yes! we have Coal!');
MMouse(x, y, 5, 5);
if IsUpText('Coal') then
Wait(RandomRange(400, 500));
Mouse(x, y, 0, 0, false);
WaitOption('on', 500)
Wait(RandomRange(400, 500));
FreeDTM(Coal);
end;
end.


here waitoption does nothing on my simba it just sits there and says script completed, so i have had to do mmouse to wherever the withdrawl option i want is and add a low tolerance so it doesnt misclick however trying to hide that its a bot. like this

program SupaHeata;
{$I SRL/SRL.SIMBA}

var
x,y,IronOre,Coal,Bag: Integer;

procedure Ore;

begin

SetupSRL;
ActivateClient;

Coal := DTMFromString('m6wAAAHic42ZgYBAAYkkgloZiUagYJxTDABMQswAxMxCzAzE3EHNB1QpC+TxAzApVr6giwUALwEgCRgIAAJ8BbA==');
Bag := DTMFromString('m1gAAAHic42JgYOAEYi4gFgBiESjmA2J2BghgBGJWIBaE8mFqxYFYGoolgJgfatac0iAGYoAkUaog9hODEQAAd2ACnw==');
IronOre := DTMFromString('m6wAAAHic42ZgYFjByMAwC4hnQPFCKAaJrwXizVC8EYjvANXfAOK7QPwEiB8D8UsgfgHEj6D8+0B8G4gNZQQYaAEYScBIAABw+hFH');

begin
if FindDTM(Coal, x, y, MBX1, MBY1, MBX2, MBY2) then
WriteLn('Yes! we have Coal!');
MMouse(x, y, 5, 5);
if IsUpText('Coal') then
Wait(RandomRange(400, 500));
Mouse(x, y, 0, 0, false);
Wait(RandomRange(400, 500));
Mouse(447, 235, 17, 3, true);
end;

begin
if FindDTM(Bag, x, y, MIX1, MIY1, MIX2, MIY2) then
WriteLn('Dungeoneering blows!');
MMouse(x, y, 5, 5);
if IsUpText('bag') then
Wait(RandomRange(400, 500));
Mouse(x, y, 0, 0, False);
Wait(RandomRange(400, 500));
Mouse(621, 305, 17, 3, true);
FreeDTM(Bag);
end;

begin
if FindDTM(IronOre, x, y, MBX1, MBY1, MBX2, MBY2) then
WriteLn('Yes! we have iron ore!');
MMouse(x, y, 5, 5);
if IsUpText('Iron') then
Wait(RandomRange(400, 500));
Mouse(x, y, 0, 0, False);
Wait(RandomRange(400, 500));
Mouse(400, 210, 17, 3, true);
FreeDTM(IronOre);
end;

begin
if FindDTM(Coal, x, y, MBX1, MBY1, MBX2, MBY2) then
WriteLn('Yes! we have Coal!');
MMouse(x, y, 5, 5);
if IsUpText('Coal') then
Wait(RandomRange(400, 500));
Mouse(x, y, 0, 0, false);
Wait(RandomRange(400, 500));
Mouse(447, 235, 17, 3, true);
FreeDTM(Coal);
Mouse(488, 55, 1, 1, true)
Wait(RandomRange(1000, 1500));
end;
end;


procedure SupaHeata;

begin

IronOre := DTMFromString('m6wAAAHic42ZgYFjByMAwC4hnQPFCKAaJrwXizVC8EYjvANXfAOK7QPwEiB8D8UsgfgHEj6D8+0B8G4gNZQQYaAEYScBIAABw+hFH');

if FindDTM(IronOre, x, y, MIX1, MIY1, MIX2, MIY2) then
WriteLn('Im busy Supaheatin');
MMouse(x, y, 0, 0);
SendKeys('1', 100, 100);
Mouse(x, y, 0, 0, true);
Wait(RandomRange(1200, 1250));
end;

procedure CheckInv;

begin
if FindDTM(IronOre, x, y, MIX1, MIY1, MIX2, MIY2) then
repeat SupaHeata;
until (FindDTM(IronOre, x, y, MIX1, MIY1, MIX2, MIY2)=false);
FreeDTM(IronOre);
end;










begin
Ore;
SupaHeata;
CheckInv;
end.

sry to post so much on off topic thread but anyhelp would be much appreciated thx i have unistalled and reinstalled several times to the specs on the thread here http://villavu.com/forum/showthread.php?t=47714
so i dont know if im just dumb or what?

Brandon

2013-01-02 21:24:01

Well you can try something like this.. Also, your script does not call Smart so I'm not sure what you mean by "functions were not working properly because i didnt have smart 8".

I'd like to know who told you that.. LOL.

Try this:


{$I SRL/SRL.SIMBA}

Function ClickMyDTM(DTM: Integer; Uptexts: TStringArray): Boolean;
var
X, Y: Integer;
Begin
Result := False;

If WaitDTMEx(DTM, X, Y, MBX1, MBY1, MBX2, MBY2, 50, 500) Then
Begin
WriteLn('DTM Found!');
MMouse(X, Y, 5, 5);

If WaitUpTextMulti(Uptexts, 600) Then
Begin
ClickMouse2(MOUSE_RIGHT);
Result := WaitOptionMulti(['On', 'on'], 600);
End;
End;
End;

var
Coal: Integer;

Begin
SetupSRL;
ActivateClient;

Coal := DTMFromString('mlwAAAHicY2dgYBAAYkYGCOAEYlEglgZiBSBmBWJmIOYFYiEozQFVq6ggwYALcOHBjHgwFAAAgcgBVA==');
If (ClickMyDTM(Coal, ['Coal', 'oal', 'coal', 'coa'])) Then
Writeln('Clicked The DTM');

FreeDTM(Coal);
End.

DrChill

2013-01-02 22:56:08

Well done, I thought about making a bunch of different tutorials for compiling everything Simba, SRL, SMART etc …

Hopefully this encourages people to get involved in programming SRL/Simba/SMART/Lape and maybe we see a stable Linux version soon :)

wisdomboy

2013-01-08 03:30:22

Great guide, i did few changes on Smart8.0.

J J

2013-02-20 18:03:00

Finally managed to compile SMART 8 or atleast the newest version on Github. Problem was that I was using JDK 7 first. Installed JDK 6 but 7 was on my variables path. So I removed JDK 7 on path and now that only 6 was on it it compiled succesfully. Now to edit some stuff myself for fun :)

Nodderz

2013-03-25 18:53:11

From: J J
Finally managed to compile SMART 8 or atleast the newest version on Github. Problem was that I was using JDK 7 first. Installed JDK 6 but 7 was on my variables path. So I removed JDK 7 on path and now that only 6 was on it it compiled succesfully. Now to edit some stuff myself for fun :)


I had to uninstall 7 an ins 6, but where is the variable path you talk about? I might have this issue to? Not sure

Nodderz

2013-03-26 01:54:57

No rule to install taget windows stop.

That came up when i tried compiling, any ideas?

Also, i edited the Makefile in the Smart folder, but, unless i read wrong, it then says to edit another makefile? where is the second one?

Thanks!

Brandon

2013-03-26 17:20:44

You're not "installing" anything. If anything, that error should be more like "No Rule To Make Windows".. BUT there is a rule to make windows.

I just tried it just now. If you need help setting up a compiler, I can probably teamviewer you some time.

Nodderz

2013-03-26 21:33:37

Mate i;ll pm you now in regards to teamviewer, i cannot get SMART to work for the life of me!

coneman

2013-03-27 23:59:05

I'm missing the remote folder in my unzipped SMART folder. I only have src and test-apps in mine. This is causing me to be unable to compile it. Can anyone help please?

Brandon

2013-03-28 03:43:45

Uhh Download: https://github.com/BenLand100/SMART/archive/master.zip

And just run make windows on it.

If it doesn't work, you can try the make file that I wrote.. Just edit the "JavacPath" and it'll work. Why do you guys still need to compile Smart though? I thought it worked out of the box now :S


WinGPP = g++
LinGPP = g++
Javac = javac
JavacPath = "C:/Program Files (x86)/Java/jdk1.6.0_41/bin"

BinDIR = bin
ObjDIR = obj
SrcDIR = src
BitFLG = -m32

JavaOUT = smart.jar
RemoteOUT = libsmartremote$(subst -m,,$(BitFLG))
JniOUT = libsmartjni$(subst -m,,$(BitFLG))

WinDEP = -static -static-libgcc -static-libstdc++ -shared -s -o
LinDEP = -static -static-libgcc -static-libstdc++ -shared -s -o
WinARGS = -std=c++11 -O3 -DWINDOWS -s -c $(BitFLG)
LinARGS = -FPIC -std=c++11 -O3 -DLINUX -s -c $(BitFLG)


REMOUT = NONE
GPP = NONE
ARGS = NONE
DEPS = NONE
JNI = NONE
OBJ = NONE
LINKER = NONE

CppFiles = \
$(SrcDIR)/SmartRemote.cpp

ObjFiles = \
$(patsubst $(SrcDIR)/%.cpp,$(OBJ)/%.o,$(CppFiles))

JniFiles = \
$(SrcDIR)/SmartJNI.cpp

JniObjFiles = \
$(patsubst $(SrcDIR)/%.cpp,$(OBJ)/%.o,$(JniFiles))

JavaFiles = \
$(wildcard $(SrcDIR)/*.java)

JavaObjs = \
$(wildcard $(OBJ)/*.class)

all:
@echo
@echo " Instructions For Making Smart:"
@echo
@echo " For Windows: make windows"
@echo " For Linux: make linux"
@echo " For Both: make both"
@echo " For x64 Builds: make windows BitFLG=-m64"
@echo " make linux BitFLG=-m64"
@echo " To Clean Files: make clean"

everything: linux windows

linux:
GPP = $(LinGPP)
ARGS = $(LinARGS)
DEPS = $(LinDEP)
OBJ = $(ObjDIR)/Linux$(subst -m,,$(BitFLG))
REMOUT = $(RemoteOUT).so
JNI = $(JniOUT).so
LINKER =
linux : $(BinDIR)/Java $(BinDIR)/$(OUT) $(BinDIR)/$(JNI)
@echo
@echo "Finished Building Smart Linux Distribution."


windows:
GPP = $(WinGPP)
ARGS = $(WinARGS)
DEPS = $(WinDEP)
OBJ = $(ObjDIR)/Windows$(subst -m,,$(BitFLG))
REMOUT = $(RemoteOUT).dll
JNI = $(JniOUT).dll
LINKER = -lws2_32
windows : $(BinDIR)/Java $(BinDIR)/$(REMOUT) $(BinDIR)/$(JNI)
@echo
@echo "Finished Building Smart Windows Distribution."

clean:
@echo " Cleaning Build Files."
@rm -rf $(ObjFiles) $(BinDIR) $(OBJ)




$(BinDIR)/$(REMOUT): $(ObjFiles)
@echo
@echo "Linking Remote Object Files.."
@mkdir -p $(BinDIR)
@$(GPP) -Wl,$(SrcDIR)/libsmartremote.def $(DEPS) $(BinDIR)/$(REMOUT) $(ObjFiles) $(BitFLG) $(LINKER)

$(BinDIR)/$(JNI): $(JniObjFiles)
@echo
@echo "Compiling JNI Object FIles.."
@mkdir -p $(BinDIR)
@$(GPP) $(DEPS) $(BinDIR)/$(JNI) $(JniObjFiles) $(BitFLG) $(LINKER)


$(OBJ)/%.o: $(SrcDIR)/%.cpp
@echo " Compiling: " $<
@mkdir -p $(OBJ)
@$(GPP) $(ARGS) -o $@ $< $(LINKER)


$(BinDIR)/Java:
@echo "Compiling Java Files.."
@mkdir -p $(OBJ)
@$(JavacPath)/$(Javac) -d $(OBJ) $(JavaFiles) -sourcepath $(SrcDIR) -classpath $(OBJ)
@mkdir -p $(BinDIR)
@$(JavacPath)/jar cfe $(BinDIR)/$(JavaOUT) smart.Main -C $(OBJ) .

kwp4peter

2013-04-01 09:45:21

So i'm still wondering why I don't have the same three files as you do in the screnshot:

[ATTACH=CONFIG]20430[/ATTACH]

I know i've re-edited this same post multiple times, thinking that i've fixed it or not. I'm missing something for sure, because I couldn't find two Makefiles, I could only find the one.

jarlekvi

2013-04-21 13:01:37

cant get it to work does anyone want to do help me trough teamviewer?

Brandon

2013-04-21 13:33:16

From: jarlekvi
cant get it to work does anyone want to do help me trough teamviewer?


If you're available right now, I can do it. Just msg me the ID and pass.

bg5

2013-11-22 09:28:13

What jdk version is needed to compile smart 8.3 ? I compiled mine with the newest one 1.7.0_45, but my smart.jar doesn't work properly, throws:

SMART: Failed to pair - No client by that ID
SMART: Failed to pair - No client by that ID
SMART: Failed to pair - No client by that ID

I see Brandon's link pointing to jdk1.6.0_33. Might it be the reason?

Max

2013-12-15 02:33:46

thanks

bg5

2013-12-15 03:58:10

hmm is it normal when copiling SMART?


Compiling Java Classes...
src\Canvas.java:30: warning: CanvasPeer is internal proprietary API and may be r
emoved in a future release
import java.awt.peer.CanvasPeer;
^
src\Canvas.java:85: warning: CanvasPeer is internal proprietary API and may be r
emoved in a future release
CanvasPeer peer = (CanvasPeer)getPeer();
^
src\Canvas.java:85: warning: CanvasPeer is internal proprietary API and may be r
emoved in a future release
CanvasPeer peer = (CanvasPeer)getPeer();
^
src\Main.java:40: warning: AppletClassLoader is internal proprietary API and may
be removed in a future release
* native method definitions and interaction with the remote controller.
^
src\Client.java:665: warning: AppletClassLoader is internal proprietary API and
may be removed in a future release
thisLoader = AppletClassLoader.newInstance(new URL[] { clientConnection.
getJarFileURL() });
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
5 warnings

So my problem is that SMART compiled by me throws this issue:
SMART: Located 0 clients

But when I only replace .jar file with official binary it works. So problem is with my .jar. However it's odd, because looking into the code, pairing part is inside .dll… https://github.com/BenLand100/SMART/blob/master/src/SmartRemote.cpp#L287

Bixby Sayz

2014-03-31 10:07:45

Anyone gotten this to work lately? Trying this on a brand new virtual machine and not having much luck. This is fresh install of Windows 8.1 Pro x64. Nothing has been installed on this machine except Jdk 1.6.0_45 (32-bit), MinGw, and windows updates. Attempting to compile SMART 8.3 located in C:\SMART.

Path settings:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Java\jdk1.6.0\bin;C:\MinGW\bin

Makefile:
#these compilers work with crossdev on gentoo
WIN_GPP=g++
WIN64_GPP=g++
LIN_GPP=g++
LIN64_GPP=g++
JAVAC=javac
JAR=jar

And finally the result:
$ make windows
Compiling Java Classes...
src\Canvas.java:30: warning: java.awt.peer.CanvasPeer is Sun proprietary API and
may be removed in a future release
import java.awt.peer.CanvasPeer;
^
src\Client.java:34: warning: sun.applet.AppletClassLoader is Sun proprietary API
and may be removed in a future release
import sun.applet.AppletClassLoader;
^
src\Canvas.java:85: warning: java.awt.peer.CanvasPeer is Sun proprietary API and
may be removed in a future release
CanvasPeer peer = (CanvasPeer)getPeer();
^
src\Canvas.java:85: warning: java.awt.peer.CanvasPeer is Sun proprietary API and
may be removed in a future release
CanvasPeer peer = (CanvasPeer)getPeer();
^
src\Canvas.java:87: cannot find symbol
symbol : method getAppropriateGraphicsConfiguration(java.awt.GraphicsConfigurat
ion)
location: interface java.awt.peer.CanvasPeer
gc = peer.getAppropriateGraphicsConfiguration(gc);
^
src\Canvas.java:89: cannot find symbol
symbol : method setGraphicsConfiguration(java.awt.GraphicsConfiguration)
location: class java.awt.Component
super.setGraphicsConfiguration(gc);
^
src\Canvas.java:82: method does not override or implement a method from a supert
ype
@Override
^
src\Client.java:665: warning: sun.applet.AppletClassLoader is Sun proprietary AP
I and may be removed in a future release
thisLoader = AppletClassLoader.newInstance(new URL[] { clientConnection.
getJarFileURL() });
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 errors
5 warnings
make: *** [build/java/java/awt/Canvas.class] Error 1

Brandon

2014-03-31 11:06:29

From: Bixby Sayz
Jdk 1.6.0_45 (32-bit).

Makefile:

make: *** [build/java/java/awt/Canvas.class] Error 1



Java 7 is required to compile AND run the new Smart. It cannot be compiled with anything lower.. It cannot be ran with anything lower. Updated the OP.

I will update this tutorial later with the latest Mingw-x32_x64. For now, it should still work with the Mingw you have and Java 7.

Bixby Sayz

2014-03-31 11:36:06

I knew I was missing something simple. Just didn't know what.

Edit: Got further with Jdk 7. It created the .jar file but balked compiling the dlls.
$ make windows
Compiling Java Classes...
src\Canvas.java:30: warning: CanvasPeer is internal proprietary API and may be r
emoved in a future release
import java.awt.peer.CanvasPeer;
^
src\Canvas.java:85: warning: CanvasPeer is internal proprietary API and may be r
emoved in a future release
CanvasPeer peer = (CanvasPeer)getPeer();
^
src\Canvas.java:85: warning: CanvasPeer is internal proprietary API and may be r
emoved in a future release
CanvasPeer peer = (CanvasPeer)getPeer();
^
src\Main.java:40: warning: AppletClassLoader is internal proprietary API and may
be removed in a future release
* native method definitions and interaction with the remote controller.
^
src\Client.java:665: warning: AppletClassLoader is internal proprietary API and
may be removed in a future release
thisLoader = AppletClassLoader.newInstance(new URL[] { clientConnection.
getJarFileURL() });
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
5 warnings
Creating JAR Archive...
Compiling SmartRemote.cpp
In file included from src/SmartRemote.cpp:20:0:
src/SmartRemote.h:149:71: error: declaration of C function 'bool DllMain(HINSTAN
CE, int, void*)' conflicts with
extern "C" bool DllMain(HINSTANCE, int, void*) __attribute__((stdcall));
^
In file included from c:\mingw\include\windows.h:62:0,
from src/SmartRemote.h:55,
from src/SmartRemote.cpp:20:
c:\mingw\include\winbase.h:1051:13: error: previous declaration 'BOOL DllMain(HI
NSTANCE, DWORD, LPVOID)' here
BOOL WINAPI DllMain(HINSTANCE, DWORD, LPVOID);
^
make: *** [build/windows32/SmartRemote.o] Error 1

Brandon

2014-03-31 12:30:15

From: Bixby Sayz
…



Open and make the following changes in the corresponding files:


/**SmartRemote.cpp (line 1381):**/

extern "C" BOOL __stdcall DllMain(HINSTANCE instance, DWORD reason, LPVOID checks)



/**SmartRemote.h (line 149):**/

extern "C" BOOL __stdcall DllMain(HINSTANCE, DWORD, LPVOID)


It should fix any errors you're having. The newer compilers don't seem to be playing as nicely with Smart's source as before.. On windows at least. I'll probably push a commit to fix it and see if Ben accepts it.

Might be something with your compiler though. I just compiled it fine using Java 8 and Mingw-Builds 4.8.1 sjlj

I'm going to update this tutorial now.

Bixby Sayz

2014-03-31 13:01:35

That got me further (on to another error), although the line numbers do differ quite a bit between whatever you are compiling and what I downloaded from the repository. We appear to be working with 2 different sets of source code. Haven't the time to dive into it too deeply atm. I'll give it another go later.

Brandon

2014-03-31 14:41:50

From: Bixby Sayz
That got me further (on to another error), although the line numbers do differ quite a bit between whatever you are compiling and what I downloaded from the repository. We appear to be working with 2 different sets of source code. Haven't the time to dive into it too deeply atm. I'll give it another go later.



Updated the tutorial with every detail and step I took to compile the new Smart. Including links to the JDK and Mingw as well as the MSYS I used. Same with the makefile.

Bixby Sayz

2014-04-01 11:49:44

Those newer instructions did the trick. Wrong Java and wrong MinGW from old tutorial. I didn't stand a chance lol.

riwu

2014-08-24 08:24:00

I compiled SMART http://puu.sh/b5LU2/b2a1b7b090.png
gotten these files http://puu.sh/b5N7I/808ab8cc72.png
but i get a compiling error in simba http://puu.sh/b5MA7/d76a0a08fa.png
any idea?

EDIT:
downloaded the latest mingGW build from http://sourceforge.net/projects/mingwbuilds/files/latest/download?source=files
and JDK 8 and it works now!

intradaydude

2014-09-13 09:27:04

thx so much for this

HT BaaFly

2014-09-21 10:06:31

I still get the error riwu gets even after upgrading to jre8 and installing the latest mingw build. I even get the same file sizes aswell


Edit:
my mingw is: x64-4.8.1-release-posix-sjlj-rev5
my java is: jdk1.8.0_20


@riwu
@Brandon

riwu

2014-09-21 11:16:32

From: HT BaaFly
I still get the error riwu gets even after upgrading to jre8 and installing the latest mingw build. I even get the same file sizes aswell


Edit:
my mingw is: x64-4.8.1-release-posix-sjlj-rev5
my java is: jdk1.8.0_20


@riwu
@Brandon

64bit? Try 32bit.
Also my mingw ver is 4.7.3 rev1.

Cant see ur image too small

HT BaaFly

2014-09-21 11:56:59

From: riwu
64bit? Try 32bit.
Also my mingw ver is 4.7.3 rev1.

Cant see ur image too small


Was that sarcasm? lol.

I installed 4.7.3 rev1 64x like you said but it didn't work either although it gave me different sized dll files. I tried 32x version as well for the sake of it but it give me this bunch of errors:


riwu

2014-09-21 12:11:20

From: HT BaaFly
Was that sarcasm? lol.

I installed 4.7.3 rev1 64x like you said but it didn't work either although it gave me different sized dll files. I tried 32x version as well for the sake of it but it give me this bunch of errors:


What sarcasm? no…ur image is really too small, no 1 can see it. upload it to puush or attach as attachment etc

is ur jdk 32 bit too? Try 32bit mingw+32bit jdk+32bit simba

HT BaaFly

2014-09-21 12:15:01

From: riwu
What sarcasm? no…ur image is really too small, no 1 can see it. upload it to puush or attach as attachment etc

is ur jdk 32 bit too? Try 32bit mingw+32bit jdk+32bit simba


alright, I'll try it later as I have to go study right now. Will till you how it turns out tomorrow. Thanks for you help :D

Brandon

2014-09-21 12:41:29

From: HT BaaFly
alright, I'll try it later as I have to go study right now. Will till you how it turns out tomorrow. Thanks for you help :D


I don't see what the problem is. You don't have any errors in any of the above posts. It compiled perfectly fine. You have warnings not errors.

Check your dist folder for the binaries you just compiled.

HT BaaFly

2014-09-21 13:16:02

From: Brandon
I don't see what the problem is. You don't have any errors in any of the above posts. It compiled perfectly fine. You have warnings not errors.

Check your dist folder for the binaries you just compiled.


I've forgot to mention; it gives me this error:

[ATTACH=CONFIG]24044[/ATTACH]

Brandon

2014-09-21 13:34:05

From: HT BaaFly
I've forgot to mention; it gives me this error:

[ATTACH=CONFIG]24044[/ATTACH]


Ohh okay. Well here's the thing. It compiled fine, everything works fine. You have two choices. Recompile it statically (just change the make file) OR add C:/Mingw/bin to your environment path variable. You basically have a truly dynamic dll. All its dependencies are linked to at run-time. Since C:/Mingw/bin is not in your path, it cannot find the dependencies and so you get that error. If you compile it statically, the dependencies are linked right into the dll. It's still dynamic but now it can be re-distributed and all the dependencies are compiled into it statically (no mingw required for usage).

I personally compile statically because you can redistribute it. If you don't need to then just add Mingw/bin to your path.


To compile it statically (windows only) you need to change the make file's flags:

https://www.diffchecker.com/xad2wi4g


There's a modified copy of the file on the main post. "-static" flag is only needed for windows. Do NOT use it on Linux.

HT BaaFly

2014-09-21 14:09:05

From: Brandon
Ohh okay. Well here's the thing. It compiled fine, everything works fine. You have two choices. Recompile it statically (just change the make file) OR add C:/Mingw/bin to your environment path variable. You basically have a truly dynamic dll. All its dependencies are linked to at run-time. Since C:/Mingw/bin is not in your path, it cannot find the dependencies and so you get that error. If you compile it statically, the dependencies are linked right into the dll. It's still dynamic but now it can be re-distributed and all the dependencies are compiled into it statically (no mingw required for usage).

I personally compile statically because you can redistribute it. If you don't need to then just add Mingw/bin to your path.


To compile it statically (windows only) you need to change the make file's flags:

https://www.diffchecker.com/xad2wi4g


There's a modified copy of the file on the main post. "-static" flag is only needed for windows. Do NOT use it on Linux.


Alright I've just added mingw to my path since it seemed to be easier. It did solve the previous problem but now I am left with another one. Here's a screenie:

[ATTACH=CONFIG]24045[/ATTACH]

I've been wondering, could my 64 bit java be causing this problem? Should I install 32 instead?

riwu

2014-09-21 18:35:29

From: Brandon

I personally compile statically because you can redistribute it. If you don't need to then just add Mingw/bin to your path.


To compile it statically (windows only) you need to change the make file's flags:

https://www.diffchecker.com/xad2wi4g


There's a modified copy of the file on the main post. "-static" flag is only needed for windows. Do NOT use it on Linux.

I only changed
WIN_GPP=g++
WIN64_GPP=g++
and didnt add those -static flags, i can still redistribute it w/o the end users having to download&add mingw to path?

From: HT BaaFly
Alright I've just added mingw to my path since it seemed to be easier. It did solve the previous problem but now I am left with another one. Here's a screenie:

[ATTACH=CONFIG]24045[/ATTACH]

I've been wondering, could my 64 bit java be causing this problem? Should I install 32 instead?

yes AFAIK only 32bit works.

Brandon

2014-09-21 19:05:32

From: riwu
I only changed
WIN_GPP=g++
WIN64_GPP=g++
and didnt add those -static flags, i can still redistribute it w/o the end users having to download&add mingw to path?


yes AFAIK only 32bit works.


@HT BaaFly;

64-bit SMART works though. I know because I have it running. You need a 64-bit Simba to run it. No you need the -static. Without it, it will only work with Mingw installed. It's the same for Microsoft Visual Studio. If you link dynamically, then the user must have .Net framework or w/e libraries you're using but if you compile statically, they don't need anything.

You MIGHT need a 64-bit java to run 64-bit SMART and a 32-bit java for 32-bit SMART. I have both.

riwu

2014-09-22 01:45:48

From: Brandon
@HT BaaFly;

64-bit SMART works though. I know because I have it running. You need a 64-bit Simba to run it. No you need the -static. Without it, it will only work with Mingw installed. It's the same for Microsoft Visual Studio. If you link dynamically, then the user must have .Net framework or w/e libraries you're using but if you compile statically, they don't need anything.

You MIGHT need a 64-bit java to run 64-bit SMART and a 32-bit java for 32-bit SMART. I have both.

Oh i always thought only 32bit java works. But RS runs on 32bit so installing 64bit would make absolutely no difference to performance right?
Would 64bit simba/smart/glhook plugin have better performance than their 32bit counterparts?

I tried using 64bit simba, it said error loading glx64.dll. I compiled the plugin with mingw 64 bit downloaded from here (http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.8.1/64-bit/threads-posix/sjlj/)

Used the same code block. Windows codeblock doesnt separate into 32/64bit right? So what i'm doing wrongly?

HT BaaFly

2014-09-22 10:01:24

I'd just like to report that the problem has been fixed :). It seems that my jdk was 64x and my jre was 32x so that must have been incompatible somehow. What I did was uninstall my jdk 8 64 bit and replace it with 32 bit version. My mingw version is x32 4.7.3 posix sjlj r1

Thank you @Brandon and @riwu :)

Brandon

2014-09-22 13:26:15

From: riwu
Oh i always thought only 32bit java works. But RS runs on 32bit so installing 64bit would make absolutely no difference to performance right?
Would 64bit simba/smart/glhook plugin have better performance than their 32bit counterparts?

I tried using 64bit simba, it said error loading glx64.dll. I compiled the plugin with mingw 64 bit downloaded from here (http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.8.1/64-bit/threads-posix/sjlj/)

Used the same code block. Windows codeblock doesnt separate into 32/64bit right? So what i'm doing wrongly?


That plugin's code blocks file is 32 enabled. Enabled 64 bit by changing the properties to 64 bit under other and linker flags.

riwu

2014-09-25 18:50:53

From: Brandon
That plugin's code blocks file is 32 enabled. Enabled 64 bit by changing the properties to 64 bit under other and linker flags.

Succeeded in loading the plugin, but a number defaults to int64 in 64bit simba? So most of the overloaded methods of which the param is declared 'TIntegerArray' will not work when you pass raw values to it…

procedure a(b: TIntegerArray);
begin
end;

procedure a(); overload;
begin
end;

begin
a([1,2]);
end.

Error: Don't know which overloaded method to call with params (array [0..1] of Int64)

@Dgby714 @Wizzup? @nielsie95
Any solution to this?
Like making the type 'Integer' as int64 in 64bit (and to declare a 32bit u have to use 'int32'?), or ability to override a type (so that the script can specify overriding integer to int64)?

Brandon

2014-09-25 19:12:41

From: riwu
Succeeded in loading the plugin, but a number defaults to int64 in 64bit simba? So most of the methods of which the param is declared 'Integer' rather than 'int64' will not work…

Error: Don't know which overloaded method to call with params (array [0..4] of Int64, array [0..4] of Int64, array [0..4] of Int64)

@Dgby714 @Wizzup? @nielsie95
Any solution to this?
Like making the type 'Integer' as int64 in 64bit (and to declare a 32bit u have to use 'int32'?), or ability to override a type (so that the script to specify overriding integer to int64)?



What? What do you mean by "number"?

If you mean:

1. Integer is automatically promoted to Int64.
2. Float/Single is promoted to Double.

Then the answer is that such a thing.. should NEVER happen UNLESS Integer is an alias/typedef for the native integral type.. I haven't seen a language do this before (though Microsoft's Windows.h header does that for SOME types).

I can't really see Integer being promoted to Int64 rather than being Int32 in Simba. A cast could fix such a thing. I don't have a 64-bit Simba to test so see below..


Run the following:


begin
writeln(sizeof(Integer));
writeln(sizeof(Single));
writeln(sizeof(Int32));
writeln(sizeof(Int64));
writeln(sizeof(Extended));
writeln(sizeof(Double));
end.

What is the output?

Olly

2014-09-25 19:33:50

From: riwu
…


You have to cast it, You have to cast any param if there's a overload and your creating a static array / type thing.

[1, 2] could be extended, integers, or even variants, Lape doesn't even try to guess or figure it out.

slacky

2014-09-25 19:41:36

From: Brandon
What? What do you mean by "number"?

If you mean:

1. Integer is automatically promoted to Int64.
2. Float/Single is promoted to Double.

Then the answer is that such a thing.. should NEVER happen UNLESS Integer is an alias/typedef for the native integral type.. I haven't seen a language do this before (though Microsoft's Windows.h header does that for SOME types).

I can't really see Integer being promoted to Int64 rather than being Int32 in Simba. A cast could fix such a thing. I don't have a 64-bit Simba to test so see below..


Run the following:


begin
writeln(sizeof(Integer));
writeln(sizeof(Single));
writeln(sizeof(Int32));
writeln(sizeof(Int64));
writeln(sizeof(Extended));
writeln(sizeof(Double));
end.

What is the output?


He simply means that
WriteLn(SizeOf( 1 ));
will default at the native integral size.
So for 64bit simba that will of course be 8 bytes (Int64)

As for the question:
Casting it so that Lape knows each index is int32 should work fine:
a(TIntegerArray([1,5]));

You should also know about the NativeInt type it's a native integral type, so in 64bit simba it's 64bit, while on 32bit it's 32bit.. :)

Brandon

2014-09-25 19:59:51

From: slacky
You should also know about the NativeInt type it's a



Ahh I see. It's a "what"? I think that's a typo. But perhaps you are trying to say that it's a 64-bit in on 64-bit Simba and 32-bit otherwise.

slacky

2014-09-25 20:33:07

From: Brandon
Ahh I see. It's a "what"? I think that's a typo. But perhaps you are trying to say that it's a 64-bit in on 64-bit Simba and 32-bit otherwise.

Yeah, fixed.. Donno what happened.

riwu

2014-09-26 06:49:46

The include wasn't written to support 64bit simba though, so all the arguments are not cast to int32.
Is it worth the effort of editing the entire include to make it work on 64bit simba?
What benefit do 64bit simba+64bit smart/java have?


I was thinking if a compiler directive/override can be added to Simba to change the NativeInt, then there won't be a need to edit the entire include?

tls

2014-09-26 13:21:45

From: riwu
The include wasn't written to support 64bit simba though, so all the arguments are not cast to int32.
Is it worth the effort of editing the entire include to make it work on 64bit simba?
What benefit do 64bit simba+64bit smart/java have?


I was thinking if a compiler directive/override can be added to Simba to change the NativeInt, then there won't be a need to edit the entire include?


The only benefit I can think of is the ability to allocate more memory to smart.

Brandon

2014-09-26 16:14:50

From: tls
The only benefit I can think of is the ability to allocate more memory to smart.


True but there's a little bit more that can and does happen.


A slight bit more than that actually. If the exports and include used PtrUInt or Int64 on a 64-bit machine, the efficiency and performance could be improved and that's because:

1. There would be no padding of lesser than 32-bit types to go through the BUS.
2. It can use the memory and CPU more efficiently.
3. It doesn't matter that a 64-bit type is larger. It's the native integral type.

https://www.daniweb.com/software-development/cpp/threads/425643/size_t-vs-unsigned-intsshorts-pointers#post1820089
In addition to the padding, it has to go through Window's WOW64 subsystem: http://en.wikipedia.org/wiki/WoW64


TLDR: 64-bit programs perform better on the 64-bit system than on a 32-bit system. On Linux you can't do this unless you install the subsystem separately and it's almost never recommended (sudo apt-get install ia32-libs).

riwu

2014-09-27 02:47:43

@Brandon
When i tried to compile 64bit smart i get:

My PATH: C:\mingw\bin; C:\Program Files\Java\jdk1.6.0_45\bin
MingW ver: x64-4.8.1-posix-seh-rev5

It seems like the msys couldn't detect my 64bit JDK? I couldn't find a msys that is 64bit though.
Also notice the title of the cmd is 'MINGW32', even though my MingW is 64bit?

Brandon

2014-09-27 04:34:27

From: riwu
..



Doesn't matter. There is a problem with your makefile or environment. MSYS doesn't have to be any specific bit. It's just there for invocation. So long as the make file has -m64 in it, it will compile SMART as x64 as long as mingw/gcc/g++ is x64.

-m32 specifies you're compiling as ix86.
-m64 specifies you're compiling as x86_64.

for all Fortran, C, & C++ programs.

The makefile &/or your env-path specifies your jdk locaiton, not msys or mingw. If it isn't found, check your make file and env-path again for the location to your java compiler's BIN folder.

If you're sure everything is right and your env-path is correct, then change the make variables to the following:


path_to_jdk=C:/blah/blah/jdk1.blah
JAVAC=path_to_jdk/bin/javac
JAR=path_to_jdk/bin/jar

riwu

2014-09-27 06:14:50

From: Brandon
Doesn't matter. There is a problem with your makefile or environment. MSYS doesn't have to be any specific bit. It's just there for invocation. So long as the make file has -m64 in it, it will compile SMART as x64 as long as mingw/gcc/g++ is x64.

-m32 specifies you're compiling as ix86.
-m64 specifies you're compiling as x86_64.

for all Fortran, C, & C++ programs.

There's no -m32 in the SMART MakeFile
I did change -m32 to -m64 for your ogl plugins which compiled fine.

Changed JAVAC and JAR path (no path_to_jdk), same result
http://paste.villavu.com/raw/6408/

Tried WIN64_GPP=C:\mingw\bin\g++ as well, doesn't work either

Or do i have to add a line that is java equivalent of BitFLG = -m64?

Brandon

2014-09-27 11:57:06

From: riwu
There's no -m32 in the SMART MakeFile
I did change -m32 to -m64 for your ogl plugins which compiled fine.

Changed JAVAC and JAR path (no path_to_jdk), same result
http://paste.villavu.com/raw/6408/

Tried WIN64_GPP=C:\mingw\bin\g++ as well, doesn't work either

Or do i have to add a line that is java equivalent of BitFLG = -m64?



There is a makefile near the end and it shows exactly what I mean.

riwu

2014-09-27 12:33:06

From: Brandon
There is a makefile near the end and it shows exactly what I mean.

Not sure what you are referring to but i found the problem…

JAVAC="C:\Program Files\Java\jdk1.6.0_45\bin\javac"
JAR="C:\Program Files\Java\jdk1.6.0_45\bin\jar"
I didn't add the quotation marks for the path previously…

It still output as libsmartjni32.dll but i guess i'd just have to change the name to libsmartjni64.dll.
Thanks for the help!

EDIT: oh in the previous post u meant for me to add the variable path_to_jdk, not to find and edit it :duh:

Brandon

2014-09-27 17:19:33

From: riwu
Not sure what you are referring to but i found the problem…

JAVAC="C:\Program Files\Java\jdk1.6.0_45\bin\javac"
JAR="C:\Program Files\Java\jdk1.6.0_45\bin\jar"
I didn't add the quotation marks for the path previously…

It still output as libsmartjni32.dll but i guess i'd just have to change the name to libsmartjni64.dll.
Thanks for the help!

EDIT: oh in the previous post u meant for me to add the variable path_to_jdk, not to find and edit it :duh:



Lol. This is a problem with WINDOWS.

It's why the include for SMART replaces all backslashes with forward slashes as shown here: https://github.com/SRL/SRL-6/blob/master/lib/misc/smart.simba#L364


On windows, if a path has a backslash, it must be escaped by another backslash or changed to a forward slash. If it has spaces, it must be quoted.

So:

C:\Meh\foo

would become:

C:/Meh/foo OR C:\\Meh\\foo

And this is not just for programming. It's also for CMD, diskpart, and all the other command line utilities.

If it is:

C:/Program Files/meh/foo

it must become:

"C:/Program Files/meh/foo"

I don't remember if the same behaviour applies on linux but I do it anyway.

But anyway, glad it all worked out.

riwu

2014-10-03 22:16:39

So after a few days of experimenting with 64 bit java, i realize it's taking twice as much memory as 32bit java:
730mb after just logging in to game. 32bit would only use 300mb+.

I downgrade to 32bit java and try to run 64bit simba + 64bit smart plugins + 32bit java but got this error:
** Smart Cannot Spawn Clients ** retrying…

So i'm back on 32bit everything :(

MariusK

2015-03-30 22:25:11

Brandon, thank you for this guide! Worked like a charm.

I tried to do this myself, but after 3 hours of failed attempts decided to google and found this awesome guide. lol.

Just one small thing, I think that you need to keep current libsmartremote32.dll and libsmartjni32.dll files, instead of copying the new ones, because it gave me this:
Error loading C:\Simba\Plugins\libsmartremote32.dll: 
Compiling failed.

Thanks again and yay no more Blocking! :stirthepot:

Brandon

2015-03-30 23:31:25

From: MariusK
Brandon, thank you for this guide! Worked like a charm.

I tried to do this myself, but after 3 hours of failed attempts decided to google and found this awesome guide. lol.

Just one small thing, I think that you need to keep current libsmartremote32.dll and libsmartjni32.dll files, instead of copying the new ones, because it gave me this:
Error loading C:\Simba\Plugins\libsmartremote32.dll: 
Compiling failed.

Thanks again and yay no more Blocking! :stirthepot:



Glad you like it. You must've missed something in the makefile for such an error. Either static linking or -m32 is missing.