Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2] 3 4 ... 6
  ignore  |  Print  
  [RTS] Clash Tune : tune your armies, clash enemies !  (Read 13780 times)
0 Members and 1 Guest are viewing this topic.
Offline titoasty
« Reply #30 - Posted 2013-10-10 09:00:45 »

@titoasty
I'm downloading xcode now. When will you upload the source code?

I'm working on it !
But careful, you'll need a jdk installed because the compilation requires some java libraries..

Offline SHC
« Reply #31 - Posted 2013-10-10 11:36:11 »

@titoasty
I've downloaded your source and ran these commands from the terminal.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
localhost:src sriharshachilakapati$ gcc -I"/System/Library/Frameworks/JavaVM.framework/Headers" -c floodfill.c jumppointsearch.c main.c queue.c
localhost:src sriharshachilakapati$ gcc -dynamiclib -o libpathfinder.jnilib floodfill.o jumppointsearch.o main.o queue.o
Undefined symbols for architecture x86_64:
  "_init_queue", referenced from:
      _floodfill in floodfill.o
  "_jumpPointSearch", referenced from:
      _Java_com_clashtune_pathfind_Pathfinder_jumpPointSearchNative in main.o
     (maybe you meant: _Java_com_clashtune_pathfind_Pathfinder_jumpPointSearchNative)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This is my first experience with C. Can you say what is going wrong?

Offline phu004

JGO Coder


Medals: 4
Projects: 9
Exp: 10 years


NoSuchPersonException


« Reply #32 - Posted 2013-10-10 12:34:40 »

Quote
You mean "game units" drawn on the UI, not in game ? They are sprites created from blocks.

The screen shot from the opening post shows trees, units being rendered as 3D objects, but when I tried to to add stuff in the editor, everything is rendered as sprite. 
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline titoasty
« Reply #33 - Posted 2013-10-10 17:01:23 »

@titoasty
I've downloaded your source and ran these commands from the terminal.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
localhost:src sriharshachilakapati$ gcc -I"/System/Library/Frameworks/JavaVM.framework/Headers" -c floodfill.c jumppointsearch.c main.c queue.c
localhost:src sriharshachilakapati$ gcc -dynamiclib -o libpathfinder.jnilib floodfill.o jumppointsearch.o main.o queue.o
Undefined symbols for architecture x86_64:
  "_init_queue", referenced from:
      _floodfill in floodfill.o
  "_jumpPointSearch", referenced from:
      _Java_com_clashtune_pathfind_Pathfinder_jumpPointSearchNative in main.o
     (maybe you meant: _Java_com_clashtune_pathfind_Pathfinder_jumpPointSearchNative)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This is my first experience with C. Can you say what is going wrong?

Oh, I thought you had experience with. Sorry but I really can't help you with that... I'll try to compile it for mac another way ! Wink

Offline titoasty
« Reply #34 - Posted 2013-10-10 17:02:27 »

Quote
You mean "game units" drawn on the UI, not in game ? They are sprites created from blocks.

The screen shot from the opening post shows trees, units being rendered as 3D objects, but when I tried to to add stuff in the editor, everything is rendered as sprite. 

My bad, I put a link to the wrong archive... I just fixed that... Goodbye 2D ! Smiley
The correct link : http://goo.gl/SohjYx
Have fun !

Offline SHC
« Reply #35 - Posted 2013-10-10 17:05:45 »

I'm too curious to learn what is the problem. Can you give the command line with which you compiled for windows? This is because I can compile a hello world application with no errors.

Offline titoasty
« Reply #36 - Posted 2013-10-10 17:17:48 »

I'm too curious to learn what is the problem. Can you give the command line with which you compiled for windows? This is because I can compile a hello world application with no errors.

I used Eclipse CDT with Mingw to compile, sooo didn't use the command line directly
Perhaps could you try with Eclipse CDT too ?

Offline SHC
« Reply #37 - Posted 2013-10-10 17:47:34 »

I'm going to try creating a project in xcode. I ran those command lines from a JNI tutorial which is actually for linux but I thought the commands would be the same.

Offline titoasty
« Reply #38 - Posted 2013-10-10 17:49:27 »

I sent you some command lines by message, hope it'll help you !

Offline SHC
« Reply #39 - Posted 2013-10-10 17:58:13 »

Using multiple source files, it had the same error with the command lines you sent. So I merged all the source into one file, fixed some includes. Now one of the two errors is gone. The output is

1  
2  
3  
4  
5  
6  
7  
8  
localhost:pathfinderosx sriharshachilakapati$ gcc -I/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers -O3 -Wall -c -fmessage-length=0 -o pathfinder.o pathfinder.c
localhost:pathfinderosx sriharshachilakapati$ gcc -D_JNI_IMPLEMENTATION_ -Wl, -shared -o libpathfinder.dylib pathfinder.o -framework JavaVM
Undefined symbols for architecture x86_64:
  "_jumpPointSearch", referenced from:
      _Java_com_clashtune_pathfind_Pathfinder_jumpPointSearchNative in pathfinder.o
     (maybe you meant: _Java_com_clashtune_pathfind_Pathfinder_jumpPointSearchNative)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'm going to retest tomorrow morning.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline titoasty
« Reply #40 - Posted 2013-10-10 18:08:24 »

Using multiple source files, it had the same error with the command lines you sent. So I merged all the source into one file, fixed some includes. Now one of the two errors is gone. The output is

1  
2  
3  
4  
5  
6  
7  
8  
localhost:pathfinderosx sriharshachilakapati$ gcc -I/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers -O3 -Wall -c -fmessage-length=0 -o pathfinder.o pathfinder.c
localhost:pathfinderosx sriharshachilakapati$ gcc -D_JNI_IMPLEMENTATION_ -Wl, -shared -o libpathfinder.dylib pathfinder.o -framework JavaVM
Undefined symbols for architecture x86_64:
  "_jumpPointSearch", referenced from:
      _Java_com_clashtune_pathfind_Pathfinder_jumpPointSearchNative in pathfinder.o
     (maybe you meant: _Java_com_clashtune_pathfind_Pathfinder_jumpPointSearchNative)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'm going to retest tomorrow morning.

I think this is because you need to link all the files in one command line.
The problem is that pathfinder.o can't find the jumpSearch function, so you should to compile each file separately, THEN link all the files in one command :

gcc -D_JNI_IMPLEMENTATION_ -Wl, -shared -o libpathfinder.dylib pathfinder.o main.o jumppointsearch.o floodfill.o queue.o -framework JavaVM

Offline SHC
« Reply #41 - Posted 2013-10-11 04:55:18 »

Thanks for the command-lines but still no luck.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
localhost:src sriharshachilakapati$ gcc -I/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers -O3 -Wall -c -fmessage-length=0 -o queue.o queue.c
localhost:src sriharshachilakapati$ gcc -I/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers -O3 -Wall -c -fmessage-length=0 -o jumppointsearch.o jumppointsearch.c
localhost:src sriharshachilakapati$ gcc -I/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers -O3 -Wall -c -fmessage-length=0 -o floodfill.o floodfill.c
localhost:src sriharshachilakapati$ gcc -I/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers -O3 -Wall -c -fmessage-length=0 -o main.o main.c
localhost:src sriharshachilakapati$ gcc -D_JNI_IMPLEMENTATION_ -Wl -dynamiclib -o libpathfinder.dylib queue.o main.o jumppointsearch.o floodfill.o
Undefined symbols for architecture x86_64:
  "_init_queue", referenced from:
      _floodfill in floodfill.o
  "_jumpPointSearch", referenced from:
      _Java_com_clashtune_pathfind_Pathfinder_jumpPointSearchNative in main.o
     (maybe you meant: _Java_com_clashtune_pathfind_Pathfinder_jumpPointSearchNative)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I've created a JNI Project in Xcode and copied these source files into it. Same errors there as well.



Can I ask a question on StackOverflow?

Offline titoasty
« Reply #42 - Posted 2013-10-11 09:30:40 »

Yes, if you want.
Gosh, you are so near from the solution..

Offline SHC
« Reply #43 - Posted 2013-10-11 10:07:32 »

@titoasty
I posted the question here.

Offline masteryoom

JGO Coder


Medals: 5
Projects: 2


If you look closely, you might see it turning...


« Reply #44 - Posted 2013-10-11 10:11:45 »

Just a question, @titoasty, I don't know why you can't just make a jar file with the mac osx libs inside it?

EDIT:
or the linux libs, for that matter.

Smiley
Offline SHC
« Reply #45 - Posted 2013-10-11 10:13:30 »

@masteryoom
He didn't have a mac to compile his native libs. I'm having trouble getting them to work since I never used libraries in C.

Offline masteryoom

JGO Coder


Medals: 5
Projects: 2


If you look closely, you might see it turning...


« Reply #46 - Posted 2013-10-11 10:14:33 »

Can't he just send you the source code?

EDIT:
It looks like someone made referencing errors... thats as far as I can see

Smiley
Offline SHC
« Reply #47 - Posted 2013-10-11 10:15:25 »

@masteryoom
It's his source code that I'm trying to compile. He sent the code to me by message.

Offline masteryoom

JGO Coder


Medals: 5
Projects: 2


If you look closely, you might see it turning...


« Reply #48 - Posted 2013-10-11 10:16:40 »

Isn't this made in Java?  Clueless

Smiley
Offline SHC
« Reply #49 - Posted 2013-10-11 10:17:41 »

@masteryoom
He used JNI to load some native libraries. It's the JNI library I'm trying to compile.

Offline titoasty
« Reply #50 - Posted 2013-10-11 10:18:40 »

Can't he just send you the source code?

EDIT:
It looks like someone made referencing errors... thats as far as I can see


I sent SHC the source code.
The problem is that I have a native lib in C for pathfinding, and I don't have a mac (or even linux) to compile the library. Stucked under windows !

Offline SHC
« Reply #51 - Posted 2013-10-11 10:26:24 »

@titoasty
Can you say what steps you did to do it on windows? I've installed CDT as well but MinGW isn't available for macs. The only compiler that exists for mac is the Apple GCC.

Offline titoasty
« Reply #52 - Posted 2013-10-11 10:54:14 »

Nothing special...
I installed Mingw, then Eclipse CDT which recognized Mingw.
And then I created a new C++ project and everything compiled easily.
I really don't understand why there is this problem..

Offline SHC
« Reply #53 - Posted 2013-10-11 11:08:10 »

@titoasty
Same result with the CDT too. Maybe this is a related to Apple's linker.

Offline SHC
« Reply #54 - Posted 2013-10-11 11:56:18 »

It built successfully! The IDE is using Objective C compiler as default for some reason. Changing the language to C++ in the settings made it work. Can you say how can I test the library? It's named
libpathfinder.dylib

Offline titoasty
« Reply #55 - Posted 2013-10-11 11:59:38 »

Oh god, so cool !!!
Please send me the file and I'll prepare you a mac version ! Smiley

Offline SHC
« Reply #56 - Posted 2013-10-11 12:03:44 »

It's here. http://www.weebly.com/uploads/2/7/9/6/2796142/libpathfinder.dylib

Will you give me a credit?

Offline titoasty
« Reply #57 - Posted 2013-10-11 12:06:24 »


Haha yes for sure !
With "SHC" or another name ?

Offline SHC
« Reply #58 - Posted 2013-10-11 12:06:53 »

As Sri Harsha Chilakapati (SHC). Thanks!

Offline SHC
« Reply #59 - Posted 2013-10-11 12:20:46 »

Works perfectly!



Do you want me to create a mac app bundle?

Pages: 1 [2] 3 4 ... 6
  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.

CogWheelz (18 views)
2014-07-30 21:08:39

Riven (25 views)
2014-07-29 18:09:19

Riven (15 views)
2014-07-29 18:08:52

Dwinin (13 views)
2014-07-29 10:59:34

E.R. Fleming (33 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (43 views)
2014-07-24 01:59:36

Riven (43 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (31 views)
2014-07-23 20:56:16
List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54
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!