Skip to main content

Problem building MR2 on win32_i386

13 replies [Last post]
waynelee
Offline
Joined: 2007-05-31
Points: 0

Hi,

I follow the instruction from the link below to build MR2 for win32_i386 platform, but run into a problem building PCSL. I need to build PCSL successfully in order to continue with CLDC and MIDP.

Link:
http://wiki.java.net/bin/view/Mobileandembedded/PhoneMEBuilding

My build environment:
Windows XP
MS VC++ 6.0
cygwin not cyg4me
JDK 1.6.0
phoneME Feature MR2

My build path:
"/cygdrive/d/cygwin/bin:/cygdrive/f/java/jdk1.6.0/bin:
...cont'd...
/cygdrive/c/progra~1/micros~3/Common/msdev98/bin:/cygdrive/c/progra~1/micros~3/Common/vc98/bin:
...cont'd...
"

My build script:
"
export TOP=/cygdrive/d/mr2
export OUTPUT=/cygdrive/d/mr2/out
export LOG=/cygdrive/d/mr2/log.txt
# make PCSL
cd $TOP/pcsl
make ENABLE_PCSL=true PCSL_PLATFORM=win32_i386_vc PCSL_OUTPUT_DIR=$OUTPUT/pcsl
# make CLDC
cd $TOP/cldc/build/win32_i386
make JDK_DIR=f:/java/jdk1.6.0 ENABLE_PCSL=true \
JVMWorkSpace=$TOP/cldc JVMBuildSpace=$OUTPUT/cldc \
USE_VS2005=true PCSL_OUTPUT_DIR=$OUTPUT/pcsl
# make MIDP
cd $TOP/midp/build/win32
make JDK_DIR=f:/java/jdk1.6.0 TOOLS_DIR=$TOP/tools \
CLDC_DIST_DIR=$OUTPUT/cldc/win32_i386/dist \
USE_VS2005=true PCSL_OUTPUT_DIR=$OUTPUT/pcsl \
MIDP_OUTPUT_DIR=$OUTPUT/midp
"

Error:
"
...
cd /cygdrive/d/mr2/pcsl/print; make all
...
pcsl_print.c
fatal error C1083: Cannot open compiler generated file: '/cygdrive/d/mr2/out/pcsl/win32_i386/obj/pcsl_print.o': No such file or directory
...
"

There is no "pcsl_print.o" file in "out/pcsl/win32_i386/obj" path, so how can I compile the "pcsl_print.c" file?

Thanks,
Wai Ming

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kaam
Offline
Joined: 2007-03-27
Points: 0

You don't need to set USE_VS2005 to true if you use MS VC++ 6.0. The directories are not the same. Try adding these lines to your compilation script:

wmsvc="C:\Program Files\Microsoft Visual Studio"
msvc=`cygpath -d "$wmsvc"`
msvc=`cygpath "$msvc"`
VSCommonDir=${msvc}/Common
MSDevDir=${VSCommonDir}/msdev98
MSVCDir=${msvc}/VC98
export PATH=${MSDevDir}/BIN:${MSVCDir}/BIN:${PATH}
export INCLUDE=${wmsvc}/VC98/INCLUDE
export LIB=${wmsvc}/VC98/LIB

I don't know if JDK 1.6 is a supported version. You should use JDK 1.4.2 to be safe.

waynelee
Offline
Joined: 2007-05-31
Points: 0

Thanks Kaam. This gets me further. Now it complains can not find "stdio.h". But I check the INCLUDE environment and this file is there. I wonder how can I make "make" to pick up this environment variable so that it can find the "stdio.h", as well as other header files?

kaam
Offline
Joined: 2007-03-27
Points: 0

Oops actually it is not better. I thought it was a compilation error but it looks like VC++ complains because the PCSL output directory is in Unix format. Try

make ENABLE_PCSL=true PCSL_PLATFORM=win32_i386_vc PCSL_OUTPUT_DIR=`cygpath -m $OUTPUT/pcsl`

You also need to call fixcygpath for all include directories passed to the VC++ compiler. For example in PCSL\memory\memory_port\GNUmakefile:

$(OUTPUT_OBJ_DIR)/pcsl_memory_port.o: $(MEMORY_PORT_SELECT_DIR)/pcsl_memory_port.c
@$(CC) -I. -I.. [b]-I`$(call fixcygpath, $(MEMORY_PORT_SELECT_DIR))` -I`$(call fixcygpath, $(OUTPUT_INC_DIR))`[/b] \
$(CFLAGS) $(CC_OUTPUT)$@ `$(call fixcygpath, $<)`

You need to do this every time VC++ cannot find an include file.

waynelee
Offline
Joined: 2007-05-31
Points: 0

This suggestion has definitely helped me fixing the compilation problems for PCSL, thanks. Now, I see compilation problem in CLDC, and hope you can give me further suggestions.

Here is the environment variables:
"
export TOP=/cygdrive/d/cygwin/phoneme_feature_mr2
export OUTPUT=/cygdrive/d/cygwin/phoneme_feature_mr2/out
export LOG=/cygdrive/d/cygwin/phoneme_feature_mr2/log.txt
# make CLDC
cd $TOP/cldc/build/win32_i386
export JDK_DIR=/cygdrive/f/java/jdk1.6.0
export ENABLE_PCSL=true
export JVMWorkSpace=$TOP/cldc
export JVMBuildSpace=$OUTPUT/cldc
"

After I type "make", here is the error message:
"
javac: file not found:
\cygdrive\d\cygwin\phoneme_feature_mr2\cldc\src\tools\jcc\JavaCodeCompact.java
...
make: *** [jcc.jar] Error 2
"

I have checked and make sure the "JavaCodeCompact.java" file is in the "/cygdrive/d/cygwin/phonme_feature_mr2/cldc/src/tools/jcc/" path. If I manually "cd" to "/cygdrive/d/cygwin/phonme_feature_mr2/cldc/src/tools/jcc/" path and run "javac JavaCodeCompact.java", I can see it compiled.

aap031
Offline
Joined: 2006-10-18
Points: 0

Hi!

The best way to use cygwin with phoneME Feature build system is to avoid using "/cygdrive" notation at all. To to this you need to create specific cygwin mount point(s). In your case that would be "/cygdrive/d/cygwin" mount as "/cygwin" via "mount -f d:\cygwin /cygwin". After that you need to specify your paths to the build system as /cygwin - it stands correct for both cygwin and win32 programs (assuming your current drive is d:, which should be)

Regards,
Andrey

waynelee
Offline
Joined: 2007-05-31
Points: 0

Hi, I try something similar to your suggestion, which is mounting "d:\cygwin" to "/" in stead of "/cygwin". This doesn't work.

Here is the environment variables after removing /cygdrive/d/cygwin.
export TOP=/phoneme_feature_mr2
export OUTPUT=/phoneme_feature_mr2/out
export LOG=/phoneme_feature_mr2/log.txt

Here is the error messages.
javac: file not found:
\phoneme_feature_mr2\cldc\src\tools\jcc\JavaCodeCompact.java
...
make: *** [tools] Error 2

If I manually "cd" into this path and I can compile "JavaCodeCompact.java" successfully.

aap031
Offline
Joined: 2006-10-18
Points: 0

Hi!

Looks like your solution is not correct - \phoneme_feature_mr2\cldc\src\tools\jcc\JavaCodeCompact.java file name is not correct for win32, it should be \cygwin\phoneme_feature_mr2\cldc\src\tools\jcc\JavaCodeCompact.java, right?

You can mount to "/" but for this case you need to mount "d:\" at "/" for the paths to be the same. This is essential

Regards,
Andrey

waynelee
Offline
Joined: 2007-05-31
Points: 0

Hi,
I tried your suggestion - "mount to "/" but for this case you need to mount "d:\" at "/" for the paths to be the same"; and this works. Now I encounter another error in the process of compiling CLDC; and here is the error message.

"
Generating debug assembly code: ... Interpreter_i386.asm
Generating oopmaps
make[2]: Entering directory '/phoneme_feature_mr2/out/cldc/win32_i386/romgen/app'
ml.exe: not found
make[2]: *** [Interpreter_i386.obj] Error 127
make[2]: Leaving directory '/phoneme_feature_mr2/out/cldc/win32_i386/romgen/app'
make[1]: *** [../../romgen/app/romgen.exe] Error 2
"

I search through my whole HD for "ml.exe", but can not find this file, am I missing something here?

Thanks,
Wai Ming

kaam
Offline
Joined: 2007-03-27
Points: 0
waynelee
Offline
Joined: 2007-05-31
Points: 0

Finally, this build works, thanks. Now, I continue to build for the "javacall" implementation. I see the following error message.

"
...compiling resources ...
d:/phoneme_feature_mr2/javacall/implementation/win32/midp/res/emulator.rc(33) : fatal error RC1015: cannot open include file 'afxres.h'.
make: *** [/phoneme_feature_mr2/out/javacall/lib/emulator.res] Error 1
"

I guess, like suggested before as shown below, that I need to add "fixcygpath" to a GNUMakefile.
"
-I`$(call fixcygpath, $(MEMORY_PORT_SELECT_DIR))`
"
I've checked the GNUMakefile for building "javacall" and it is quite different so I don't know where to add this. Can you give me some idea?

Thanks,
Wai Ming

waynelee
Offline
Joined: 2007-05-31
Points: 0

I tried to export the path of "afxres.h" as followed, but it didn't work.
export INCLUDE=${MSVCDir}/INCLUDE:${MSVCDir}/MFC/INCLUDE
So, I solved this by copying "afxres.h" to where "stdio.h" located. Now I see other problems.
"
...compiling resources ...
d:/phoneme_feature_mr2/javacall/implementation/win32/midp/res/emulator.rc (119): error RC2135 : file not found: emulator.ico
d:/phoneme_feature_mr2/javacall/implementation/win32/midp/res/emulator.rc (125): error RC2135 : file not found: phoneH.bmp
d:/phoneme_feature_mr2/javacall/implementation/win32/midp/res/emulator.rc (126): error RC2135 : file not found: phoneV.bmp
make: *** [/phoneme_feature_mr2/out/javacall/lib/emulator.res] Error 3
"
I found these files in "javacall-com", so I exported JAVACALL_PROJECT_DIR as followed, but this didn't help.
export JAVACALL_PROJECT_DIR=/phoneme_feature_mr2/javacall-com

What can I do to make the compiler finding these files?

waynelee
Offline
Joined: 2007-05-31
Points: 0

I just found a fix for this problem as well. Cheers.

junaid88
Offline
Joined: 2010-04-05
Points: 0

hi

i am facing the same problem . if you find solution so please let me know

C:/mr4/phoneme_feature/javacall/implementation/win32_emul/midp/res/emulator.rc(3
3) : fatal error RC1015: cannot open include file 'afxres.h'.
make: *** [C:/mr4/phoneme_feature/build_output/javacall/lib/emulator.res] Error
1
make: Leaving directory `C:/mr4/phoneme_feature/javacall-com/configuration/phone
MEFeature/win32_emul'

i have VC++ 2005 express edition ,
is there is anyone have platform available in which we could easily run that or is there is anyone have solution for this please tell me

Regards
junaid