Skip to main content

Linker errors when compiling CLDC (MR3) for Javacall-Win32 platform

29 replies [Last post]
randomaniac777
Offline
Joined: 2008-11-11

I'm trying to build the basic CLDC executable for the Win32 platform (WinXP). I'm using the Visual C++ 2008 toolset.

I've got JavaCall and PCSL (on top of JavaCall) building successfully. But when I try to build CLDC, compilation succeeds and then it fails with the following linker errors:

javacall.lib(main.obj) : error LNK2005: _main already defined in Main_javacall.obj
javacall.lib(time.obj) : error LNK2019: unresolved external symbol __imp__timeSetEvent@20 referenced in function _javacall_time_initialize_timer
javacall.lib(time.obj) : error LNK2019: unresolved external symbol __imp__timeKillEvent@4 referenced in function _javacall_time_finalize_timer
javacall.lib(network.obj) : error LNK2019: unresolved external symbol __imp__PostMessageA@16 referenced in function _javacall_socket_close_start
javacall.lib(events.obj) : error LNK2019: unresolved external symbol __imp__DispatchMessageA@4 referenced in function _checkForEvents
javacall.lib(events.obj) : error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function _checkForEvents
javacall.lib(events.obj) : error LNK2019: unresolved external symbol __imp__PeekMessageA@20 referenced in function _checkForEvents
javacall.lib(events.obj) : error LNK2019: unresolved external symbol _javanotify_datagram_event referenced in function _WndProc@16
javacall.lib(events.obj) : error LNK2019: unresolved external symbol _javanotify_server_socket_event referenced in function _WndProc@16
javacall.lib(events.obj) : error LNK2019: unresolved external symbol __imp__DefWindowProcA@16 referenced in function _WndProc@16
javacall.lib(events.obj) : error LNK2019: unresolved external symbol _javanotify_socket_event referenced in function _WndProc@16
javacall.lib(events.obj) : error LNK2019: unresolved external symbol _javanotify_shutdown referenced in function _WndProc@16
javacall.lib(lime_events.obj) : error LNK2001: unresolved external symbol _javanotify_shutdown
...

There are a lot more than I've shown here, and they all originate within the javacall library.

Has anybody else encountered this problem? Or does anybody know what could be going wrong here?

Note: I've set USE_VS2005=true for both PCSL and CLDC.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
luberengae
Offline
Joined: 2008-10-20

in the middle of CLDC build will try that as soon as it's finished building

randomaniac777
Offline
Joined: 2008-11-11

On http://forums.java.net/jive/thread.jspa?threadID=53073&tstart=45 I found:

"did you set jsr135 and jsr 234 variable before you built the javacall api ?"

And in the license.txt that comes with sublime.dll it states:

"Your use of the JSR135 mQ object library and related C++ API
header file (mQ_JSR-135.h) and/or JSR234 mQ Object Library and
related C++ API header file (mQ_JSR234.h) shall be governed by
QSound's evaluation license agreement for such libraries and
files (LICENSE #3)."

I'm guessing that enabling JSR 135 and perhaps 234 might help.

luberengae
Offline
Joined: 2008-10-20

oops ... haven't tried that.. do bear with me... i'll give it a shot and see what happens. thought i'd start without adding the optional API's didn't say that there were any JSR's required to build it. so i didn't bother.

luberengae
Offline
Joined: 2008-10-20

these are my setting

OS : XP Home Edition SP3
cl.exe : 14.00.50727.42
ml.exe : 6.15.8803
make : 3.78.1
java: 1.4.2_17-b06

detailed version

E:\jwc\mr3vc8>make -version
GNU Make version 3.78.1, by Richard Stallman and Roland McGrath.
Built for Windows32
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

Report bugs to .

E:\jwc\mr3vc8>cl
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]

E:\jwc\mr3vc8>ml
Microsoft (R) Macro Assembler Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.

usage: ML [ options ] filelist [ /link linkoptions]
Run "ML /help" or "ML /?" for more info

E:\jwc\mr3vc8>link
Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.

usage: LINK [options] [files] [@commandfile]

options:

/ALIGN:#
/ALLOWBIND[:NO]
/ALLOWISOLATION[:NO]
/ASSEMBLYDEBUG[:DISABLE]
/ASSEMBLYLINKRESOURCE:filename
/ASSEMBLYMODULE:filename
/ASSEMBLYRESOURCE:filename[,[name][,PRIVATE]]
/BASE:{address[,size]|@filename,key}
/CLRIMAGETYPE:{IJW|PURE|SAFE}
/CLRSUPPORTLASTERROR[:{NO|SYSTEMDLL}]
/CLRTHREADATTRIBUTE:{STA|MTA|NONE}
/CLRUNMANAGEDCODECHECK[:NO]
/DEBUG
/DEF:filename
/DEFAULTLIB:library
/DELAY:{NOBIND|UNLOAD}
/DELAYLOAD:dll
/DELAYSIGN[:NO]
/DLL
/DRIVER[:{UPONLY|WDM}]
(press to continue)
/ENTRY:symbol
/ERRORREPORT:{NONE|PROMPT|QUEUE|SEND}
/EXPORT:symbol
/FIXED[:NO]
/FORCE[:{MULTIPLE|UNRESOLVED}]
/FUNCTIONPADMIN[:size]
/HEAP:reserve[,commit]
/IDLOUT:filename
/IGNOREIDL
/IMPLIB:filename
/INCLUDE:symbol
/INCREMENTAL[:NO]
/KEYCONTAINER:name
/KEYFILE:filename
/LARGEADDRESSAWARE[:NO]
/LIBPATH:dir
/LTCG[:{NOSTATUS|PGINSTRUMENT|PGOPTIMIZE|PGUPDATE|STATUS}]
/MACHINE:{ARM|EBC|IA64|MIPS|MIPS16|MIPSFPU|MIPSFPU16|
SH4|THUMB|X64|X86}
/MANIFEST[:NO]
/MANIFESTDEPENDENCY:manifest dependency
/MANIFESTFILE:filename
/MAP[:filename]
/MAPINFO:{EXPORTS}
(press to continue)
/MERGE:from=to
/MIDL:@commandfile
/NOASSEMBLY
/NODEFAULTLIB[:library]
/NOENTRY
/NOLOGO
/NXCOMPAT[:NO]
/OPT:{ICF[=iterations]|NOICF|NOREF|NOWIN98|REF|WIN98}
/ORDER:@filename
/OUT:filename
/PDB:filename
/PDBSTRIPPED:filename
/PGD:filename
/PROFILE
/RELEASE
/SAFESEH[:NO]
/SECTION:name,[[!]{DEKPRSW}][,ALIGN=#]
/STACK:reserve[,commit]
/STUB:filename
/SUBSYSTEM:{CONSOLE|EFI_APPLICATION|EFI_BOOT_SERVICE_DRIVER|
EFI_ROM|EFI_RUNTIME_DRIVER|NATIVE|POSIX|WINDOWS|
WINDOWSCE}[,#[.##]]
/SWAPRUN:{CD|NET}
/TLBID:#
(press to continue)
/TLBOUT:filename
/TSAWARE[:NO]
/VERBOSE[:{ICF|LIB|REF|SAFESEH}]
/VERSION:#[.#]
/WINDOWSCE:{CONVERT|EMULATION}
/WX[:NO]

E:\jwc\mr3vc8>java -version
java version "1.4.2_17"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_17-b06)
Java HotSpot(TM) Client VM (build 1.4.2_17-b06, mixed mode)

E:\jwc\mr3vc8>which java
/cygdrive/e/j2sdk1.4.2_17/bin/java

E:\jwc\mr3vc8>which javac
/cygdrive/e/j2sdk1.4.2_17/bin/javac

E:\jwc\mr3vc8>

randomaniac777
Offline
Joined: 2008-11-11

My settings:

OS: XP Pro + SP2

cl.exe: 15.00.21022.08
ml.exe: 9.00.21022.08
make: 3.78.1, by Richard Stallman and Roland McGrath
link: 9.00.21022.08
java: build 1.4.2_14-b05

luberengae
Offline
Joined: 2008-10-20

oops ... haven't tried that.. do bear with me... i'll give it a shot and see what happens. thought i'd start without adding the optional API's didn't say that there were any JSR's required to build it. so i didn't bother.

Have you tried it with 135 and 234..

luberengae
Offline
Joined: 2008-10-20

quick question what is the filesize you got for sublime.dll and last modified date? if you can

randomaniac777
Offline
Joined: 2008-11-11

Mine is 32 KB, last modified on 07/05/2008.

luberengae
Offline
Joined: 2008-10-20

seems to be the same as mine.. I'm stuck at exactly the same place with SUBLIME_PROC_ID error..I tried to copy sublime.dll from WTK2.5.2 to the lime directory and use it in the build but it came up with a function error. i'm just rebuilding the system with a few changes i've seen elsewhere hoping for the best.. will let you know how it goes.

luberengae
Offline
Joined: 2008-10-20

my email is ed@eibrok.net send me your system settings and some screen shots may be toghether we can sort it out

yevgenydiomidov
Offline
Joined: 2006-08-07

"Ultimately it would be good to incorporate the manifest file into the EXE during build time using the mt.ext tool."

See midp/src/ams/example/jams/runMidlet.gmk
mt is used if USE_VS2005=true

randomaniac777
Offline
Joined: 2008-11-11

Thanks, that did the trick. I had used VS_2005=true for Javacall, PCSL and CLDC but hadn't thought about doing it for midp.

Now I just need to get this SUBLIME_PROC_ID error sorted out.

luberengae
Offline
Joined: 2008-10-20

may i ask if you've successfully impemented javacall_win32 using WTK2.5.2

randomaniac777
Offline
Joined: 2008-11-11

I'm not sure if it's mandatory to include JSRs 135 and 234 but since I can't think of any anything else I'm going to try building with them for now, atleast to rule them out as causes if nothing else.

135 needs the DirectX SDK installed.

luberengae
Offline
Joined: 2008-10-20

i got DIRECT X 9 installed.

randomaniac777
Offline
Joined: 2008-11-11

Added JSR 135, rebuilt, and am still getting the SUBLIME_PROC_ID error. Am now going to add JSR 234 as well.

randomaniac777
Offline
Joined: 2008-11-11

Nope, adding JSRs 135 and 234 makes no difference :(

luberengae
Offline
Joined: 2008-10-20

i thought that the options JSR would not affect the basic build. I can't find anywhere in the documentation that states the JSR's that are required to make it work with WTK.

Is there anyone we can speak to or are we just supposed to pray like mad.. complete screen shots would be nice.

randomaniac777
Offline
Joined: 2008-11-11

I've tried everything short of replacing Visual C++ 2008 with the 2005 version. Still no luck. And because we can't get hold of the source code for the lime library and because there isn't much documentation on it anyway it's too difficult and time consuming to work out why it's throwing that error.

For now I'm building without Javacall. So far I've got the emulator running fine. Maybe I'll try the toolset change I've mentioned above later on.

luberengae
Offline
Joined: 2008-10-20

my new settings

OS windows 2000 sp4
cl.exe 12.00.8804
ml.exe 6.15.8803
link.exe 6.00.8447
java 1.4.2_13
make 3.78.1

WTK 2.5.2
WTK and WTK_STORAGE installed works like a charms pleased as punch to infinity and beyond thanks for all you help

problem seems to be in the difference in the way window 2000 professional and windows XP load *.dll's thanks for all your help

to infinity and beyond dancing around like a mad man drinking too much champagne as i have just got over my biggest hurdle hope the rest will be plain sialing

talk soon

jenser78
Offline
Joined: 2006-05-05

Hello,

I have the same problem with SUBLIME_PROC_ID. I use VS 2008 under WinXP Professional SP3. Is there anybody out there, who solved the issue? I don't want to change my OS.

randomaniac777
Offline
Joined: 2008-11-11

Also, when building the midp stack with Visual C++ 2008 the runMidlet.exe has a dependency on MSVCR90.DLL, which is located in the WinSxS cache. The runMidlet.exe.manifest file that lies in the same folder as runMidlet.exe is crucial for runMidlet.exe to work.

So when you copy /WTK and /WTK_STORAGE over to your WTK installation you'll have to manually copy this manifest file into the same folder as zayit.exe (this is just runMidlet.exe renamed) and then rename it to zayit.exe.manifest.

Otherwise when you run emulator.exe you'll get an error stating that MSVCR90.DLL can't be found.

Ultimately it would be good to incorporate the manifest file into the EXE during build time using the mt.ext tool.

luberengae
Offline
Joined: 2008-10-20

sounds like music to my ears... will try it out and see how it goes..
sounds like its going to work thanks a mill let you know how it goes

randomaniac777
Offline
Joined: 2008-11-11

Got it working.

I think my local copy of the MR3 distribution had somehow gotten corrupted. Downloaded and unzipped a fresh copy from https://phoneme.dev.java.net/downloads_page.html#feature and now it all works.

luberengae
Offline
Joined: 2008-10-20

have.. you tried to incorporate your build into Java's wireless Toolkit successfully. I built mine fine and everything seems ok when i copy the contents of the resulting WTK and WTK_STORAGE folders i get an error failed to locate sublime.dll when i try to run the batch file runPhoneME.bat

when i try to run any application from the wireless TOOLKIT i get the following error.
a SUBLIME variable can not be found and crashes the application

any advice , tips or tricks you could pass on.
NB: the build only produces zayit.exe there is no zayit.dll to go with it.
does it matter?

akz003
Offline
Joined: 2006-10-13

Folks,

have you found the Building Guides from the following link:
https://phoneme.dev.java.net/content/mr3/index_feature.html

The Build Guide is located following by the link:
http://java.sun.com/javame/reference/docs/sjwc-2.1/pdf-html/html/build/i...

The chapter describn how to run in WTK is here:
http://java.sun.com/javame/reference/docs/sjwc-2.1/pdf-html/html/build/w...

Regards
Kostya

luberengae
Offline
Joined: 2008-10-20

I don't mean to sound like an utter numb skull... idiot... dumb dumb... but i've followed it to the letter without much luck... could you do me a humongous favour and send me details of your build.. with screen shots if possible to ed@eibrok.net as i'm totally lost on this on.

I've installed every compiler out there VC++ 6 professional with service pack 5 tried adding processor pack 5, tried using visual studio .NET 2003, tried visual studio 2005 so no point in trying 2008 because they all build fine but when i copy the files from WTK and WTK_STORAGE to the appropriate locations they sample that come with WTK fail to run.

please advise. may be i'm just dumb

randomaniac777
Offline
Joined: 2008-11-11

Yep, I've been following the build guide word for word but haven't yet got the emulator running successfully.

I also got the "sublime.dll" message when I ran midp\runPhoneME.bat. I realised that you need sublime.dll to be present in midp\bin\i386 because it's the runMidlet.exe executable in there that gets called from runPhoneME.bat.

Now when I run runPhoneME.bat I get the following output:

[CRIT] [core ] Illegal argument to KVM: internal

I read in the guide (http://java.sun.com/javame/reference/docs/sjwc-2.0-web/docs/ToolsGuide-h...) that calling runMidlet.exe on its own should bring up the application manager

when I do this I get:

Could not read environment variable SUBLIME_PROC_ID

If I following through the build guide and copy /WTK and /WTK_STORAGE into the right places and invoke the WTK emulator.exe I still get the above SUBLIME_PROC_ID error.

randomaniac777
Offline
Joined: 2008-11-11

Ok, I've reduced the number of errors by adding the following to cldc\build\javacall_i386_vc\javacall_i386_vc.cfg:

LINK_FLAGS += `$(call fixcygpath_m, $(JAVACALL_LIB_DIR)/javacall$(BUILD_EXT_javacall).lib)`
LINK_FLAGS += `$(call fixcygpath_m, $(JAVACALL_LIB_DIR)/sublime.lib)`
LINK_FLAGS += user32.lib
LINK_FLAGS += winmm.lib
LINK_FLAGS += /NODEFAULTLIB:LIBC
LINK_FLAGS += /NODEFAULTLIB:MSVCRT

Now the remaining errors are nearly all to do with javanotify functions:

javacall.lib(main.obj) : error LNK2005: _main already defined in Main_javacall.obj
javacall.lib(events.obj) : error LNK2019: unresolved external symbol _javanotify_datagram_event referenced in function _WndProc@16
javacall.lib(events.obj) : error LNK2019: unresolved external symbol _javanotify_server_socket_event referenced in function _WndProc@16
javacall.lib(events.obj) : error LNK2019: unresolved external symbol _javanotify_socket_event referenced in function _WndProc@16
javacall.lib(events.obj) : error LNK2019: unresolved external symbol _javanotify_shutdown referenced in function _WndProc@16
javacall.lib(lime_events.obj) : error LNK2001: unresolved external symbol _javanotify_shutdown
javacall.lib(lime_events.obj) : error LNK2019: unresolved external symbol _javanotify_pause referenced in function _SendEvent
javacall.lib(lime_events.obj) : error LNK2019: unresolved external symbol _javanotify_resume referenced in function _SendEvent
javacall.lib(lime_events.obj) : error LNK2019: unresolved external symbol _javanotify_switch_to_ams referenced in function _SendEvent
javacall.lib(lime_events.obj) : error LNK2019: unresolved external symbol _javanotify_key_event referenced in function _SendEvent
javacall.lib(lcd.obj) : error LNK2001: unresolved external symbol _javanotify_key_event
javacall.lib(lime_events.obj) : error LNK2019: unresolved external symbol _javanotify_rotation referenced in function _SendEvent
javacall.lib(lime_events.obj) : error LNK2019: unresolved external symbol _javanotify_pen_event referenced in function _SendEvent
javacall.lib(main.obj) : error LNK2019: unresolved external symbol _JavaTask referenced in function _main
javacall.lib(main.obj) : error LNK2019: unresolved external symbol _javanotify_start referenced in function _main
javacall.lib(main.obj) : error LNK2019: unresolved external symbol _javanotify_start_java_with_arbitrary_args referenced in function _main
javacall.lib(main.obj) : error LNK2019: unresolved external symbol _javanotify_list_storageNames referenced in function _main
javacall.lib(main.obj) : error LNK2019: unresolved external symbol _javanotify_list_midlets referenced in function _main
javacall.lib(main.obj) : error LNK2019: unresolved external symbol _javanotify_transient referenced in function _main
javacall.lib(main.obj) : error LNK2019: unresolved external symbol _javanotify_remove_suite referenced in function _main
javacall.lib(main.obj) : error LNK2019: unresolved external symbol _javanotify_install_midlet_wparams referenced in function _main
javacall.lib(main.obj) : error LNK2019: unresolved external symbol _javanotify_start_suite referenced in function _main
javacall.lib(main.obj) : error LNK2019: unresolved external symbol _javanotify_start_local referenced in function _main
javacall.lib(main.obj) : error LNK2019: unresolved external symbol _javanotify_set_heap_size referenced in function _main
javacall.lib(main.obj) : error LNK2019: unresolved external symbol _javanotify_set_vm_args referenced in function _main
../bin/cldc_vm_g.exe : fatal error LNK1120: 22 unresolved externals