Hi,

Problem:
I have two libraries with two different queue implementations. but with same structure name as "queuetype".

Now if I include both of the header files in my code, compilation will go for toss saying "error: conflicting types for 'queuetype' "

I need to include both the files.

How can I resolve this issue??

Thanks in advance.

Recommended Answers

All 2 Replies

I have two libraries with two different queue implementations. but with same structure name as "queuetype".

Question - are the structures queuetype the same in both files(besides the name)?

>How can I resolve this issue??
If you have control over the source for either library, simply change the name. If you don't have control, that's what I'd call a namespace nightmare. ;)

One way to work around it is by using a wrapper library. The purpose of a wrapper library is to provide exactly the same functionality, with names changed to protect the guilty. All types and functions defer to the wrapped library, so they're nothing more than a slight abstraction to resolve name conflicts.

Are these libraries statically linked or dynamically linked?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.