NO

Author Topic: Link Pelles C code with GCC code?  (Read 4857 times)

Freddy

  • Guest
Link Pelles C code with GCC code?
« on: August 08, 2007, 06:54:08 AM »
Hello!
I liking using Pelles C IDE, compiler and library.
But I also like using FLTK GUI library, which is C++ GUI library. I have it installed with Mingw (GCC).

So, I want to do the GUI part in FLTK and compile with Mingw.
And I want to do the other source code to compile with Pelles C.
Now, how would I link it?
Wrapping C++ parts in functions is pretty easy, actually FLTK is a very Cish C++ library.

The problem comes in linking. I want to link againts FLTK library with Mingw linker, but use Pelles C library which has nicer private includes.

Any idea?

Thanks

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: Link Pelles C code with GCC code?
« Reply #1 on: August 08, 2007, 04:09:08 PM »
The problem is that the object formats output by the two compilers, gcc and pocc, aren't compatible  :(
They are formally both COFF format, but PellseC is conform to M$ PE-COFF and gcc is conform to DJGPP-COFF. The real difference is only the slightly different use of offset to code, but, unfortunately, this is fatal. :(
The only way I see is to build DLL libraries with mingw and link against them the code generated with PellesC. You have also to rebuild the DLL import library using polib.
« Last Edit: August 08, 2007, 04:17:41 PM by frankie »
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Filter

  • Guest
Re: Link Pelles C code with GCC code?
« Reply #2 on: August 16, 2007, 05:37:15 AM »
Correct me if I'm wrong but I though that GCC's linker could link both ms coff and standard coff. Why wouldn't it be possible to just link with the GCC linker?

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: Link Pelles C code with GCC code?
« Reply #3 on: August 16, 2007, 12:49:58 PM »
Probably I don't understood well your point.
Yes ld should be able to link different file formats if BFD exist for them (not sure it works for libraries).
If you want complete the process through the IDE, while not impossible at all, will be an hard task (you can configure IDE to use ld, but I don't think will be an easy task nor that it will ever work).
Another point involves runtime code, the gcc and PellesC standard libraries are not compatible, this means that precompiled files could not link againsta the runtime of the other compiler, and you cannot include both libraries because the name collides.
Have you made any trial? What problem/error you get?
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide