Page 1 of 1

C++Builder 10.1 Berlin cannot link to madzip.obj [solved]

Posted: Wed Apr 12, 2017 12:18 pm
by Geocentrix
Hi

I'm a new user of madExcept. I am trying to integrate it into a C++ application built with C++Builder 10.1 Berlin, using the CLANG compiler.

I have installed madExcept and enabled it under Project > madExcept Settings.

However, when I build the application, I get the following linker error:
[ilink32-10.1 Error] Fatal: Unable to open file 'MADZIP.OBJ'
I cannot find madzip.obj anywhere.

What am I doing wrong?

Note that I don't get this error when I build using the BCC compiler.

Any help would be much appreciated.

Thanks!

Andrew Bond

Re: C++Builder 10.1 Berlin cannot link to madzip.obj

Posted: Wed Apr 12, 2017 12:21 pm
by Geocentrix
I may have just found the answer to my question:
madExcept currently only supports BCB 32bit
Dammit. I thought it supported only 32 bit (i.e. BCB and CLANG).

Can anyone confirm this is right?

Re: C++Builder 10.1 Berlin cannot link to madzip.obj

Posted: Wed Apr 12, 2017 12:55 pm
by madshi
I'm not sure I understand. You say you thought it supported only 32 bit. That's correct, and matches what you're quoting?

Re: C++Builder 10.1 Berlin cannot link to madzip.obj

Posted: Wed Apr 12, 2017 1:07 pm
by Geocentrix
Sorry, I was not very clear.

I understand that madExcept supports 32-bit Windows, using the BCC compiler only.

It does not support applications built with the CLANG compiler (32-bit or 64-bit).

Is that correct?

Re: C++Builder 10.1 Berlin cannot link to madzip.obj

Posted: Wed Apr 12, 2017 1:13 pm
by madshi
madExcept supports both 32bit and 64bit OSs, and both the 32bit and 64bit Delphi compiler. However, madExcept currently only supports the 32bit BCB compiler, not the 64bit BCB compiler. I don't think it matters which compiler you're using (CLANG or not). But 64bit BCB is currently not supported.

Re: C++Builder 10.1 Berlin cannot link to madzip.obj

Posted: Wed Apr 12, 2017 1:17 pm
by Geocentrix
madshi wrote:madExcept currently only supports the 32bit BCB compiler ... I don't think it matters which compiler you're using (CLANG or not)
Thanks for the response.

OK, so my original question is back on the table ... since I am using the CLANG compiler to produce a 32-bit C++ application.

I have installed madExcept and enabled it under Project > madExcept Settings.

However, when I build the application, I get the following linker error:

[ilink32-10.1 Error] Fatal: Unable to open file 'MADZIP.OBJ'

I cannot find madzip.obj anywhere.

What am I doing wrong?

Any help would be much appreciated.

Thanks!

Andrew Bond

Re: C++Builder 10.1 Berlin cannot link to madzip.obj

Posted: Wed Apr 12, 2017 1:23 pm
by madshi
By default the linker should be able to find all the necessary files automatically. For some reason that doesn't seem to work in your case. If you open "madZip.h", you'll see this:

Code: Select all

#pragma link "madZip"
#include "madZip.hpp"
I'm not completely sure where BCB gets the code from. Is it the "madZip.obj" file? Or is it the "madBasic_.lib" file? Both seems possible, I'm providing both.

My best guess is that in your setup, for some reason the path to "madCollectionRoot\madBasic\BDS18\win32" is not in the path list your linker searches through. Maybe CLANG uses a different library path setting?

Re: C++Builder 10.1 Berlin cannot link to madzip.obj

Posted: Wed Apr 12, 2017 2:08 pm
by Geocentrix
madshi wrote:... Maybe CLANG uses a different library path setting?
You've solved it!

Yes, the 32-bit CLANG compiler uses its own settings under Tools > Options > C++ Options > Paths and Directories.

The path to madBasic is written to the "Classic Compiler" (i.e. BCC) settings duting installation of madExcept but not to the "Compiler" (i.e. CLANG) settings.

I have therefore explicitly added the paths to madBasic, madDisAsm, and madExcept to my projects and it now compiles and runs!

Thanks.

Andrew

Re: C++Builder 10.1 Berlin cannot link to madzip.obj [solved

Posted: Wed Apr 12, 2017 2:10 pm
by madshi
Glad to hear that! :)