On Mon, 18 Nov 2024 at 12:38, Семен Ястребов wrote:
>
> Did everything step by step, but result is not enjoy. After build lib, by your commands, i have this problem:
>
> make[1]: Target "all" was not rebuilt due to errors.
> make[1]: exit from the directory “/home/kirill/fltk-1.3.9/test”
> make: *** [Makefile:22: all] Error 1
I think that's normal when cross-compiling mingw code on Linux (the
build tries to run some Windows exes - e.g. flud.exe - without
invoking Wine, so those stages fail)
>
> Whew try to open hello.exe:
>
> $ wine test/hello.exe
> 011c:err:module:import_dll Library libstdc++-6.dll (which is needed by L"Z:\\home\\kirill\\fltk-1.3.9\\test\\hello.exe") not found
> 011c:err:module:loader_init Importing dlls for L"Z:\\home\\kirill\\fltk-1.3.9\\test\\hello.exe" failed, status c0000135
That, I think is a mingw issue.
If this were "real" Windows you can duck that (in a quick hack way) by
copying the mingw libstdc++-6.dll into the hello.exe folder so that
the exe finds it at runtime. I'm not sure if Wine is a sloppy as
Windows though about DLL resolution so am not sure if this works...
The better way to fix this is to add "-static-libgcc
-static-libstdc++" to the linker commands when building hello.exe (and
the other exes) and then the necessary parts of mingw will be linked
in and you will not need that DLL at runtime.
>
> Viewing the lib dir, i see *.a libs and thought that i can try to build programm, but result was the same:
>
> $ x86_64-w64-mingw32-g++ main.cxx -o my_app.exe -I/home/kirill/fltk-1.3.9/ -L/home/kirill/fltk-1.3.9/lib/
> /usr/lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld: /tmp/ccdtpK7w.o:main.cxx:(.rdata$.refptr.fl_graphics_driver[.refptr.fl_graphics_driver]+0x0): undefined reference to `fl_graphics_driver'
> Collect2: error: Execution of ld failed with return code 1
You need to specify the fltk libs to use - you heave not done so, so
the link fails. I'd guess, at a minimum, you'd need to add at
something like:
-static-libgcc -static-libstdc++
/home/kirill/fltk-1.3.9/lib/libfltk.a -lgdiplus -lole32 -luuid
-lcomctl32 -lws2_32 -lwinspool
To the end of your command (and that assumes that the mingw
cross-compiler resolves it's own libs correctly, i.e. the -lgdiplus
-lole32 -luuid -lcomctl32 -lws2_32 -lwinspool parts!)
>
> What should i do next? Start to learn cmake?
There's no harm in learning cmake, I'm sure, but the issues here are
probably not related to that so much!
> --
> You received this message because you are subscribed to the Google Groups "fltk.general" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
fltkgeneral...@googlegroups.com.
> To view this discussion visit
https://groups.google.com/d/msgid/fltkgeneral/1cac0770-234e-49bd-9b5e-ccd7843e0b05n%40googlegroups.com.