Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link problems on Windows #38

Open
tabris17 opened this issue Mar 18, 2021 · 2 comments
Open

Link problems on Windows #38

tabris17 opened this issue Mar 18, 2021 · 2 comments

Comments

@tabris17
Copy link

My environment:
Windows 7 SP1
Nim Compiler Version 1.4.2 [Windows: i386]
gcc version 8.1.0 (i686-posix-dwarf-rev0, Built by MinGW-W64 project)

Link error:
...\nimbledeps\pkgs\ui-0.9.4\res\resources.o: file not recognized: File format not recognized

So I delete line {.link: r"..\res\resources.o".} from ui/rawui.nim

{.link: r"..\res\resources.o".}

And get error:

C:\Users\...\nimcache\nimtest_d\win_alloc.cpp.obj:alloc.cpp:(.text+0x1c): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream(std::_Ios_Openmode)'
C:\Users\...\nimcache\nimtest_d\win_alloc.cpp.obj:alloc.cpp:(.text+0x2c): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()'
C:\Users\...\nimcache\nimtest_d\win_alloc.cpp.obj:alloc.cpp:(.text+0xb6): undefined reference to `std::ostream::operator<<(void const*)'
C:\Users\...\nimcache\nimtest_d\win_alloc.cpp.obj:alloc.cpp:(.text+0xc9): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
C:\Users\...\nimcache\nimtest_d\win_alloc.cpp.obj:alloc.cpp:(.text+0xef): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
... ...

Then I add a line {.passL: r"-lstdc++".} into ui/rawui.nim, build successed.

But when I execute the .exe file,there has an error messagebox: Unable to find an entry point named 'TaskDialog' in DLL 'Comctl32.dll'.

@veksha
Copy link

veksha commented May 29, 2021

it seems that resources.o is a 64-bit object file, so the check must be added to rawui.nim :

when defined(cpu64):
      {.link: r"..\res\resources.o".}

BUT, if the purpose of this file is to make modern look of windows controls then it's not working for me.
but this method works -> #17 (comment)

devs, please, implement the same method for your project so all will work like a charm.

@kwilson21
Copy link

kwilson21 commented Mar 3, 2022

This fix did not work for me on Windows 11 for a 32 bit project. I was not able to compile at all using gcc and had to switch to vcc to get it working, I simply had to add {.link: r"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x86\windowscodecs.lib".} to the top of my file and compile using vcc for everything to compile on windows. It also renders the newer windows elements as opposed to the old windows xp style some were reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants