yfeng95 / face3d

Python tools for 3D face: 3DMM, Mesh processing(transform, camera, light, render), 3D face representations.
2.69k stars 615 forks source link

error: command 'gcc' failed with exit status 1 #57

Closed welbeckzhou closed 5 years ago

welbeckzhou commented 5 years ago

When Compile c++ files to .so for python use:

python setup.py build_ext -i the error occurs.

I use python 3.6, and the default gcc version in my anaconda env is 7.3.0

mesh_core.cpp:349:31: error: no matching function for call to ‘std::basic_ofstream::basic_ofstream(std::__cxx11::string&)’

zhuhaozh commented 4 years ago

I solved this by modified mesh_core.cpp (line 349) from

    ofstream obj_file(filename);

to

    ofstream obj_file(filename.c_str());

reference: link

gangeqian commented 3 years ago

this bug always exits in project, I also solved this issue by modifiing ofstream obj_file(filename.c_str());