danomatika / ofxPd

(maintained) a Pure Data addon for OpenFrameworks using libpd
Other
202 stars 45 forks source link

Bug, duplicate symbols #52

Closed Wah0airo closed 7 years ago

Wah0airo commented 7 years ago

I tried to include ofxPD in a Project but I became a linker error, 30 duplicate symbols. I tried to compile the examples, but was the same, again 30 duplicate symbols. I found some similar posts, but I couldn't find any solutions. I looks like there is a problem with "g_list_all.h" . I follow the instructions from Readme file. The errors are lister below. I'm working with OF 0.98 on OSX Sierra, Xcode 8.3, ofxPd was compiled with the following flags: -DHAVE_UNISTD_H -DUSEAPI_DUMMY -DPD -DLIBPD_EXTRA -DLIBPD_USE_STD_MUTEX -DHAVE_LIBDL duplicate symbol glistreloadingabstraction in: g_all_guis.o g_array.o duplicate symbol glistreloadingabstraction in: g_all_guis.o g_bang.o duplicate symbol glistreloadingabstraction in: g_all_guis.o g_canvas.o duplicate symbol glistreloadingabstraction in: g_all_guis.o g_clone.o duplicate symbol glistreloadingabstraction in: g_all_guis.o g_editor.o duplicate symbol glistreloadingabstraction in: g_all_guis.o g_graph.o duplicate symbol glistreloadingabstraction in: g_all_guis.o g_guiconnect.o duplicate symbol glistreloadingabstraction in: g_all_guis.o g_hdial.o duplicate symbol glistreloadingabstraction in: g_all_guis.o g_hslider.o duplicate symbol glistreloadingabstraction in: g_all_guis.o g_io.o duplicate symbol glistreloadingabstraction in: g_all_guis.o g_mycanvas.o duplicate symbol glistreloadingabstraction in: g_all_guis.o g_numbox.o duplicate symbol glistreloadingabstraction in: g_all_guis.o g_readwrite.o duplicate symbol glistreloadingabstraction in: g_all_guis.o g_rtext.o duplicate symbol glistreloadingabstraction in: g_all_guis.o g_scalar.o duplicate symbol glistreloadingabstraction in: g_all_guis.o g_template.o duplicate symbol glistreloadingabstraction in: g_all_guis.o g_text.o duplicate symbol glistreloadingabstraction in: g_all_guis.o g_toggle.o duplicate symbol glistreloadingabstraction in: g_all_guis.o g_traversal.o duplicate symbol glistreloadingabstraction in: g_all_guis.o g_vdial.o duplicate symbol glistreloadingabstraction in: g_all_guis.o g_vslider.o duplicate symbol glistreloadingabstraction in: g_all_guis.o g_vumeter.o duplicate symbol glistreloadingabstraction in: g_all_guis.o m_binbuf.o duplicate symbol glistreloadingabstraction in: g_all_guis.o m_pd.o duplicate symbol glistreloadingabstraction in: g_all_guis.o s_inter.o duplicate symbol glistreloadingabstraction in: g_all_guis.o s_loader.o duplicate symbol glistreloadingabstraction in: g_all_guis.o x_array.o duplicate symbol glistreloadingabstraction in: g_all_guis.o x_misc.o duplicate symbol glistreloadingabstraction in: g_all_guis.o x_scalar.o duplicate symbol glistreloadingabstraction in: g_all_guis.o x_text.o ld: 30 duplicate symbols for architecture x86_64

danomatika commented 7 years ago

Did you use the ProjectGenerator?

EDIT: I'm not seeing any issues in building the pdExample project with an Xcode project generated by the PG.

Wah0airo commented 7 years ago

Yes, I used the Project Generator. I create a new example too with the PG only with an example of ofxPD,, the "duplicate symbols" still appears. The rest of Open Frameworks addons are working OK.

danomatika commented 7 years ago

I'm not seeing this issue with a fresh clone of ofxPd into a fresh download of OF 0.9.8. Both pdExample and an empty project using ofxPd build fine. I'm running macOS 10.12.4 and using Xcode 8.3.1.

Wah0airo commented 7 years ago

I found the problem. When you create a new Xcode project you are asked to do "Update to recommended settings".Attached is a Screenshot. If do that, than is going to appear these duplicate symbols, if not the code compile without problems. Maybe this point "Duplicate methods definition" is generating this problem. If you look at the OF Forum you can see that another People had similar problems. settings

danomatika commented 7 years ago

Ok cool. In general, it's best not to update the project the PG generates.

danomatika commented 7 years ago

As a followup, can you set the following in an updated project to see if it builds?

Wah0airo commented 7 years ago

I changed the setting from "No common Blocks" in an updated project from "Yes" to "No", it builds. Regards.

danomatika commented 7 years ago

"No common blocks" is now set via the "-fcommon" compiler flag in addon_config.mk.