CINT 5.15.174 and Unresolved externals

Hello

I am trying to rebuild CINT 5.15.174 using the Borland Compiler but I am getting the following unresolved externals. I read somewhere about someone else having a similar problem and the solution was to download an updated Microsoft makefile from the VCS. However that would probably not solve the issue using Borland C compiler.

Does anyone have any ideas of how to resolve this issue or should I go back to an earlier version such as 5.15.173 ??

thanks in advance
david

[quote]Borland C++ 5.5.1 for Win32 Copyright © 1993, 2000 Borland
Turbo Incremental Link 5.00 Copyright © 1997, 2000 Borland
Error: Unresolved external ‘_G__exec_bytecode’ referenced from C:\CINT\SRC\FUNC.OBJ
Error: Unresolved external ‘_G__bc_new_operator’ referenced from C:\CINT\SRC\NEW.OBJ
Error: Unresolved external ‘_G__Isvalidassignment_val’ referenced from C:\CINT\SRC\VAR.OBJ
Error: Unresolved external ‘_G__bc_conversion’ referenced from C:\CINT\SRC\VAR.OBJ
Error: Unresolved external ‘_G__bc_REWINDSTACK’ referenced from C:\CINT\SRC\VAR.OBJ
Error: Unresolved external ‘_G__bc_throw_compile_error’ referenced from C:\CINT\SRC\ERROR.OBJ
Error: Unresolved external ‘_G__bc_throw_runtime_error’ referenced from C:\CINT\SRC\ERROR.OBJ
Error: Unresolved external ‘_G__bc_VIRTUALADDSTROS’ referenced from C:\CINT\SRC\IFUNC.OBJ
Error: Unresolved external ‘_G__bc_exec_virtual_bytecode’ referenced from C:\CINT\SRC\IFUNC.OBJ
Error: Unresolved external ‘_G__bc_Baseclassctor_vbase’ referenced from C:\CINT\SRC\IFUNC.OBJ
Error: Unresolved external ‘_G__bc_exec_ctor_bytecode’ referenced from C:\CINT\SRC\IFUNC.OBJ
Error: Unresolved external ‘_G__bc_exec_normal_bytecode’ referenced from C:\CINT\SRC\IFUNC.OBJ
Error: Unresolved external ‘_G__bc_compile_function’ referenced from C:\CINT\SRC\IFUNC.OBJ
Error: Unresolved external ‘_G__bc_delete_vtbl’ referenced from C:\CINT\SRC\SCRUPTO.OBJ
Error: Unresolved external ‘_G__exec_asm’ referenced from C:\CINT\SRC\PARSE.OBJ
Error: Unresolved external ‘_G__bc_showstack’ referenced from C:\CINT\SRC\PAUSE.OBJ
Error: Unresolved external ‘_G__bc_setdebugview’ referenced from C:\CINT\SRC\PAUSE.OBJ
Error: Unresolved external ‘_G__bc_cancel_VIRTUALADDSTROS’ referenced from C:\CINT\SRC\OPR.OBJ
Error: Unresolved external ‘_G__bc_objassignment’ referenced from C:\CINT\SRC\VAR.OBJ
Error: Unresolved external ‘_G__bc_assignment’ referenced from C:\CINT\SRC\VAR.OBJ
Error: Unresolved external ‘_G__bc_delete_operator’ referenced from C:\CINT\SRC\NEW.OBJ
Error: Unresolved external ‘_G__bc_disp_vtbl’ referenced from C:\CINT\SRC\DISP.OBJ
Error: Unresolved external ‘_G__bc_struct’ referenced from C:\CINT\SRC\STRUCT.OBJ

** error 1 ** deleting \cint\libcint.dll

** error 1 ** deleting c:\cint\libcint.lib[/quote]

Hi,

You are missing the linking against the src/bc_*.cxx files.

You may want to try cint 5.17/00 or the head of the svn trunk instead.

Cheers,
Philippe.

[quote=“pcanal”]Hi,

You are missing the linking against the src/bc_*.cxx files.

You may want to try cint 5.17/00 or the head of the svn trunk instead.

Cheers,
Philippe.[/quote]

Hello Philippe,

Where do I find this bit about the missing linking ?? Is it in the make files ??

Also how do I access cint 5.17 and what commands do I need to invoke to retrieve it ??

Also the other issue is why is there a bc_exec.cxx file (which defines G__exec_bytecode function) but no corresponding object file. How does it ever get linked into the main project ??

I can’t work out why it all compiles OK in 5.15.153 but not in 5.15.174.

Can you shed some light on this ??

regards
david

[quote]Where do I find this bit about the missing linking ?? Is it in the make files ?? [/quote]Yes, it would be in one of the CINT makefiles.

[quote]Also the other issue is why is there a bc_exec.cxx file (which defines G__exec_bytecode function) but no corresponding object file. How does it ever get linked into the main project ?? [/quote]This is the issue :slight_smile:. The makefile is ‘forgetting’ to compile and link this file.

or you can also download the trunk:

Cheers,
Philippe.

PS. Can you remind me where you downloaded 5.15.174 from?

[quote=“pcanal”]

PS. Can you remind me where you downloaded 5.15.174 from?[/quote]

I found it from a google search.

Also with version 5.17.00 the configuration file doesn’t support the borland compiler.

I have managed to put the additional cxx files back into the make for 5.15.174 but now I get some strange errors such as

[code] bcc32 -P -Ic:\Borland\BCC55\Include -I… -O2 -DG__BORLANDCC5 -DG__NEWSTDHEADER -c bc_exec.cxx
Borland C++ 5.5.1 for Win32 Copyright © 1993, 2000 Borland
bc_exec.cxx:
Error E2132 C:\Program Files\Borland\CBuilder5\Include\stdlib.h 434: Templates and overloaded operators cannot have C linkage
Error E2040 C:\Program Files\Borland\CBuilder5\Include\stdlib.h 434: Declaration terminated incorrectly
Error E2316 C:\Program Files\Borland\CBuilder5\Include\stdlib.h 505: ‘_argc’ isnot a member of 'std’
Error E2272 C:\Program Files\Borland\CBuilder5\Include\stdlib.h 505: Identifier expected
Error E2316 C:\Program Files\Borland\CBuilder5\Include\stdlib.h 506: ‘_argv’ is not a member of 'std’
Error E2272 C:\Program Files\Borland\CBuilder5\Include\stdlib.h 506: Identifier expected
Error E2316 C:\Program Files\Borland\CBuilder5\Include\stdlib.h 603: ‘min’ is not a member of 'std’
Error E2272 C:\Program Files\Borland\CBuilder5\Include\stdlib.h 603: Identifier expected
Error E2316 C:\Program Files\Borland\CBuilder5\Include\stdlib.h 604: ‘max’ is not a member of 'std’
Error E2272 C:\Program Files\Borland\CBuilder5\Include\stdlib.h 604: Identifier expected
Error E2190 bc_exec.h 30: Unexpected }
Warning W8027 bc_autoobj.h 93: Functions containing while are not expanded inline
Warning W8066 bc_exec.cxx 302: Unreachable code in function G__bc_exec_try_bytecode(int,int,G__value *,long)
Warning W8066 bc_exec.cxx 325: Unreachable code in function G__bc_exec_typematch_bytecode(G__value *,G__value *)
Error E2285 C:\Program Files\Borland\CBuilder5\Include\deque.cc 60: Could not find a match for ‘max<T,Compare>(unsigned int,unsigned int)’ in function deque<G__bc_funccall,allocator<G__bc_funccall> >::__buffer_size()
Warning W8066 bc_exec.cxx 622: Unreachable code in function G__bc_throw_compile_error()
Warning W8066 bc_exec.cxx 630: Unreachable code in function G__bc_throw_runtime_error()
*** 12 errors in Compile ***

** error 1 ** deleting bc_exec.obj

** error 1 ** deleting c:\cint\libcint.lib [/code]

Hi,

Out of curiosity what made you chose to use the Borland compiler (which seems old)? [Note for example that Microsoft is currently give out for free their latest C++ compiler).

I am not familiar with the Borland compiler. To investigate the problem I would first look at the content of C:\Program Files\Borland\CBuilder5\Include\stdlib.h around the lines 434 and 505. (The message is odd, especially since this is a system header … I suspect that this might be due to some mis-placed #define(s)).

Cheers,
Philippe.

[quote=“pcanal”]Hi,

Out of curiosity what made you chose to use the Borland compiler (which seems old)? [Note for example that Microsoft is currently give out for free their latest C++ compiler).

I am not familiar with the Borland compiler. To investigate the problem I would first look at the content of C:\Program Files\Borland\CBuilder5\Include\stdlib.h around the lines 434 and 505. (The message is odd, especially since this is a system header … I suspect that this might be due to some mis-placed #define(s)).

Cheers,
Philippe.[/quote]

I’m using the Borland compiler because I have developed an app with it and its Codeguard debugger has detected some resource leakage and mismatch problems with the earlier Cint code so I am trying to see if this is fixed in the later versions of Cint. Without codeguard the resource leakage problems may go undetected and course other side effects.

With regards to the compiler messages I have made some headway. The problem with compiling the cxx files can be fixed if I include the stdlib.h header as the first line of code before the other includes. In fact each cxx file appears to need this change in order to compile properly. I have built the whole project and CINT seems to work. However makecint seems to cause an exception error.

regards
david

I have got it going again but I am still having resource mismatch problems.

If I declare the following class in UserMain.h and use makecint to add it to the dictionary.

class TestClass {
  public:
    int X;

    TestClass();
    TestClass(int _X);
    TestClass operator=(TestClass &_J);
    ~TestClass();
};

extern "C" TestClass foo;[/code]

And the member functions are declared in my app as follows.

[code]TestClass::TestClass()
{
  X=0;
}

TestClass::TestClass(int _X)
{
  X=_X;
}

TestClass TestClass::operator=(TestClass &_J)
{
  X=_J.X;
  return(*this);
}

TestClass::~TestClass()
{
  X=0;
}[/code]

If I access the external object in a script and assign a value to it then I get a resource mismatch which is caused by a temporary object being created with new and destroyed with free() instead of delete.

[code]void Test(void)
{
  foo=TestClass(1);
}




Hi,

We corrected a similar sounding problem in the svn head of CINT.
If you were able to get CodeGuard to give you more information (i.e. at the least the name of the function), I would be able to cross-check that this is the same problem. (I am guessing you need to build in ‘debug’ mode to see more information).

Cheers,
Philippe.

[quote=“pcanal”]Hi,

We corrected a similar sounding problem in the svn head of CINT.
If you were able to get CodeGuard to give you more information (i.e. at the least the name of the function), I would be able to cross-check that this is the same problem. (I am guessing you need to build in ‘debug’ mode to see more information).

Cheers,
Philippe.[/quote]

Actually I’d already tried that but the debugger seemed to be landing in another part so I modded the makefile generated by makecint.exe to include debugging information for all of the G__UserMain files and it has landed the debugger at the call to free() in G__cpp_UserMain.cpp.

Hi,

This was indeed fixed in cint 5.16.8. (See root.cern.ch/viewvc/trunk/cint/c … g#rev14018)

I strongly recommend that you upgrade to the v5.17.00 or the trunk.

Cheers,
Philippe.

Hello Phillipe

This might seem like a dumb question but how do I go about building 5.17 on a Windows machine ??

Do I use cygwin ??

regards
david

Take a more recent version from the ROOT web site, eg version 5.23/04

Rene

[quote]Do I use cygwin ?? [/quote]Yes :slight_smile:. We use cygwin’s make (and shell) for running the build and Microsoft’s compiler was actually doing the compilation.

Cheers,
Philippe.

Hello Philippe

I would like to focus on getting 5.17.00 going using the borland compiler and then I can try the later versions of CINT. So far I have had no luck with any other version except 5.15.153 :cry:

Looking at the make file settings for the borland compiler on earlier versions could you suggest what I need to add to the configuration file ??

Also once I have the configuration file what is the command to build cint from cygwin ??

regards
david

[code]CINTSYSDIR = \cint
############################################################

platform/borlandcc5

Platform dependent information for Borland C++ Compiler 5.5

############################################################

#BCCDIR = c:\Borland\BCC55
#BCCINC = -I$(BCCDIR)\Include
#BCCLIB = -L$(BCCDIR)\Lib

Tools

RM = del
CP = copy
KRCC = bcc32 $(BCCINC)
CC = bcc32 $(BCCINC)
CPP = bcc32 -P $(BCCINC)
LD = bcc32 $(BCCINC) $(BCCLIB)
CPREP = cpp32 -Sr -Sc $(BCCINC)
CPPPREP = cpp32 -Sr -Sc $(BCCINC)

Compiler and linker option

CCDLLOPT =
LDDLLOPT = -WD
OPTIMIZE = -O2
LDOPT =
SHLIB_OPT =
SYSMACRO = -DG__BORLANDCC5 -DG__NEWSTDHEADER
OTHMACRO =
SYSIPATH =

libraries

MAINO = $(CINTSYSDIR)\main\G__cppmain.obj
CINTLIB = $(CINTSYSDIR)/libcint.lib
READLINEA =
APIO = Api.obj Class.obj BaseCls.obj Type.obj DataMbr.obj Method.obj MethodAr.obj CallFunc.obj Typedf.obj Apiif.obj Token.obj
RANLIB =
STDLIBS = cbstrm.obj v6_stdstrct.obj
PLATFORM = v6_winnt.obj

source code postfix

CSRCPOST = .c
CHDRPOST = .h
CPPSRCPOST = .cpp
CPPHDRPOST = .h
OBJPOST = .obj
DLLPOST = .dll[/code]

Hi,

To build, you need to do:configure make
This will ‘guess’ the platform and then build.

To upgrade to using borland, you will need to edit the file named configure add the necessary stuff (see below :slight_smile:) for borland and do:configure --arch=borland make(See also configure --help).

In configure you will to

  • edit the ARCHS variable to ‘borland’
  • creation a function named config_borland whose content would/should be similar to the content of config_msvc7

Cheers,
Philippe.

Hello Phillipe

Regarding the configuration file, which variables are needed and what are the definitions of them ?? I can sort of figure out a few of the obvious ones but maybe you can throw some light on the rest of them. For example COUT and COUTEXE ??

Is there any documentation for this ??

regards
david

Hi,

see the beginning of configure: “Lines demonstrating the use of the available variables”. COUT is the compiler compilation unit output filename flag, usually -o. COUTEXE is the linker binary output flag, for GCC still -o, but for MSVC it’s different. You will need the exported variables (referenced by the EXPORTS variable) that are defined in the MSVC section if you build on Windows.

Cheers, Axel.

Hello Axel

I can’t see an option for the compilation unit output flag.

These are the compiler options available from borland bcc32.exe.

Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland Syntax is: BCC32 [ options ] file[s] * = default; -x- = turn switch x off -3 * 80386 Instructions -4 80486 Instructions -5 Pentium Instructions -6 Pentium Pro Instructions -Ax Disable extensions -B Compile via assembly -C Allow nested comments -Dxxx Define macro -Exxx Alternate Assembler name -Hxxx Use pre-compiled headers -Ixxx Include files directory -K Default char is unsigned -Lxxx Libraries directory -M Generate link map -N Check stack overflow -Ox Optimizations -P Force C++ compile -R Produce browser info -RT * Generate RTTI -S Produce assembly output -Txxx Set assembler option -Uxxx Undefine macro -Vx Virtual table control -X Suppress autodep. output -aN Align on N bytes -b * Treat enums as integers -c Compile only -d Merge duplicate strings -exxx Executable file name -fxx Floating point options -gN Stop after N warnings -iN Max. identifier length -jN Stop after N errors -k * Standard stack frame -lx Set linker option -nxxx Output file directory -oxxx Object file name -p Pascal calls -tWxxx Create Windows app -u * Underscores on externs -v Source level debugging -wxxx Warning control -xxxx Exception handling -y Produce line number info -zxxx Set segment names

These are the linker options available from borland ilink32.exe

Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland Syntax: ILINK32 objfiles, exefile, mapfile, libfiles, deffile, resfiles @xxxx indicates use response file xxxx General Options: -Af:nnnn Specify file alignment -C Clear state before linking -Ao:nnnn Specify object alignment -wxxx Warning control -ax Specify application type -Enn Max number of errors -b:xxxx Specify image base addr -r Verbose linking -Txx Specify output file type -q Supress banner -H:xxxx Specify heap reserve size -c Case sensitive linking -Hc:xxxx Specify heap commit size -v Full debug information -S:xxxx Specify stack reserve size -Gn No state files -Sc:xxxx Specify stack commit size -Gi Generate import library -Vd.d Specify Windows version -GD Generate .DRC file -Dstring Set image description Map File Control: -Vd.d Specify subsystem version -M Map with mangled names -Ud.d Specify image user version -m Map file with publics -GC Specify image comment string -s Detailed segment map -GF Set image flags -x No map -Gl Static package Paths: -Gpd Design time only package -I Intermediate output dir -Gpr Runtime only package -L Specify library search paths -GS Set section flags -j Specify object search paths -Gt Fast TLS Image Control: -Gz Do image checksum -d Delay load a .DLL -Rr Replace resources

Also if I run configure from cygwin I get the following

$ configure. bash: configure.: command not found