Lime 3.0.0 can not create static :/

Hello guys, I have readden all communities of OpenFL 4.0.0 and 3.0.0 wow it is new version.

I have downloaded github same version Lime 3.0.0,
I replace from 3,0,0 ( installed Lime 3.0.0 ) to 3,0,0_bkp, I create directory 3,0,0 and I copy from lime3_github to 3,0,0 and I copy from 3,0,0_bkp to 3,0,0
Than I type command:
lime rebuild windows -clean
It compiles fine.
lime rebuild windows -debug -clean for debug mode of lime
It compiles fine.

I want to -static
lime rebuild windows -static -clean
than it shows error message:

  • Link : …/ndll/Windows/liblime.lib
    ce0daa78_cairo-freed-pool.obj : 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
    ce0daa78_cairo-fixed.obj : 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

What do I miss sometimes?
How do I fix it? I want static mode of lime app without many files of mainlimeapp.exe

“Windows” -> Fine
"Windows -debug" -> Fine
"Windows -static" -> Failed but lib is here
"Windows -static -debug" -> Failed but lib is here

I try lime build windows -static than it gets error. I already check ndl/windows/liblime.lib still exist. Why does it happen with liblime.lib has error of library.

  • Link : libApplicationMain.lib
  • Compiling group ‘main’ with flags -nologo -DHX_WINDOWS -GR -O2(optim-std) -Zi(debug) -FdC:\Users\Jens\napetest\Export\windows\cpp\release\obj\obj/msvc16-stat-ncxp/vc.pdb(debug) -Od(debug) -O2(release) -Os(optim-size) -Oy- -c -EHs -GS- -arch:SSE -ID:/Binaries/HaxeToolkit/haxe/lib/hxcpp/3,3,49/include -DSTATIC_LINK(static) -DHXCPP_VISIT_ALLOCS(haxe) -DHXCPP_API_LEVEL=321(haxe) -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -DHX_WIN_MAIN(main) -wd4996 tags=[haxe,static]
  • Compile : Main.cpp
  • Link : Main.exe
    Creating library Main.lib and object Main.exp
    f9a59cb0_Main.obj : error LNK2019: unresolved external symbol _regexp_register_prims referenced in function _WinMain@16
    libApplicationMain.lib(1b37f06c_RunLibs.obj) : error LNK2001: unresolved external symbol _regexp_register_prims
    f9a59cb0_Main.obj : error LNK2019: unresolved external symbol _std_register_prims referenced in function _WinMain@16
    libApplicationMain.lib(1b37f06c_RunLibs.obj) : error LNK2001: unresolved external symbol _std_register_prims
    Main.exe : fatal error LNK1120: 2 unresolved externals
    Error: error running link.exe -out:Main.exe -nologo -machine:x86 -subsystem:windows,5.01 -libpath:lib user32.lib @obj/msvc16-stat-ncxp/all_objs D:\Binaries\HaxeToolkit\haxe\lib/lime/3,0,0/ndll/Windows/liblime.lib gdi32.lib opengl32.lib user32.lib kernel32.lib advapi32.lib winmm.lib imm32.lib ole32.lib oleaut32.lib version.lib ws2_32.lib wldap32.lib shell32.lib comdlg32.lib libApplicationMain.lib

And for lime build windows -debug -static ->

  • Link : Main-debug.exe
    Creating library Main-debug.lib and object Main-debug.exp
    2d3db8d2_Main.obj : error LNK2019: unresolved external symbol _regexp_register_prims referenced in function _WinMain@16
    libApplicationMain-debug.lib(d9cda6b8_RunLibs.obj) : error LNK2001: unresolved external symbol _regexp_register_prims
    2d3db8d2_Main.obj : error LNK2019: unresolved external symbol _std_register_prims referenced in function _WinMain@16
    libApplicationMain-debug.lib(d9cda6b8_RunLibs.obj) : error LNK2001: unresolved external symbol _std_register_prims
    Main-debug.exe : fatal error LNK1120: 2 unresolved externals
    Error: error running link.exe -out:Main-debug.exe -nologo -machine:x86 -debug -subsystem:windows,5.01 -libpath:lib user32.lib @obj/msvc16-stat-debug-ncxp/all_objs D:\Binaries\HaxeToolkit\haxe\lib/lime/3,0,0/ndll/Windows/liblime-debug.lib gdi32.lib opengl32.lib user32.lib kernel32.lib advapi32.lib winmm.lib imm32.lib ole32.lib oleaut32.lib version.lib ws2_32.lib wldap32.lib shell32.lib comdlg32.lib libApplicationMain-debug.lib

you know like this:
“lime build windows” -> FINE!
“lime build windows -debug” -> FINE
"lime build windows -static" -> FAIL!!!
“lime build windows -debug -static” -> FAIL!!!

Can you help me sometimes? If you want?

Hello!

The first mesages about “This object file…” look like warnings, not failures. Ignore those.

You need static HXCPP libraries as well to do a static build. Have you tried lime rebuild hxcpp windows -static yet?

Hey @singmajesty, my dear,

I have tried.

  1. lime rebuild hxcpp windows -clean
    both have no warning messages. Fine!!!

  2. lime rebuild windows -clean
    lime.ndll and lime-debug.ndll are fine

  3. lime rebuild hxcpp windows -static
    both outputs are good without warning messages…

  4. lime rebuild windows -static
    But both have always same warning messages like this:

  • Link : …/ndll/Windows/liblime-debug.lib
    4f73f91d_cairo-freed-pool.obj : 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
    4f73f91d_cairo-fixed.obj : 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
  1. lime build windows -static
  • Link : libApplicationMain.lib
  • Compiling group ‘main’ with flags -nologo -DHX_WINDOWS -GR -O2(optim-std) -Zi(debug) -FdC:\Users\Jens\napetest\Export\windows\cpp\release\obj\obj/msvc16-stat-ncxp/vc.pdb(debug) -Od(debug) -O2(release) -Os(optim-size) -Oy- -c -EHs -GS- -arch:SSE -ID:/Binaries/HaxeToolkit/haxe/lib/hxcpp/3,3,63/include -DSTATIC_LINK(static) -DHXCPP_VISIT_ALLOCS(haxe) -DHXCPP_API_LEVEL=321(haxe) -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -DHX_WIN_MAIN(main) -wd4996 tags=[haxe,static]
  • Compile : Main.cpp
  • Link : Main.exe
    Creating library Main.lib and object Main.exp
    f9a59cb0_Main.obj : error LNK2019: unresolved external symbol _regexp_register_prims referenced in function _WinMain@16
    libApplicationMain.lib(1b37f06c_RunLibs.obj) : error LNK2001: unresolved external symbol _regexp_register_prims
    f9a59cb0_Main.obj : error LNK2019: unresolved external symbol _std_register_prims referenced in function _WinMain@16
    libApplicationMain.lib(1b37f06c_RunLibs.obj) : error LNK2001: unresolved external symbol _std_register_prims
    Main.exe : fatal error LNK1120: 2 unresolved externals
    Error: error running link.exe -out:Main.exe -nologo -machine:x86 -subsystem:windows,5.01 -libpath:lib user32.lib @obj/msvc16-stat-ncxp/all_objs D:\Binaries\HaxeToolkit\haxe\lib/lime/3,0,0/ndll/Windows/liblime.lib gdi32.lib opengl32.lib user32.lib kernel32.lib advapi32.lib winmm.lib imm32.lib ole32.lib oleaut32.lib version.lib ws2_32.lib wldap32.lib shell32.lib comdlg32.lib libApplicationMain.lib

Always failed… Why does it not work for static? I have upgraded HXCPP to 3.3.63 from NME Host website

Possible I must rebuild NME and NME-DEV? than LIME rebuild right?

Perhaps there was a regression in HXCPP, I’ll try and take a look tomorrow

Thanks my best, I hope you get successful fresh static files. If you get error like my same solution. I hope you fix it than you can say if next revision - I will recompile 100 %. Good luck!

I have good news and bad news

The good news is I got it working – but the bad news is that I don’t have it working automatically.

Somewhere along the line, HXCPP must have changed to filter out the “std” and “regexp” libraries from our build XML. Our build XML has something like this when generated on a static build:

<lib name="C:\Development\Haxe\hxcpp\lib/Windows/libstd-19.lib" />
<lib name="C:\Development\Haxe\hxcpp\lib/Windows/libregexp-19.lib" />
<lib name="C:\Development\Haxe\lime\ndll/Windows/liblime-19.lib" />

but when we build, we get an error that “std_register_prims” or “regexp_register_prims” is missing. Look at the build command HXCPP is running:

Error: error running link.exe -out:Main.exe -nologo -machine:x86 -subsystem:windows,5.01 -libpath:lib user32.lib @obj/msvc19-stat-ncxp/all_objs C:\Development\Haxe\lime\ndll/Windows/liblime-19.lib gdi32.lib opengl32.lib user32.lib kernel32.lib advapi32.lib winmm.lib imm32.lib ole32.lib oleaut32.lib version.lib ws2_32.lib wldap32.lib shell32.lib comdlg32.lib libApplicationMain.lib

…where are std and regexp? HXCPP is stripping them out somewhere in its build process, it seems :frowning:

When I build manually (with the same HXCPP build command from the same directory) but rename these libraries to “foo” and “foo2” instead of “std” and “regexp” it works properly, as it should.

Newest hxcpp is always static for its std or regexp, that’s probably the reason they disappear.

It also has the notion of groups/flags, maybe some (“static”?) need to set to link with the required functions.

If we omit these libraries when performing a static link build, you think it would work? I thought with the newer HXCPP, you had to opt into static std and regexp, through some other method?

@singmajesty and @ibilon,
That is why error from HXCPP 3,3,63 right?

I must downgrade to 3,3,49?
Thanks for support for error hitting library of std and regexp. Thanks for finding of error means 2 std and regexp.

Possible I should recompile with HXCPP 3,3,49?
If it doesn’t work than we need to reinstall Haxe 3,3r

Before you add to include cpp.link.StaticRegexp for instance,
but not anymore, it’s always on.

So I guess you don’t need to include them,
but could be an issue with the way liblime is built?

@ibilon, method is not working now.

If i use “lime build windows -static” and it gets always error :frowning: because std and regexp are not correct?

If it is possible for wrong version of Haxe 3.3.0-rc.1

I think we need “downgrade” to Haxe 3.2.1?

If Haxe 3.2.1 has clean std and regexp? Can we try if it works with static / embedded application?

So sad with "lime rebuild windows -static -clean than it shows always stupid warnings but 2 symbols do not move to static mode.

How do we fix it with static apps. It sees like died with static / embedded applications. I miss that time. Since Haxe 3.1.2, Lime 2.9.0 and OpenFL 3.6.0 have no problem with static and work fine without errors and warnings.

  • Link : …/ndll/Windows/liblime.lib
    4f73f91d_cairo-freed-pool.obj : 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
    4f73f91d_cairo-fixed.obj : 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

2 objects are not compiled successful and they will get error for static application. PS: Can everybody downgrade or fix Cairo framework/library?

I think because Cairo library has 2 warning because it has no support to std and regexp or I will check cairo library files

I found “cairo-fixed.c” has not content only 2 #include … no voids no variables, no functions. Why does it not need to add to object files. Because 2 warnings mean 2 files are unusable to lib files.

Fixed bonus: You need to re-save 2 files “cairo-fixed.c” and “cairo-freed-pool.c” than try "lime rebuild windows -static -clean"
than it sees output no warning now… yay…

Shit that is why std and regexp errors…

f9a59cb0_Main.obj : error LNK2019: unresolved external symbol _regexp_register_prims referenced in function _WinMain@16
libApplicationMain.lib(1b37f06c_RunLibs.obj) : error LNK2001: unresolved external symbol _regexp_register_prims
f9a59cb0_Main.obj : error LNK2019: unresolved external symbol _std_register_prims referenced in function _WinMain@16
libApplicationMain.lib(1b37f06c_RunLibs.obj) : error LNK2001: unresolved external symbol _std_register_prims

Okay I am sorry for that. I wait for fix…

Any fixed solutions? If It has bug? I am still awaiting for next release or improvement.

Thanks

No answer yet. I am still waiting for solutions. If you don’t answer - I wait for fixing solution.I don want to wait until my bones. That is why I want how do I fix reveal and strong??? Thanks!

Very long???

Hello @singmajesty please resolve my std and my regexp.

I have tried lime rebuild windows -static -clean -libs=Path-to-libs\libstd.lib,path-to-lib\libregexp.lib is correct or wrong?

If i set manuel with -Dlibs=“path-to-lib\1.lib, path-to-lib\2.lib” right?

Or did you know about hxcpp arguments like -D…

I don’t want wait for gray hairs…

For the record, which version are you using of:

  • Haxe?
  • HXCPP?
  • Lime?
  • OpenFL?

Also, you once mentioned that this worked in an old version of OpenFL. If so, can you use the old version in the meantime?

@player_03 Thanks!

I am using Haxe 3.3.0
HXCPP 3.3.67
Lime 3.0.3
OpenFL 4.0.3

Always gets error :frowning:

But NME, Waxe and HXCPP work fine like real codings.
HXCPP 3.3.67
NME 5.6.16
Waxe 3.1.1
If I use OpenFL 4.0.3 for NME. I will check how does it works?
NME has same OpenGLView like OpenFL has OpenGLView

If you get nme’s openflview than you can type “nme create simpleopenglview” than cd simpleopenglview and nme test cpp -static than you will see application’s background is black and white quad.

That is why it works fine for me. Lime/OpenFL work for me only normal version :confounded: non embedded applications :frowning: I need use Virtual Box or BoxedApp Packaer than application’s content to packed / embedded application.

But nme has no problem with embedded application because nme recognizes good with regexp and std while compiling process shows hxcpp’s directory thridparty contents that is why it can compile together. Great work, NME! Lime won’t work together since thridparty contents have regexp and std into compiled application’s content - That is why you forget to add functions like NME’s after compiling from HXCPP’s thridparty.

Please make sure next version for Lime 4.0.4 adding functions like NME’s after-compiling for -static, -X86, -X64, -debug -release

Thanks for taking with my suggestion!

You said that this works fine with Lime 2.9.0 and OpenFL 3.6.0.

Is that still true?

Yes it is very stable and old. You know Lime 2.9.0 for me no problem with static version but I loose project directory from github because sources from github uses only Lime 3.0.3 Where do I find developed version Lime 2.9.0 from github?

Start by going to the list of releases:

Find release 2.9.0 in this list, and click the link to the commit:

Now copy the full commit hash:

You need this hash to roll back to this commit. If you’re using TortoiseGit, you can do this by choosing “Switch/Checkout,” with these options:

If you’re using Git from the command line, run this:

> git checkout 0f0491ddbea794eba2db5e0312bcef59ce0f27ae -b SourceSkyBoxerBranch

This will create a new branch based on Lime 2.9.0. You can then add your own commits to that branch.

I recommend Haxe 3.2.1 right now – I have problems with Haxe 3.3.0 on C++ targets, and building Lime tools fails too due to bugs.

Static builds work with an older HXCPP

I don’t know how we are meant to change static linking of the HXCPP standard library with Haxe 3.3.0 and the newest HXCPP releases.