Author Topic: BCC 5.5 Link error  (Read 7864 times)

Ross

  • Guest
BCC 5.5 Link error
« on: October 12, 2005, 06:10:10 pm »
Hello,

I am new to Code::Blocks and just getting back into C/C++ programming. I started a new dynamic dll project and get the following messages when I try to compile. Thanks for any help.


Project   : DLL Sample
Compiler  : Borland C++ Compiler 5.5 (called directly)
Directory : C:\cbTest\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: main.c
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
main.c:
Compiling: ..\cbc\MT_WIN32\COUNTER.C
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
..\cbc\MT_WIN32\COUNTER.C:
Compiling: ..\cbc\MT_WIN32\FLAG.C
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
..\cbc\MT_WIN32\FLAG.C:
Compiling: ..\cbc\MT_WIN32\KEY.C
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
..\cbc\MT_WIN32\KEY.C:
Compiling: ..\cbc\MT_WIN32\MAILBOX.C
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
..\cbc\MT_WIN32\MAILBOX.C:
Compiling: ..\cbc\MT_WIN32\MULTITSK.C
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
..\cbc\MT_WIN32\MULTITSK.C:
Compiling: ..\cbc\MT_WIN32\PRINTF.C
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
..\cbc\MT_WIN32\PRINTF.C:
Compiling: ..\cbc\MT_WIN32\RESOURCE.C
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
..\cbc\MT_WIN32\RESOURCE.C:
Compiling: ..\cbc\MT_WIN32\WPIPE.C
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
..\cbc\MT_WIN32\WPIPE.C:
Linking dynamic library: sample.dll
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Fatal: Unable to open file 'SAMPLE.DLL'
Process terminated with status 1 (0 minutes, 3 seconds)
1 errors, 0 warnings

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: BCC 5.5 Link error
« Reply #1 on: October 12, 2005, 08:19:52 pm »
Please switch compiler logging to "full commandline" (compiler options, rightmost tab) and re-post the log.

I don't know Borland at all, but someone who does will need some more information to be able to help.
"Compiling main.c" does not give a lot of hints to what may be wrong  ;)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline drac

  • Multiple posting newcomer
  • *
  • Posts: 27
Re: BCC 5.5 Link error
« Reply #2 on: October 12, 2005, 08:23:13 pm »
I've done a little research and it seams that there is a bug in C::B.

Borland's ilink32 doesn't support "-o output" switch. You can investigate what C::B actually does
by exporting the project to a Makefile.

Here are the commands to compile the default dll sample:
bcc32 -c main.c
ilink32 main.obj, main.dll, -Tpd -Gi, user32.lib

-Tpd to generate a dll
-Gi to generate a lib file.

For more information go to this link.

Somebody should fix this bug... of course after version 1.0 is released  :wink:

« Last Edit: October 12, 2005, 08:53:17 pm by drac »

Offline drac

  • Multiple posting newcomer
  • *
  • Posts: 27
Re: BCC 5.5 Link error
« Reply #3 on: October 12, 2005, 09:06:38 pm »
"Win32 GUI Application" template needs cw32.lib in order  to compile.

"Console Application" template needs cw32.lib and import32.lib in order to compile.

"Win32 GUI Application" and "Console Application" templates have the ilink32.exe parameters
set correctly...

Hmm, more bugs for Borland C++...

Offline severach

  • Multiple posting newcomer
  • *
  • Posts: 44
Re: BCC 5.5 Link error
« Reply #4 on: October 13, 2005, 09:36:15 am »
You can create your DLL with any of the compilers with the instructions here:

http://forums.codeblocks.org/index.php/topic,946.0.html

Ross

  • Guest
Re: BCC 5.5 Link error
« Reply #5 on: October 17, 2005, 11:58:05 pm »
Thanks for the responses and the tip to use the command line to compile my projects. I have 2 DLLs compiled now but when I run the app that uses them I get the error: "The application failed to initialize properly..." so I still have some problems. As I said in my first post I am just getting back into Borland C after a number of years with Delphi so right now, I'm just above dummy level. Is it allowed to ask C programming questions in this forum? If not, please recommend one. Thanks.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: BCC 5.5 Link error
« Reply #6 on: October 18, 2005, 01:12:17 am »
http://forums.devx.com/forumdisplay.php?f=110 is a very good resource for Programming newbies :) And here are some tutorials. http://www.cprogramming.com/tutorial.html#c++tutorial

Try making basic "hello, world" apps in console mode before trying to do Full-fledged windows.

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: BCC 5.5 Link error
« Reply #7 on: October 18, 2005, 10:03:56 am »
It might be a good idea to create a separate forum for programming questions, even ones that have nothing to do with Code::Blocks. That would remove some of the clutter from the rest of the forums and be a nice service to the user community.