slic3r / Slic3r

Open Source toolpath generator for 3D printers
https://slic3r.org/
GNU Affero General Public License v3.0
3.33k stars 1.29k forks source link

Use mingw build slic3r command line in woindows #4935

Open wjk199511140034 opened 4 years ago

wjk199511140034 commented 4 years ago

Try to compile slic3r CLI (cpp) with cmake + mingw An error occurred at last, and the compiled exe seem nonfunctional. This is the error message 2020-02-20 203803

full log is here cmd.txt

compile environment: win10 x64 cmake 3.16.2 mingw w64 4.3.5 boost_1_63_0 wxWidgets 3.0.0

lordofhyphens commented 4 years ago

There is an additional compiled piece needed on windows, and I believe that CMake files don't account for mingw when deciding to build it.

On Thu, Feb 20, 2020, 7:05 AM AMebius notifications@github.com wrote:

Try to compile slic3r CLI (cpp) with cmake + mingw An error occurred at last, and the compiled exe seem nonfunctional. This is the error message [image: 2020-02-20 203803] https://user-images.githubusercontent.com/12637627/74935272-ed97ef00-5422-11ea-86ba-bfe8ca9856ff.jpg

full log is here cmd.txt https://github.com/slic3r/Slic3r/files/4230802/cmd.txt

compile environment: win10 x64 cmake 3.16.2 mingw w64 4.3.5 boost_1_63_0 wxWidgets 3.0.0

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/slic3r/Slic3r/issues/4935?email_source=notifications&email_token=AAAHYCTANNEKSA4CO2JX3FLRDZ5YNA5CNFSM4KYONR42YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IO7LP2Q, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAHYCSX54R2PRGEZJLMACLRDZ5YNANCNFSM4KYONR4Q .

wjk199511140034 commented 4 years ago

There is an additional compiled piece needed on windows, and I believe that CMake files don't account for mingw when deciding to build it. On Thu, Feb 20, 2020, 7:05 AM AMebius @.***> wrote: Try to compile slic3r CLI (cpp) with cmake + mingw An error occurred at last, and the compiled exe seem nonfunctional. This is the error message [image: 2020-02-20 203803] https://user-images.githubusercontent.com/12637627/74935272-ed97ef00-5422-11ea-86ba-bfe8ca9856ff.jpg full log is here cmd.txt https://github.com/slic3r/Slic3r/files/4230802/cmd.txt compile environment: win10 x64 cmake 3.16.2 mingw w64 4.3.5 boost_1_63_0 wxWidgets 3.0.0 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#4935?email_source=notifications&email_token=AAAHYCTANNEKSA4CO2JX3FLRDZ5YNA5CNFSM4KYONR42YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IO7LP2Q>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAHYCSX54R2PRGEZJLMACLRDZ5YNANCNFSM4KYONR4Q . I don't know what additional compiled piece is, I built it based on "Running-Slic3r-from-git-on-Windows" and file in "Slic3r/src/windows-build.txt", there was many errors in configure and generate steps, thanks Google for helping me solve them one by one, but in the end, I couldn't get a valid information and log T_T. I think bypassing perl can help me understand slic3r, after all I'm an amateur coder.

lordofhyphens commented 4 years ago

https://github.com/slic3r/Slic3r/blob/master/src/CMakeLists.txt#L501

https://github.com/slic3r/Slic3r/blob/master/src/CMakeLists.txt#L505

Change that if statement to if MSVC OR MINGW and see where you get.

wjk199511140034 commented 4 years ago

I have a little confused on the L501 and L504, if you mean the 499 and 503 it made sense, But its make no different I got the same error at last step. ....

wjk199511140034 commented 4 years ago

https://github.com/slic3r/Slic3r/blob/master/src/CMakeLists.txt#L501

https://github.com/slic3r/Slic3r/blob/master/src/CMakeLists.txt#L505

Change that if statement to if MSVC OR MINGW and see where you get.

2020-02-25 135008

wjk199511140034 commented 4 years ago

To avoid this error, don't build slic3r_test or, just add //before boost :: nowide :: cerr in AMF.cpp line461and TMF.cpp line292. But that was just self-deceive....

Other issue: Run with slic3r -g test.stl or slic3r -g box.3mf

C:\dev\Slic3r\Build>slic3r.exe -gcode test.stl
CLI   ERR: Arrange: 1, center: 1
Infilling layers
Processing triangulated mesh
Preparing infill
Generating skirt
Generating brim
Exporting G-Code...
CLI   ERR: Failed to remove the output G-code file from test.gcode.tmp to test.gcode. Is test.gcode.tmp locked?
C:\dev\Slic3r\Build>slic3r.exe -gcode box.3mf
CLI   ERR: Arrange: 1, center: 1
Infilling layers
Processing triangulated mesh
Preparing infill
Generating skirt
Generating brim
Exporting G-Code...
CLI   ERR: Failed to remove the output G-code file from box.gcode.tmp to box.gcode. Is box.gcode.tmp locked?

Don't know what's CLI ERR: Arrange: 1, center: 1 But seem like this .gcode.tmp are working fine if I change it to .gcode, I suspected that is permission issue, tried moving to another disk, and run with admin, all dead.. To avoid Failed to remove the output G-code file error, add: outstream.close(); in Print.cpp line 710 just before for statement

TLAS11 commented 4 years ago

Try to compile slic3r CLI (cpp) with cmake + mingw An error occurred at last, and the compiled exe seem nonfunctional. This is the error message 2020-02-20 203803

full log is here cmd.txt

compile environment: win10 x64 cmake 3.16.2 mingw w64 4.3.5 boost_1_63_0 wxWidgets 3.0.0

I think I overcame this error in Windows with Visual Studio. Make sure you include the following library in the slic3r_test: Release\boost-nowide.lib

wjk199511140034 commented 4 years ago

Try to compile slic3r CLI (cpp) with cmake + mingw An error occurred at last, and the compiled exe seem nonfunctional. This is the error message 2020-02-20 203803 full log is here cmd.txt compile environment: win10 x64 cmake 3.16.2 mingw w64 4.3.5 boost_1_63_0 wxWidgets 3.0.0

I think I overcame this error in Windows with Visual Studio. Make sure you include the following library in the slic3r_test: Release\boost-nowide.lib

I overcame this error by delete slic3r_test lol