We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
OpenGL in library (Read 3780 times)
OpenGL in library
May 15th, 2010, 5:55am
 
Hello,

I'm trying to use OpenGL in a library.

I'm using Eclipse on Vista.

I've added opengl.jar, jogl.jar, gluegen-rt.jar, gluegen-rt.dll, jogl_awt.dll, jogl_cg.dll and jogl.dll to my projects libs folder and the added opengl.jar, jogl.jar and gluegen-rt.jar to my build path.

When I try to build the library using ant I get an error saying that it  cannot find symbol  : class PGraphicsOpenGL, and an error saying package processing.opengl does not exist.

When I'm in the editor I don't get any errors come up when importing processing.opengl.* so I don't know why it's not being found when building the library.

Any ideas?

Thanks

Re: OpenGL in library
Reply #1 - May 15th, 2010, 10:02am
 
I suspect you have already done this but just in case you haven't also add core.jar to the build path.

Re: OpenGL in library
Reply #2 - May 15th, 2010, 10:09am
 
Hi Quark,

Thanks for the response but yes I've already added core.jar to the build path.
Re: OpenGL in library
Reply #3 - May 17th, 2010, 7:31am
 
Re: OpenGL in library
Reply #4 - May 17th, 2010, 4:13pm
 
Hi,

I've removed all the opengl stuff from my library. Looks like this issue was concealing another. I have other libraries that cannot be found (errors are thrown but the library builds successfully).

I just want to make sure I'm going through the motions:

1) I stick the jar files in the libs directory
2) I add them to the build path
3) I edit build.properties and add the jar files to classpath.local.include=core.jar, externallibs.jar ...

Is this correct, am I missing something. WHen I build none of the libs other than core.jar seem to be found
Re: OpenGL in library
Reply #5 - May 18th, 2010, 12:32am
 
In your Eclipse project under Referenced Libraries can you see the jar files? If not then they have not successfully been added to the build path.
Quote:
I have other libraries that cannot be found (errors are thrown but the library builds successfully).

What are the other libraries?
What are the errors, if the project builds OK?
Re: OpenGL in library
Reply #6 - May 18th, 2010, 10:35am
 
I assume you are using the library template provided by Processing. If so then in the Eclipse project under resources open up the build.xml in Section 3 it asks for the jar files required for compiling. This maybe why it is not picking up on the other libraries you mentioned.

I can't promise that this is causing your problems but it might be worth including the libraries here.
Re: OpenGL in library
Reply #7 - May 19th, 2010, 3:22am
 
Hi,

I'm trying to make alterations to an existing library called hemesh. It uses another library called geom. When I build I get an error 'package wblut.geom does not exist' followed by 'cannot find symbol' errors for each of the classes used from geom. However the whole process finishes with the message 'BUILD SUCCESSFUL'.

I've edited the build.properties file and have the line:

classpath.local.include=core.jar,geom.jar

Is this what you mean? I can't see the section 3 your referring to in build.xml

I'm using the Processing library template, downloaded it a few days ago.

Thanks for all your help so far
Re: OpenGL in library
Reply #8 - May 19th, 2010, 12:49pm
 
Below is the first 20 or so lines of the build.xml file from the Shapes3D library which shows the section 3 I am talking about.

Code:
<project name="Shapes3D" default="build" basedir="../">

<description>
processingLibs. ant build file.
</description>


<!-- #### (1) where are your processing libraries located? edit location. #### -->
<property name="processing" location="../../Processing/libraries"/>


<!-- #### (2) where are the jar files located that are required for compiling
your library such as e.g. core.jar ? edit location. #### -->

<property name="libraryClasspath" location="../libs"/>
<path id="library-classpath">
<fileset dir="${libraryClasspath}" >
<!-- #### (3) add the jar files that are required for compiling. edit name.
for more include files. duplicate <include name="" /> #### -->
<include name="core.jar"/>
</fileset>
</path>


<!-- #### (4) set the java version that should be used to compile your library. #### -->
<property name="javaVersion" value="1.5"/>



The
Re: OpenGL in library
Reply #9 - May 20th, 2010, 2:35am
 
Hi,

I seem to have a different build.xml. I got it from the processing-library-template on googlecode.

Includes seem to be on line 54 of build.xml

Code:
	<path id="classpath">
<fileset dir="${classpath.local.location}" includes="${classpath.local.include}" />
<fileset dir="${classpath.libraries.location}" includes="**/*.jar" />
<fileset dir="${project.lib}" includes="**/*.jar" />
</path>


With the values being taken from line 49 of build.properties
Code:

classpath.local.include=core.jar,geom.jar


I'm going to try and get a different template and have a go with that.
Re: OpenGL in library
Reply #10 - May 20th, 2010, 5:42am
 
hi moesian, you are using the latest template - with this template all build properties have been removed from the build.xml file and put into the build.properties file.
i just tried what you described - on a mac though - with the latest template and works ok when i create a new WB_Line object for testing. my classpath.local.include
Code:

classpath.local.include=core.jar,geom.jar

if i remove geom.jar from classpath.local.include, i get errors and the console will tell me that the build failed.

i assume, the error message you are getting refers to a warning message when compiling the build.xml file in normal mode (line 84: project.compile=normal) when the javadoc is created and added to the distribution. you are probably seeing something like this:
Code:

[javadoc] ... .java:45: package wblut.geom does not exist

its a warning message which is thrown by javadoc since it cant find a reference to the wblut.geom package (which can more or less be ignored), but this is only relevant for the javadoc command, not for compiling the source of your library.
since the console output says 'build successful', your library has been compiled properly and should work. did you give it a try? it should appear in your sketchbook/libraries folder. (no need to change the build.xml file, the properties file should do the job)
best,
andreas



Re: OpenGL in library
Reply #11 - May 20th, 2010, 5:44am
 
The Processing library template is stored in googlecode so I suspect it has changed since I last downloaded it.

Re: OpenGL in library
Reply #12 - May 20th, 2010, 5:57am
 
@quark, updateded it earlier this month. but the older version still works fine.
@moesian, to add opengl to your classpath, put opengl.jar and jogl.jar into your libs folder (the path is defined in property classpath.local.location inside the build.properties file), then add opengl.jar and jogl.jar to the classpath.local.include property
Code:

classpath.local.include=core.jar,opengl.jar,jogl.jar

(you still need to add the opengl related .jar files to your eclipse-project's 'Java Build Path' properties separately)
Re: OpenGL in library
Reply #13 - May 22nd, 2010, 1:39pm
 
Ok, I've got everything working. A nice way to get opengl working is to create a project using proclipsing and import the template archive into that. Thanks for you help
Page Index Toggle Pages: 1