Board index » delphi » Linking Microsoft Visual C++ .OBJ file to Delphi????
Martin Bryant
![]() Delphi Developer |
Fri, 07 Jun 2002 03:00:00 GMT
|
Martin Bryant
![]() Delphi Developer |
Fri, 07 Jun 2002 03:00:00 GMT
Linking Microsoft Visual C++ .OBJ file to Delphi????
I've got some C source which I compile with Microsoft Visual C++ 6 to create
a .OBJ file. However when I then try to link the file into a Delphi project with e.g. {$L release\test.obj} I get the error message 'Bad File Format: test.obj' The Delphi help page lists a number of restrictions on .OBJ file formats but Is it possible to link a MSVC .OBJ to Delphi at all? Any help GREATLY appreciated :-) |
Jean Michel Courivau
![]() Delphi Developer |
Fri, 07 Jun 2002 03:00:00 GMT
Re:Linking Microsoft Visual C++ .OBJ file to Delphi????If I remember right, MSVC is breaking a particularly important restriction of delphi : Microsoft objetc file format and Inprise one are differents. So IMHO you cannot link delphi code to microsoft .obj. What you can do is create a DLL (with MSVC) and use it within Delphi (or use an ActiveX or a COM object). |
Gy{*word*39} Balog
![]() Delphi Developer |
Fri, 07 Jun 2002 03:00:00 GMT
Re:Linking Microsoft Visual C++ .OBJ file to Delphi????I have exactly the same experience. I've made a dll from the c object files. Delphi can use dlls correctly. George QuoteMartin Bryant <marti...@colossus.demon.co.uk> wrote in message Quote> I've got some C source which I compile with Microsoft Visual C++ 6 to |
Manuel Algo
![]() Delphi Developer |
Fri, 07 Jun 2002 03:00:00 GMT
Re:Linking Microsoft Visual C++ .OBJ file to Delphi????On Mon, 20 Dec 1999 13:39:18 -0000, "Martin Bryant" Quote<marti...@colossus.demon.co.uk> wrote: freeware tool that tries to fix this kind of problem. I don't have the URL, though. Manuel Algora |
Ron Rubl
![]() Delphi Developer |
Fri, 07 Jun 2002 03:00:00 GMT
Re:Linking Microsoft Visual C++ .OBJ file to Delphi????QuoteMartin Bryant wrote in message Quote>Is it possible to link a MSVC .OBJ to Delphi at all? (Common Object File Format), and Borland uses OMF. Totally different formats. I think you need to wrap the VC functions in a DLL |
J.T. Wentin
![]() Delphi Developer |
Sat, 08 Jun 2002 03:00:00 GMT
Re:Linking Microsoft Visual C++ .OBJ file to Delphi????You are correct, at least insofar as that the object file formats are incompatible between Microsoft and Borland compilers. The names sound familiar as well, but I can never remember who uses what, so I'll take your word for it ;) Creating a DLL and calling that would indeed seem to be the answer (if you have access to MSVC, that is), or try to get a Borland compatible version of the OBJs (if it will compile with BC...). -- www.hornet.demon.nl "Ron Ruble" <r a f f l e s 2...@worldnet.att.net> wrote in message Quote
|
Manuel Algo
![]() Delphi Developer |
Sat, 08 Jun 2002 03:00:00 GMT
Re:Linking Microsoft Visual C++ .OBJ file to Delphi????On Mon, 20 Dec 1999 09:33:13 -0500, "Ron Ruble" <r a f f l e s Quote2...@worldnet.att.net> wrote: one can also do it, but MS's linker does convert automatically an OMF format into COFF as needed. So the other way round should be possible: linking a Delphi .OBJ with a MSVC main. Manuel Algora |
Martin Bryan
![]() Delphi Developer |
Mon, 10 Jun 2002 03:00:00 GMT
Re:Linking Microsoft Visual C++ .OBJ file to Delphi????Thanks for all the information. Typical Microsoft :-( Does anyone know if the latest Borland C++ compiler can produce static QuoteMartin Bryant <marti...@colossus.demon.co.uk> wrote in message Quote> I've got some C source which I compile with Microsoft Visual C++ 6 to |
Ron Rubl
![]() Delphi Developer |
Mon, 10 Jun 2002 03:00:00 GMT
Re:Linking Microsoft Visual C++ .OBJ file to Delphi????QuoteMartin Bryant wrote in message Quote>Thanks for all the information. Typical Microsoft :-( to -open up- compatibility. MS did that when they switched to Win32, because COFF is a cross-platform standard. They also implemented COFF debugging information at Quote>Does anyone know if the latest Borland C++ compiler can produce static to be sure. |
Total
![]() Delphi Developer |
Mon, 10 Jun 2002 03:00:00 GMT
Re:Linking Microsoft Visual C++ .OBJ file to Delphi????QuoteMartin Bryant wrote: Redmond software giant <g>. Quote> Does anyone know if the latest Borland C++ compiler can produce static perhaps, a Com 'object'? Delphi 'knows' how to read those and you won't have to bother with object formats. Of course, with the dll, you'll still have to{*word*222}with the import library (should you prefer to use it vs. run-time loading, which I'm sure you would.) But that is a bit easier to overcome by reconstructing the .def file. With a Com component you'll have nothing to struggle with at all, so, imo, that is the best solution for your predicament. |
Maynard Philbroo
![]() Delphi Developer |
Tue, 11 Jun 2002 03:00:00 GMT
Re:Linking Microsoft Visual C++ .OBJ file to Delphi????yes, the borland compilers generate Intel Obj files. Vc can also do this if you configure it i do beleve. QuoteMartin Bryant wrote: |
s.laurijsse
![]() Delphi Developer |
Mon, 17 Jun 2002 03:00:00 GMT
Re:Linking Microsoft Visual C++ .OBJ file to Delphi????I have a different problem. I also created a c dll, but I can't seem to call the functions from within Delphi. I have done everything like it says in the book, but it just doesn't work. How did you do it? QuoteGy{*word*39} Balogh wrote in message <83lh8h$l7...@ultra.kfki.hu>... |
William DePalo [MVP
![]() Delphi Developer |
Mon, 17 Jun 2002 03:00:00 GMT
Re:Linking Microsoft Visual C++ .OBJ file to Delphi????Quotes.laurijssen <se...@circe.demon.nl> wrote in message Quote> I have a different problem. I also created a c dll, but I can't seem to 1) you failed to export the function at all If your problem is #1, it's time to go back to that book. :-) You can tell If your problem is #2, try this: VC/C++ comes with a handy utility called DUMPBIN (dump binary executable). Enter the command dumpbin /exports mycdll.dll If you have successfully exported your C function names you'll see some _myCFunc@nn where myCFunc is the name you assigned to your function in the source and nn Now create a file with the same name as your DLL and a .DEF (module LIBRARY myDLL EXPORTS Add this file to your project in the IDE. Rebuild. If all goes well this will alias your function names by removing the Regards, |
s.laurijsse
![]() Delphi Developer |
Wed, 19 Jun 2002 03:00:00 GMT
Re:Linking Microsoft Visual C++ .OBJ file to Delphi????Thanks a lot! I got it working now. I forgot to put the extern "C" identifier in the C-source before the exported functions. This way I could only call them from C-programs. I also learned a lot from your explanation (I am a Delphi beginner, so that's not very hard) Quote
|
1. How do I link into my Delphi app C/C++ OBJ files
2. Linking a Borland DLL with Microsoft Visual C++
3. Microsoft Visual C++ vs. Borland C++ Builder
4. Linking C++ OBJ into Delphi
5. Linking Delphi files with msvc obj/lib-files.
6. Need help in linking C++ OBJ codes to Delphi program
7. Linking 16 bytes obj files in Delphi application
8. Linking VC++ obj files with Delphi