मैं libduma को स्थिर रूप से लिंक करने का प्रयास करते समय त्रुटियों का सामना कर रहा हूं, क्या आप मुझे बता सकते हैं कि lib +uma से malloc का उपयोग करने के लिए g ++ से कैसे पूछें?जीसीसी लिनक्स में एकाधिक परिभाषा त्रुटियों को कैसे हल करें?
[email protected]:~/CodeTest$ g++ ./testDuma.cpp -g -o testDuma -static -lduma -pthread
/usr/lib/gcc/i686-linux-gnu/4.4.5/../../../../lib/libc.a(malloc.o): In function `free':
(.text+0x4b00): multiple definition of `free'
/usr/lib/gcc/i686-linux-gnu/4.4.5/../../../../lib/libduma.a(duma.o):(.text+0x25f0): first defined here
/usr/lib/gcc/i686-linux-gnu/4.4.5/../../../../lib/libc.a(malloc.o): In function `malloc':
(.text+0x4bc0): multiple definition of `malloc'
/usr/lib/gcc/i686-linux-gnu/4.4.5/../../../../lib/libduma.a(duma.o):(.text+0x2730): first defined here
/usr/lib/gcc/i686-linux-gnu/4.4.5/../../../../lib/libc.a(malloc.o): In function `realloc':
(.text+0x5950): multiple definition of `realloc'
/usr/lib/gcc/i686-linux-gnu/4.4.5/../../../../lib/libduma.a(duma.o):(.text+0x23d0): first defined here
collect2: ld returned 1 exit status
और यह मेरे लिए अनिवार्य है, यहाँ त्रुटियों मैं हो रही हैं http://pastebin.com/ydrdqN0J – SunnyShah
@SunnyShah: मुझे यकीन नहीं है कि यह सही तरीके से काम करेगा, लेकिन '-z muldefs' लिंकर ध्वज आज़माएं। पसंद: 'g ++ testDuma.cpp -static -g -o testDuma -lduma -lpthread -Xlinker -z -Xlinker muldefs' –
प्रतिक्रिया के लिए धन्यवाद, एक संदेह, किसी भी विचार से G ++ से ड्यूमा के प्रतीकों का उपयोग करने के लिए और नहीं से libc? – SunnyShah