asmaloney / libE57Format

Library for reading & writing the E57 file format
Boost Software License 1.0
137 stars 66 forks source link

{Windows} problems during linking #260

Closed hesetone closed 10 months ago

hesetone commented 1 year ago

Hi: I have found that i got a error after building library, here is my step: 1, running command line below: cmake -B E57-build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=E57-install libE57Format, but, an error occurs while running ``, just like below:

main.obj : error LNK2001: 无法解析的外部符号 "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > testing:
:FLAGS_gtest_color" (?FLAGS_gtest_color@testing@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)

2, so, i turn to visual studio for help: [1], open E57-build/E57Format.sln. [2], build ALL. [3], find .\bin\E57Format.dll,.\lib\E57Format.liband.\include\E57Format\*.hunder directory E57-install.

3, create a new project in vs2022, just contains two lines in main.cpp:

e57::ReaderOptions readOpt;
e57::Reader eReader = e57::Reader([path to .e57 file], readOpt);

i write path to .\E57Format\*.h and E57Format.lib in project's configuration page. no error while compiling, but it alerts that E57Format.dll need to be included in this project. so i add E57Format.dll to configuration page, a new error was thrown out:

fatal error LNK1107: invalid or corrupt file: cannot read at 0x300.

looking for a final help, could you please provide a valid version of this library for downloading? the compiling experience is real painful. hhhhhhhhh

asmaloney commented 1 year ago
  1. Could you please give the complete output, not just the error?

What version of Windows and what compiler (and version) are you using?

I don't use Windows, but when I build using the command you gave, the testE57 executable is built and I can run it. It also works in the CI builds for several variations on Windows using MSVC which look like they are using C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.35.32215/bin/HostX64/x64/cl.exe.

2 & 3. I'm afraid I can't help with Visual Studio, but it sounds like a configuration issue.

could you please provide a valid version of this library for downloading?

Generally you don't do this for libraries like this on GitHub because of the many variations of build. Especially for Windows, all the compiler switches have to be consistent. I don't want to try to support all of the "it doesn't link with my setup" issues. I'll stick to build issues 😄

the compiling experience is real painful.

I'm sorry but that's just what happens when you have to use Windows 😆

asmaloney commented 10 months ago

If you still have the issue, please reopen and include the requested info.