shyal / osbTools

A mix of tools for Maya
MIT License
61 stars 19 forks source link

Linux g++ compile for maya2016 error #2

Closed JeremyPeng closed 8 years ago

JeremyPeng commented 8 years ago

Hi Guys,

I try to compile this plugin in Linux, but an error occurred at last step.

My env: MAYAVER=2016 (devkit v3) BOOSTVER=1.47.0 PLATFORM=el6 GCC= 4.4.7

Maybe overlappingUVShells.o have some problems. If I exclude it, compile is successfully.

Other Maya versions Lib compile this plugin have happened it? How to fix it?

Error log:

mkdir -p .build/maya2016sp1/osbTools-1.0/src /usr/bin/g++ -c -o .build/maya2016sp1/osbTools-1.0/src/UVReversed.o src/UVReversed.cpp -shared -O3 -DNDEBUG -fno-strict-aliasing -c -fPIC -D_BOOL -DREQUIRE_IOSTREAM -DLINUX -I/usr/include/boost/ -I/home/qijun_peng/Dev/code/Maya_2016_DEVKIT_3_Linux/devkitBase/include mkdir -p .build/maya2016sp1/osbTools-1.0/src /usr/bin/g++ -c -o .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o src/overlappingUVShells.cpp -shared -O3 -DNDEBUG -fno-strict-aliasing -c -fPIC -D_BOOL -DREQUIRE_IOSTREAM -DLINUX -I/usr/include/boost/ -I/home/qijun_peng/Dev/code/Maya_2016_DEVKIT_3_Linux/devkitBase/include mkdir -p .build/maya2016sp1/osbTools-1.0/src /usr/bin/g++ -c -o .build/maya2016sp1/osbTools-1.0/src/UVSeams.o src/UVSeams.cpp -shared -O3 -DNDEBUG -fno-strict-aliasing -c -fPIC -D_BOOL -DREQUIRE_IOSTREAM -DLINUX -I/usr/include/boost/ -I/home/qijun_peng/Dev/code/Maya_2016_DEVKIT_3_Linux/devkitBase/include mkdir -p .build/maya2016sp1/osbTools-1.0/src /usr/bin/g++ -c -o .build/maya2016sp1/osbTools-1.0/src/holesBorder.o src/holesBorder.cpp -shared -O3 -DNDEBUG -fno-strict-aliasing -c -fPIC -D_BOOL -DREQUIRE_IOSTREAM -DLINUX -I/usr/include/boost/ -I/home/qijun_peng/Dev/code/Maya_2016_DEVKIT_3_Linux/devkitBase/include mkdir -p .build/maya2016sp1/osbTools-1.0/src /usr/bin/g++ -c -o .build/maya2016sp1/osbTools-1.0/src/Renaming.o src/Renaming.cpp -shared -O3 -DNDEBUG -fno-strict-aliasing -c -fPIC -D_BOOL -DREQUIRE_IOSTREAM -DLINUX -I/usr/include/boost/ -I/home/qijun_peng/Dev/code/Maya_2016_DEVKIT_3_Linux/devkitBase/include mkdir -p .build/maya2016sp1/osbTools-1.0/src /usr/bin/g++ -c -o .build/maya2016sp1/osbTools-1.0/src/pluginMain.o src/pluginMain.cpp -shared -O3 -DNDEBUG -fno-strict-aliasing -c -fPIC -D_BOOL -DREQUIRE_IOSTREAM -DLINUX -I/usr/include/boost/ -I/home/qijun_peng/Dev/code/Maya_2016_DEVKIT_3_Linux/devkitBase/include mkdir -p .build/maya2016sp1/osbTools-1.0/src /usr/bin/g++ -c -o .build/maya2016sp1/osbTools-1.0/src/intersect.o src/intersect.cpp -shared -O3 -DNDEBUG -fno-strict-aliasing -c -fPIC -D_BOOL -DREQUIRE_IOSTREAM -DLINUX -I/usr/include/boost/ -I/home/qijun_peng/Dev/code/Maya_2016_DEVKIT_3_Linux/devkitBase/include mkdir -p .build/maya2016sp1/osbTools-1.0/src /usr/bin/g++ -c -o .build/maya2016sp1/osbTools-1.0/src/triangleOverlappingTest.o src/triangleOverlappingTest.cpp -shared -O3 -DNDEBUG -fno-strict-aliasing -c -fPIC -D_BOOL -DREQUIRE_IOSTREAM -DLINUX -I/usr/include/boost/ -I/home/qijun_peng/Dev/code/Maya_2016_DEVKIT_3_Linux/devkitBase/include /usr/bin/g++ -shared -Wl,-soname,osbTools-1.0.so.1 -Wl,-Bdynamic -o .build/maya2016sp1/osbTools-1.0/osbTools-1.0.so .build/maya2016sp1/osbTools-1.0/src/UVReversed.o .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o .build/maya2016sp1/osbTools-1.0/src/UVSeams.o .build/maya2016sp1/osbTools-1.0/src/holesBorder.o .build/maya2016sp1/osbTools-1.0/src/Renaming.o .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o .build/maya2016sp1/osbTools-1.0/src/pluginMain.o .build/maya2016sp1/osbTools-1.0/src/intersect.o .build/maya2016sp1/osbTools-1.0/src/triangleOverlappingTest.o -L/usr/lib/boost -L/usr/autodesk/maya2016/lib -lOpenMaya -lOpenMayaUI -lOpenMayaAnim .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o: In function OverlappingUVShells::isUndoable() const': overlappingUVShells.cpp:(.text+0x0): multiple definition ofOverlappingUVShells::isUndoable() const' .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o:overlappingUVShells.cpp:(.text+0x0): first defined here .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o: In function OverlappingUVShells::undoIt()': overlappingUVShells.cpp:(.text+0x10): multiple definition ofOverlappingUVShells::undoIt()' .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o:overlappingUVShells.cpp:(.text+0x10): first defined here .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o: In function OverlappingUVShells::~OverlappingUVShells()': overlappingUVShells.cpp:(.text+0x50): multiple definition ofOverlappingUVShells::~OverlappingUVShells()' .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o:overlappingUVShells.cpp:(.text+0x50): first defined here .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o: In function OverlappingUVShells::~OverlappingUVShells()': overlappingUVShells.cpp:(.text+0x50): multiple definition ofOverlappingUVShells::~OverlappingUVShells()' .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o:overlappingUVShells.cpp:(.text+0x50): first defined here .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o: In function OverlappingUVShells::~OverlappingUVShells()': overlappingUVShells.cpp:(.text+0x70): multiple definition ofOverlappingUVShells::~OverlappingUVShells()' .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o:overlappingUVShells.cpp:(.text+0x70): first defined here .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o: In function OverlappingUVShells::OverlappingUVShells()': overlappingUVShells.cpp:(.text+0x90): multiple definition ofOverlappingUVShells::OverlappingUVShells()' .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o:overlappingUVShells.cpp:(.text+0x90): first defined here .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o: In function OverlappingUVShells::OverlappingUVShells()': overlappingUVShells.cpp:(.text+0x90): multiple definition ofOverlappingUVShells::OverlappingUVShells()' .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o:overlappingUVShells.cpp:(.text+0x90): first defined here .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o: In function OverlappingUVShells::creator()': overlappingUVShells.cpp:(.text+0xb0): multiple definition ofOverlappingUVShells::creator()' .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o:overlappingUVShells.cpp:(.text+0xb0): first defined here .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o: In function OverlappingUVShells::doIt(MArgList const&)': overlappingUVShells.cpp:(.text+0xf0): multiple definition ofOverlappingUVShells::doIt(MArgList const&)' .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o:overlappingUVShells.cpp:(.text+0xf0): first defined here collect2: ld returned 1 exit status make: *\ [.build/maya2016sp1/osbTools-1.0/osbTools-1.0.so] Error 1

shyal commented 8 years ago

Hi,

I have no idea why this is happening. The linker is complaining that the methods in OverlappingUVShells were defined multiple times.. so maybe it's trying to pull in the obj file file OverlappingUVShells multiple times.

The makefile for this project really wasn't written with everybody in mind.. and it could really do with a re-write. Unfortunately I no longer work in the industry (nor do I have a linux box, or maya handy).

If you fix the makefile, then a pull request would be great.

osb

shyal commented 8 years ago

Yes so there you have it:

/usr/bin/g++ -shared -Wl,-soname,osbTools-1.0.so.1 -Wl,-Bdynamic -o .build/maya2016sp1/osbTools-1.0/osbTools-1.0.so .build/maya2016sp1/osbTools-1.0/src/UVReversed.o .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o .build/maya2016sp1/osbTools-1.0/src/UVSeams.o .build/maya2016sp1/osbTools-1.0/src/holesBorder.o .build/maya2016sp1/osbTools-1.0/src/Renaming.o .build/maya2016sp1/osbTools-1.0/src/overlappingUVShells.o .build/maya2016sp1/osbTools-1.0/src/pluginMain.o .build/maya2016sp1/osbTools-1.0/src/intersect.o .build/maya2016sp1/osbTools-1.0/src/triangleOverlappingTest.o -L/usr/lib/boost -L/usr/autodesk/maya2016/lib -lOpenMaya -lOpenMayaUI -lOpenMayaAnim

So indeed overlappingUVShells object is being included twice by the linker. Now we just need to figure out why.

JeremyPeng commented 8 years ago

...Yes, that's my mistake. Thank you for your help!

BTW, I see the Makefile have"foldedUVFaces.o" need compile. But src folder not find foldedUVFaces.cpp. This is unnecessary?

shyal commented 8 years ago

​Strange. Yes most likely unnecessary.. or I forgot to check in the cpp file for it, but that's unlikely.​

On 3 June 2016 at 11:40, Jeremy notifications@github.com wrote:

...Yes, that's my mistake. Thank you for your help!

BTW, I see the Makefile have"foldedUVFaces.o" need compile. But src folder not find foldedUVFaces.cpp. This is unnecessary?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/shyal/osbTools/issues/2#issuecomment-223536060, or mute the thread https://github.com/notifications/unsubscribe/ABARdIl9ZOCoeUisVj7AoEm9eupuuVeIks5qH_aZgaJpZM4ItVM9 .

JeremyPeng commented 8 years ago

I removed "foldedUVFaces.o" in Makefile from the start. Otherwise I will not be able to compile... I just want to confirm whether there will be affected.

Thank you for your time!

shyal commented 8 years ago

I don't think this will cause an issue. Please paste your makefile here once you've successfully compiled.

Please also describe anything you had to do to get things running, this will help other users who want to use OSBTools. Thanks.

JeremyPeng commented 8 years ago

OK, I try build Windows and Linux for Maya 2016. If I test everything can work well, then I will pull my Makefile.