Trying haxeui-hxwidgets

Hey Dominik,

What problem exactly? Maybe i can help?

Cheers,
Ian

Hey Ian,

i get this problem:

wxbase31u.lib(baselib_appbase.obj) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'x86'

Cheers,
Domi

What platform is this? Windows? What architecture is it (32/64)? Where are you getting your wx libs / dlls from? Are you building them yourself from source?

  • Windows 10 64-Bit

  • wxWidgets from their homepage

I tried to build the sample “00-Blank”

Cheers,
Domi

Have you got the 64 bit dlls / libs from the home page? Or maybe you need to force hxcpp to be 64 bit, i seem to remember that by default it uses 32 bit, ill have a check on my system to see

I dont seem to have anything special on my system to “force” hxcpp to 64 bits (i might be lookin in the wrong place though)… this is my %USERPROFILE%\.hxcpp_config.xml:

<!--

  This file will get included twice - once at the beginning - once at the end.

  The first time though, the "vars" section is parsed, and this is where you can
   set variables to control the setup of the standard compilers and install paths etc.

  The second time, the "exes" section is parsed, and you can modify the linkers/compilers
   by adding flags to these executables.
  
-->

<xml>

  <!-- This section is parses at the beginning of the build .... -->
  <section id="vars">

   <set name="HXCPP_COMPILE_CACHE" value="C:/SDK/hxcpp/cache" />
   <set name="HXCPP_CACHE_MB" value="20000" />

     <!-- Use this to control the SDK used when compiling for iphone/iphonesim, and the
           default is not found, or you wish to use a specific version -->
     <!-- <set name="IPHONE_VER" value="4.2" /> -->

     <!-- If you put all your SDKs in one directory, then you can just set this
          single variable.  If you put them in exactly this place, then you should not
          need to setup anything ! -->
     <set name="SDK_ROOT" value="c:\SDKs\" unless="SDK_ROOT" if="windows" />
     <set name="SDK_ROOT" value="${HOME}/SDKs/" unless="SDK_ROOT" />


     <!-- ANDROID_NDK_ROOT is required for building android binaries. See:
            http://developer.android.com/sdk/ndk/index.html 
            Alternatively, you can set the directory and let hxcpp choose the best one with ANDROID_NDK_DIR 

            if ANDROID_NDK_DIR is not set, or a valid NDK version is not found there, 
             it tries to use the default SDK Manager installation (ndk-bundle directory) 

     <set name="ANDROID_NDK_ROOT" value="${SDK_ROOT}/android-ndk-r6" unless="ANDROID_NDK_ROOT" />
       -->

     <set name="ANDROID_NDK_DIR" value="${SDK_ROOT}" unless="ANDROID_NDK_DIR" />

     <!-- ant is required to build android packages. See:
            http://ant.apache.org/bindownload.cgi -->
     <set name="ANT_HOME" value="${SDK_ROOT}/ant" unless="ANT_HOME" />

     <!-- The ANDROID_SDK is required for building android packages. See
            http://developer.android.com/sdk/index.html -->
     <set name="ANDROID_SDK" value="${SDK_ROOT}/android-sdk" unless="ANDROID_SDK" />

     <!-- The Java development kit (which should include the java runtime) is
         also required for android dev. Make sure to get the 32 bit version! -->

     <set name="JAVA_HOME" value="${SDK_ROOT}/java_jdk" unless="JAVA_HOME" />



     <!-- If you want to control how many compilers get spawned .
          The default will use the number of processors.
          Reducing this to 1 can help deciphering error messages. -->
     <!-- <set name="HXCPP_COMPILE_THREADS" value="1" /> -->

     <!-- Add this if your compiler does not support precompiled headers -->
     <!-- <set name="NO_PRECOMPILED_HEADERS" value="1"/> -->

     <!-- Older versions of gcc do not suport the @file syntax for an obj file list
          and precompiled headers.  Set this if you have these issues -->
     <!-- <set name="GCC_OLD" value="1" /> -->


     <!-- Skip the "stripping" phase.  This will leave extra symbols in you exe, which
          may allow reverse engineering and larger file sizes.  You might want to do
          this to debug some problems though. -->
     <!-- <set name="nostrip" value="1" /> -->

     <!-- Let the system detect the latest version of MSVC on windows
          (otherwise must setup the environment yourself) -->
     <!-- Disable with <set name="NO_AUTO_MSVC" value="1" /> -->
     <!-- To disable specific versions: <setenv name="VS110COMNTOOLS" value="disable" /> -->


  </section>


  <!-- Use this section to add flags to the compilers and linkers -->
  <section id="exes">

     <!-- Compiling on windows ... -->
     <compiler id="MSVC" if="windows">
        <!-- Example adding a build flag -->
        <!-- <flag value = "-Ie:/VS8//PlatformSDK/Include"/> -->
     </compiler>

     <!-- Linking on windows ... -->
     <linker id="dll" if="windows">
        <!-- Add library paths for windows (DirectX needed for building NME) -->
        <!-- <flag value = "-libpath:e:\VS8\DirectXSDK\Lib\x86"/>
        <flag value = "-libpath:e:/VS8/PlatformSDK/Lib"/> -->
     </linker>

     <!-- And for linking executables -->
     <linker id="exe" if="windows">
        <!-- <flag value = "-libpath:e:/VS8/PlatformSDK/Lib"/> -->
     </linker>

  </section>

</xml>

Hm my .hxcpp_config.xml looks the same as yours.

This is the exact issue from Visual Studio Code:

Compiling group: hxcpp_std
cl.exe -nologo /WX- /fp:precise -DHX_WINDOWS -GR -O2(optim-std) -Z7(debug) -Od(debug) -O2(release) -Os(optim-size) -Oy- -c -EHs -GS- -arch:SSE2 -IC:/HaxeToolkit/haxe/lib/hxcpp/4,1,1/include -DHXCPP_VISIT_ALLOCS(haxe) -DHX_SMART_STRINGS(haxe) -DHXCPP_API_LEVEL=400(haxe) -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -wd4996 … tags=[haxe,static]

  • Process.cpp
  • Random.cpp
  • File.cpp
  • Socket.cpp
  • Sys.cpp
    Link: C:/SDK/hxcpp/cache/hxcpp_std/lib/msvc19_cxp_hxcpp_std.lib
    Link: Main.exe
    wxbase31u.lib(baselib_appbase.obj) : fatal error LNK1112: Modul-Computertyp “x64” steht in Konflikt mit dem Zielcomputertyp “x86”.
    Error: Build failed

Cheers,
Domi

What happens if you explicitly tell hxcpp to use 64 bit… i think the flag is -64 or -D 64… something like that anyway

Hey Ian,

i startet vcvarsall.bat in a command prompt with the target x86 and no it works.
This could be added to the README.md.
I used hxcpp and hxwidgets from git.

Cheers,
Domi

1 Like

OK, glad it works, you are however building x86 on a 64 bit system, thats fine (for windows) but you’d probably want to build 64 bit eventually anyway… i wonder if the wx libs you used are the x86 versions

Still, working is working :slight_smile:

2 Likes