Skip to main content

SourceROMWriter.hpp - JVMSourceObjectWriter has not been declared

14 replies [Last post]
selenau
Offline
Joined: 2006-10-11

Hi and thanks for releasing midp2.0/cldc1.1 (bored playing with old RI).

I keep getting the same error when trying to build for my custom build arm board. any clue?

generating ../generated/NativesTable.cpp ...
... BSDSocket.cpp
... FloatSupport_arm.cpp
... HotRoutines0.cpp
... HotRoutines1.cpp
... JarFileUncommon.cpp
... KniUncommon.cpp
... Main_linux.cpp
... NativesTable.cpp
... OS_linux.cpp
... OsFile.cpp
... OsFile_linux.cpp
... OsMemory.cpp
... OsMemory_linux.cpp
... OsMisc_linux.cpp
... OsSocket_linux.cpp
... PCSLSocket.cpp
copying empty ROMImage.cpp
... ROMImage.cpp
... ReflectNatives.cpp
... _MergedSrc001.cpp
... _MergedSrc002.cpp
... _MergedSrc003.cpp
/work/pxa/phoneME/feature-mr1/src/phoneME_feature/cldc/src/vm/share/ROM/SourceROMWriter.hpp:99: error: 'JVMSourceObjectWriter' has not been declared

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
selenau
Offline
Joined: 2006-10-11

prefix errors still on the trunk. is it my compiler's fault?

selenau
Offline
Joined: 2006-10-11

I tried a few more times but still same error.

when I grep thru the sources (fgrep -r "JVMSourceObjectWriter" .)

found only

cldc/src/vm/share/utilities/GlobalDefinitions.hpp:#define SourceObjectWriter JVMSourceObjectWriter

and nothing else.

any clue?

a_pangin
Offline
Joined: 2006-10-20

Hi and thank you for the question.
I guess the reason is in C++ compiler's behaviour.
Please have a look at SourceROMWriter.hpp:
SourceObjectWriter class is declared in the same file but below the first reference to it.
You may try to add a forward declaration at the very top of the file like

class SourceObjectWriter;

Let me know if this helps anyhow.

P.S. Regarding your last question:
All classes in VM sources are seen by compiler with 'JVM' prefix: JVMCompiler, JVMMethod, JVMSourceObjectWriter etc.
(this is made to prevent name conflicts with the code built on top of CLDC). But it's not comfortable to write all names with JVM prefix in the source code - that's why there is a bunch of #define directives in GlobalDefinitions.hpp like
#define SourceObjectWriter JVMSourceObjectWriter

selenau
Offline
Joined: 2006-10-11

Error fixed, when "class SourceObjectWriter;" is declared on top the file.

Btw I'm using GCC 3.3.2.

Some more errors I encountered.

cldc/src/vm/cpu/c/Bytes_c.hpp 95 100 lines

static inline jushort Bytes::swap_u2(jushort x) {
static inline juint Bytes::swap_u4(juint x) {

I have to remove "Bytes::" prefix in order to continue.

My work directory was prefixed inside classes.zip folders so I have to create classes.zip file manually.

and done compiling cldc.

thanks.

stuart_marks
Offline
Joined: 2006-08-24

Andrei (a_pangin),

Do you think selenau's changes should be integrated? If so, I think they should probably go into MR2 [not yet migrated to java.net] and it's probably not worth it to issue an update to MR1.

s'marks

a_pangin
Offline
Joined: 2006-10-20

Right, I ascertained that the changes in SourceROMWriter.hpp and Bytes_c.hpp are already made in MR2.

BTW, I still don't see how files in classes.zip could appear with a prefix.
selenau, I'll appreciate much if you could send me your verbose build log (made with VERBOSE_BUILD=true)

selenau
Offline
Joined: 2006-10-11

@a_pangin
Here is what you asked :)

After "VERBOSE_BUILD=true make"
I realized classes.zip created via /usr/local/j2sdk1.4.2_12/bin/jar -cfM0 /work/pxa/phoneME/feature-mr1/build/arm_linux//classes.zip -C /work/pxa/phoneME/feature-mr1/build/arm_linux//classes .

I do it manually again and "unzip -l /work/pxa/phoneME/feature-mr1/build/arm_linux//classes.zip"
responded:
...
work/pxa/phoneME/feature-mr1/build/arm_linux/classes/./javax/microedition/io/StreamConnectionNotifier.class

I examined "jar -cfM0 ... -C ..." and just for curiosity, tried:

/usr/local/j2sdk1.4.2_12/bin/jar -cfM0 /work/pxa/phoneME/feature-mr1/build/arm_linux//classes.zip -C /work/pxa/phoneME/feature-mr1/build/arm_linux/classes .

and it worked well with no prefixes inside classes.zip.

So problem is about second / before classes.zip and I don't know if it is my fault because of the environment variables.

a_pangin
Offline
Joined: 2006-10-20

Ok, thank you.
It looks like your JVMBuildSpace variable ends with "/".
Actually it should not.

Good luck!

selenau
Offline
Joined: 2006-10-11

date: 09/02/2007 from cldc trunk (linux_bvd build);

... FloatSupport_arm.cpp
/work/pxa/phoneME/source/cldc/trunk/src/vm/cpu/arm/Disassembler_arm.hpp:73: error: extra qualification 'JVMDisassembler::' on member 'wmmx_align_name'

... HotRoutines0.cpp
/work/pxa/phoneME/source/cldc/trunk/src/vm/cpu/arm/CodeOptimizer_arm.hpp:216: error: extra qualification 'JVMCodeOptimizer::' on member 'JVMCodeOptimizer'
/work/pxa/phoneME/source/cldc/trunk/src/vm/cpu/arm/CodeOptimizer_arm.hpp:241: error: extra qualification 'JVMCodeOptimizer::' on member \u2018reorganize\u2019
/work/pxa/phoneME/source/cldc/trunk/src/vm/cpu/arm/CodeOptimizer_arm.hpp:264: error: extra qualification 'JVMCodeOptimizer::' on member 'depends_of_memory_on_ins'

I had to remove prefixes to continue.

manhattan
Offline
Joined: 2006-11-14

Did you check if the file was preprocessed correctly ? I had a problem with the same workaround because the compiler was truncating the result of a macro expansion.

selenau
Offline
Joined: 2006-10-11

because we had a conversation about this issue previously, I don't think it is because of preprocessing.

stuart_marks
Offline
Joined: 2006-08-24

Hi, thanks for your interest! Yeah, the RI is pretty old at this point....

I haven't run into this problem, but I built by pulling the sources over from the repository. Did you do that, or did you unpack the bundle? (I haven't tried the bundle yet.)

s'marks

selenau
Offline
Joined: 2006-10-11

how do you pull the sources? which sources did you pull? (lots of dirs...)

stuart_marks
Offline
Joined: 2006-08-24

@selenau

The link to browse sources on the web is:

https://phoneme.dev.java.net/source/browse/phoneme/

The root URL you can use with svn clients is:

https://phoneme.dev.java.net/svn/phoneme

The repository should be open to the public for read-only access. Most of the source code is within the "components" subdirectory. It sounds like you're interested in the "cldc" component. Note that each component has its own trunk/branches/tags structure. Although this version of the sources isn't undergoing active development at the moment, but we're going to be migrating active development soon, so I recommend not getting into the habit of pulling from the trunk. Try the tag with the highest build number. In this case the URL would be:

https://phoneme.dev.java.net/svn/phoneme/components/cldc/tags/cldc_mr1_p...

At some point I'll post information about the structure of the repository. It's rather obscure.

s'marks