C language > Beginner questions

Link Pelles C code with GCC code?

(1/1)

Freddy:
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

frankie:
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.

Filter:
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?

frankie:
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?

Navigation

[0] Message Index

Go to full version