Compiling with mysql

ezer andres.a@adinet.com.uy
Wed Aug 27 13:33:00 GMT 2008


I saw that simply compiling the mysql jar is when i get that error.

>>gcj mysql-connector-java-5.0.8-bin.jar -findirect-dispatch 

/usr/lib/gcc/i486-linux-gnu/4.3.1/../../../../lib/crt1.o: In function
`_start':
(.text+0x18): undefined reference to `main'
/tmp/ccUb1RSI.o: In function `com::mysql::jdbc::Buffer*
com::mysql::jdbc::MysqlIO::reuseAndReadPacket(com::mysql::jdbc::Buffer*)':
mysql-connector-java-5.0.8-bin.jar:(.text+0x1798cb): undefined reference to
`.L16237'
mysql-connector-java-5.0.8-bin.jar:(.text+0x179917): undefined reference to
`.L16242'
collect2: ld returned 1 exit status


I think there are some basic steps that i am missing to make a gcj build....
any ideas ? must i compile the mysql jar outside my classes jar ?


ezer wrote:
> 
> 1) ok, I used the option  -findirect-dispatch
> 2) I also updated gcj to 4.3
> gcj --version
> gcj (Ubuntu 4.3.1-8ubuntu1) 4.3.1
> 
> 3) I generated in windows using 
> Eclipse 
> jdk1.5.0_16
> mysql-connector-java-5.0.8-bin.jar
> 
> Then the jar file i compile in the ubuntu machine getting the following
> error
> 
> gcj --main=SearchManager -o search Searcher.jar -findirect-dispatch
> /tmp/cc5qITfH.o: In function `com::mysql::jdbc::Buffer*
> com::mysql::jdbc::MysqlIO::reuseAndReadPacket(com::mysql::jdbc::Buffer*)':
> Searcher.jar:(.text+0x3b40e5): undefined reference to `.L53607'
> Searcher.jar:(.text+0x3b4131): undefined reference to `.L53612'
> collect2: ld returned 1 exit status
> 
> 
> 
> 
> Marco Trudel-4 wrote:
>> 
>> ezer wrote:
>>> I am using JavaNativeCompiler from windows and also gcj form ubuntu
>>> 
>>> 1) When i delete the references to com.mysql and the mysql lib from the
>>> project, i can compile without problems.
>>> 
>>> 2)
>>> I tryed to include a class as sugested in some place:
>>> public class ForceInclude {
>>> 	private static final Class class1 = com.mysql.jdbc.Driver.class;
>>> 
>>> 	ForceInclude() {
>>> 	}
>>> }
>> 
>> There's no problem with not included classes here. So that's not needed.
>> 
>>> 3) Compiling with JavaNativeCompiler from windows generating code only
>>> for
>>> linux
>>> "undefined reference to `java::util::Iterator*
>>> java::sql::SQLException::iterator()"
>> 
>> You are still providing insufficient information to efficiently help 
>> you. What version of JavaNativeCompiler are you using? What version of 
>> mysql? Where can it be downloaded? How did you compile?
>> 
>> Guessing all this, I now took
>> - JNC v1.1.1 with gcc-122233-win (compiles for Windows)
>> - MySQL Connector/J 5.1 from http://dev.mysql.com/downloads/#connector-j
>> and tried to compiled the jar. java.sql.SQLClientInfoException does not 
>> yet exist in GCJ (indeed it's quite new that class).
>> 
>> So, downgraded to MySQL Connector/J 5.0. Here some com.mchange classes 
>> and org.jboss classes are missing. Using -findirect-dispatch helps here 
>> and should solve the problem (I guess these classes are never needed at 
>> runtime since a Sun JRE doesn't have them either).
>> 
>> 
>>> 4) Compiling the same file from ubuntu with gcj compiler containing lib 
>>> libgcj-4.2.jar i get:
>>> cannot find file for class java.sql.Connection
>> 
>> This class exists in recent GCJs. What version are you using? Please
>> update.
>> 
>> 
>> Again: Please, always add all information so that people willing to help 
>> you can fully reproduce the problem.
>> 
>> 
>> Hope that helps
>> Marco
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Compiling-with-mysql-tp19092090p19181034.html
Sent from the gcc - java mailing list archive at Nabble.com.



More information about the Java mailing list