Compiling JCEF to 32 bit

Having problems with building or using the JCEF Java binding? Ask your questions here.

Compiling JCEF to 32 bit

Postby Madman101 » Tue Feb 16, 2016 5:25 pm

I've been trying to compile JCEF dlls to 32 bit for the last couple of months (bothered to check again now) but there are build errors. Compiling to 64 bit works fine btw.

Using:
- Windows 7
- JCEF dev trunk
- cef_binary_3.2526.1366.g8617e7c_windows32

With cmake command:
Code: Select all
mkdir jcef_build && cd jcef_build
cmake -G "Visual Studio 12" ..


When opening the msvs project ALL BUILD and building solution with Win32 Release as target I always get the following errors:
Warning 1 warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library C:\Users\User\Desktop\jcef32\src\jcef_build\third_party\cef\win32\libcef_dll\cef_string16.obj libcef_dll_wrapper

Error 2 error LNK2019: unresolved external symbol __imp__JAWT_GetAWT@8 referenced in function "struct HWND__ * __cdecl GetHwndOfCanvas(class _jobject *,struct JNIEnv_ *)" (?GetHwndOfCanvas@@YAPAUHWND__@@PAV_jobject@@PAUJNIEnv_@@@Z) C:\Users\User\Desktop\jcef32\src\jcef_build\native\jni_util_win.obj jcef

Error 3 error LNK1120: 1 unresolved externals C:\Users\User\Desktop\jcef32\src\jcef_build\native\Release\jcef.dll jcef


How can I fix these errors myself (im not used with c++) or what can i do to get them fixed? Also can somebody verify if it's just me or the dev trunk?

Thanks in advance
Last edited by Madman101 on Wed Feb 17, 2016 4:41 am, edited 1 time in total.
Madman101
Newbie
 
Posts: 5
Joined: Tue Feb 16, 2016 5:03 pm

Re: Compiling JCEF to 32 bit

Postby magreenblatt » Tue Feb 16, 2016 6:53 pm

The 64-bit build works for me. I have not tried a 32-bit build.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Compiling JCEF to 32 bit

Postby Madman101 » Wed Feb 17, 2016 4:36 am

Hi Marshall, the 64 bit build works for me too, only the 32 bit build gives me 2 errors in the jcef.dll, it's also the only file left for me to compile to 32 bit so I can alpha release my application and provide users both 32 & 64 bit installs. I tried the same thing a few months ago but the 32 bit build produced the exact same errors (couple of revisions between now and then). So there has to be something wrong in my MSVS settings or with the 32 bit build for windows.
Madman101
Newbie
 
Posts: 5
Joined: Tue Feb 16, 2016 5:03 pm

Re: Compiling JCEF to 32 bit

Postby magreenblatt » Wed Feb 17, 2016 11:04 am

Try googling the missing symbol (JAWT_GetAWT). It seems a lot of people have had similar problems -- perhaps one of the results will suggest a workable solution for you.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Compiling JCEF to 32 bit

Postby Madman101 » Wed Feb 17, 2016 4:58 pm

I seem to have fixed the issue, after doing some googling I realised it was a problem with 32-64bit. The provided jawt.lib was a 64 bit version instead of a 32 bit.

So the solution:
Project > Properties > Linker > All Options > Additional Dependencies

and change
C:\Program Files\Java\jdk1.7.0_79\lib\jawt.lib
C:\Program Files\Java\jdk1.7.0_79\lib\jvm.lib


to
C:\Program Files (x86)\Java\jdk1.7.0_79\lib\jawt.lib
C:\Program Files (x86)\Java\jdk1.7.0_79\lib\jvm.lib
Madman101
Newbie
 
Posts: 5
Joined: Tue Feb 16, 2016 5:03 pm

Re: Compiling JCEF to 32 bit

Postby magreenblatt » Wed Feb 17, 2016 6:06 pm

Perhaps the CMake configuration can be made smart enough to detect the Java install with the correct bitness when both versions are installed.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Compiling JCEF to 32 bit

Postby Madman101 » Thu Feb 18, 2016 3:33 am

That would be great. I guess there are more people like me who only use msvs to write a simple JNI wrapper and are not used to deal with its big amount of settings.
Madman101
Newbie
 
Posts: 5
Joined: Tue Feb 16, 2016 5:03 pm

Re: Compiling JCEF to 32 bit

Postby magreenblatt » Thu Feb 18, 2016 9:56 am

Please add a bug in the JCEF issue tracker.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Compiling JCEF to 32 bit

Postby pradeep » Sat Jul 24, 2021 9:07 am

Error 2 error LNK2019: unresolved external symbol __imp__JAWT_GetAWT@8 referenced in function "struct HWND__ * __cdecl GetHwndOfCanvas(class _jobject *,struct JNIEnv_ *)" (?GetHwndOfCanvas@@YAPAUHWND__@@PAV_jobject@@PAUJNIEnv_@@@Z) C:\Users\User\Desktop\jcef32\src\jcef_build\native\jni_util_win.obj jcef

I found this error, when I have installed JDK 64 bit and want to generate 32-bit JCEF binaries from Microsoft Visual studio.
I have done the below step, and successfully generated

First, install JDK 32 bit, it installed on like "C:\Program Files (x86)\Java\jdk1.8.0_291\bin"
Please set this java 32-bit path on environment variable on user and system "Path"
close visual studio and regenerate from starting according to instruction on https://bitbucket.org/chromiumembedded/ ... uilding.md
So that CMake generates files according to jdk 32 bit and Visual Studio can generate binaries.
pradeep
Newbie
 
Posts: 1
Joined: Sat Jul 24, 2021 8:48 am


Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 25 guests