Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Ross on October 12, 2005, 06:10:10 pm

Title: BCC 5.5 Link error
Post by: Ross 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
Title: Re: BCC 5.5 Link error
Post by: thomas 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  ;)
Title: Re: BCC 5.5 Link error
Post by: drac 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 (http://www.objectcentral.com/vide/help/videdoc/bcc32.html).

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

Title: Re: BCC 5.5 Link error
Post by: drac 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++...
Title: Re: BCC 5.5 Link error
Post by: severach 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
Title: Re: BCC 5.5 Link error
Post by: Ross 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.
Title: Re: BCC 5.5 Link error
Post by: rickg22 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.
Title: Re: BCC 5.5 Link error
Post by: Urxae 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.