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

Failed to build library on Windows #36

Open
rudolfninja opened this issue Sep 5, 2017 · 9 comments
Open

Failed to build library on Windows #36

rudolfninja opened this issue Sep 5, 2017 · 9 comments
Assignees
Labels

Comments

@rudolfninja
Copy link

Has anyone tried to build this library for Windows? When I'm trying to build this lib for Windows I see a lot of syntax errors (for about 1500).
So could you please advise here?
I use MS VS 2017.
Here are steps I'm following to build library:

  1. Run cmake CMakeLists.txt
  2. Launch libopencad.sln
  3. Build the solution in microsoft visual studio 2017

I attached screenshot with the problems.
image

@rudolfninja rudolfninja changed the title Filed to build library on Windows Failed to build library on Windows Sep 5, 2017
@sandyre sandyre added the bug label Sep 7, 2017
@sandyre
Copy link
Owner

sandyre commented Sep 7, 2017

I do not have any Windows machine nearby, so it will take some time for investigation. Thanks for your report.

@Sc07713
Copy link

Sc07713 commented Sep 11, 2017

I had the same issue here, I could use cmake against it.
make didnt work for me, so I launched the sln in vs.
Linked the library and it was filled with errors.

@sandyre
Copy link
Owner

sandyre commented Sep 15, 2017

I've got laptop with Windows, so will fix the build in a next few days. Thanks for your patience.

@sandyre sandyre self-assigned this Sep 15, 2017
@Sc07713
Copy link

Sc07713 commented Oct 27, 2017

Hi,

I just wanted to follow up, how far are we off this fix?

@sky-69
Copy link

sky-69 commented Jan 11, 2018

hi,

I manage to compile libopencad.dll on windows with mingw64 and msys. I have just modify one line in cadheader.cpp, in fact unix is a macro on windows so in funciotn addValue (line 470) :
`int CADHeader::addValue( short code, long julianday, long milliseconds )
{
// unixday -> julian return ( unixSecs / 86400.0 ) + 2440587.5;
// julian -> unixday return (julian - 2440587.5) * 86400.0

double seconds     = double( milliseconds ) / 1000;
double unixday        = ( double( julianday ) - 2440587.5 ) * 86400.0;
time_t fullSeconds = static_cast<time_t>(unixday + seconds);
return addValue( code, CADVariant( fullSeconds ) );

}`

install CMake for windows then, in libopencad directory

C:/CMake/bin/CMake.exe -DBUILD_SHARED_LIBS=ON -G "MSYS Makefiles" CMakeLists.txt
then
make

It works for me, compilation is ok, link also, i have not tested runtime...

@rudolfninja
Copy link
Author

rudolfninja commented Jan 11, 2018 via email

@SSHeRun
Copy link

SSHeRun commented Mar 21, 2018

Hi,
I try the solution,but also be fail.

20180321205249

@SSHeRun
Copy link

SSHeRun commented Mar 22, 2018

hi,
today,I and my partners try some new ways,and we built it successfully in vs 2017
this is my github :https://github.com/SSHeRun/Libopencad-built-in-windows-
my blog:https://blog.csdn.net/Caoyang_He/article/details/79660336

@GoosebumpsFactory
Copy link

@sandyre Thank you for releasing this library. Like previous posters on this thread I cannot compile the VS Studio project generated by cmake. I get the same errors as this post. Is there a plan to fix this bug? Thanks.

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

No branches or pull requests

6 participants