How can I import CLASSES from .DLL by external compiler?

Nothing to do with ROOT, you must add this to the Windows System (or user) PATH environment variable.
(take a look at root.cern.ch/phpBB2/viewtopic.php?t=5411)

Cheers,
Bertrand.

[quote=“fine”][quote=“SBegun”]Hi there,
I am a beginner in ROOT and VC++.
How can I import classes like TStopwatch or TComplex from .dll libraries of ROOT
using VC++ 8.0 environment?
I need this to build .exe file of the project to speed up the calculation.
When I tried to use method with FARPROC pointer the message that TStopwatch is not a class or namespace appears.
Was these DLLs compiled without __declspec() options to classes?
Is the only way to compile the ROOT project with classes support under Windows to use Cygwin?
Where can I find the detailed instruction on how to do this?

Thanks a lot for future reply.[/quote]Did you try ACliC? (see: ftp://root.cern.ch/root/doc/7CINT.pdf page 93)[/quote]

Thank you.
I prefer use .EXE files. To compile .DLLs in ACliC I anyway need VC++ compiler installed.
Thus I would better make .EXE file by VC++ compiler.

Cheers, Sergij

[quote=“bellenot”]Nothing to do with ROOT, you must add this to the Windows System (or user) PATH environment variable.
(take a look at root.cern.ch/phpBB2/viewtopic.php?t=5411)

Cheers,
Bertrand.[/quote]

I have added these PATHs. I have VC++ 8.0 compiler and the Totpr.dll is generated by ACLiC with Run Time Error R6034 in root.exe. Thus I would better prefer to make .EXE files and .DLL files directly by VC++ compiler.

Cheers, Sergij

In fact, there is no technical reason to choose the custom “exe” vs the DLL created by ACliC. The only “advantage” of your approach is the extra troubles :wink: you are encountering.

[quote=“SBegun”]To compile .DLLs in ACliC I anyway need VC++ compiler installed.
[/quote]Yes, it is correct.

[quote=“SBegun”]Thus I would better make .EXE file by VC++ compiler. [/quote]You said you are “beginer”.

[quote=“SBegun”]I am a beginner in ROOT and VC++. [/quote] As a such you are strongly advised to use ACLiC.

Read root.cern.ch/root/HowtoWindows.html
Try some simple example.

  1. Create the C++ file “testStopWatchAccess.cxx”:

#include "TStopwatch.h" void testStopWatchAccess() { TStopwatch a; a.Print(); }2. Start the ROOT session by invoking root.exe
3. On ROOT prompt, type

.x testStopWatchAccess.cxx++At this point your small example should be compiled with your VC++, linked against of the appropriated ROOT DLL’s, loaded in the current ROOT session and executed.

[code]C:>root.exe -b -q -l testStopWatchAccess.cxx++

Welcome to the ROOT tutorials

Type “.x demos.C” to get a toolbar from which to execute the demos

Type “.x demoshelp.C” to see the help window
root [0]
Processing testStopWatchAccess.cxx++…
Info in TWinNTSystem::ACLiC: creating shared library C:\testStopWatchAccess_cxx.dll
22588140_cint.cxx
sde0_.cxx
Creating library C:\testStopWatchAccess_cxx.lib and object C:\testStopWatchAccess_c
xx.exp
Real time 0:00:00, CP time 0.000

This is the end of ROOT – Goodbye
[/code]
After all you should find a bunch of the new files:

[code]C:>dir testStopWatchAccess*
Volume in drive C is System Disk
Volume Serial Number is 1879-4E1C

Directory of C:
09/12/2007 10:52 AM 89 testStopWatchAccess.cxx
09/12/2007 10:53 AM 1,408 testStopWatchAccess_cxx.def
09/12/2007 10:54 AM 21,504 testStopWatchAccess_cxx.dll
09/12/2007 10:53 AM 6,303 testStopWatchAccess_cxx.exp
09/12/2007 10:53 AM 10,060 testStopWatchAccess_cxx.lib
09/12/2007 10:54 AM 543,744 testStopWatchAccess_cxx.pdb
6 File(s) 583,108 bytes[/code]
If that doesn’t work for you, this means you have some sort of the installation proble, REad the ROOT Manual andf then Seek the ROOT team / community assistance to fix your installation if any.

In fact, there is no technical reason to choose the custom “exe” vs the DLL created by ACliC. The only “advantage” of your approach is the extra troubles :wink: you are encountering.

[quote=“SBegun”]To compile .DLLs in ACliC I anyway need VC++ compiler installed.
[/quote]Yes, it is correct.

[quote=“SBegun”]Thus I would better make .EXE file by VC++ compiler. [/quote]You said you are “beginer”. As a such your strongly advised to use ACLiC.

Read root.cern.ch/root/HowtoWindows.html
Try some simple example.

  1. Create the C++ file “testStopWatchAccess.cxx”:

#include "TStopwatch.h" void testStopWatchAccess() { TStopwatch a; a.Print(); }2. Start the ROOT session by invoking root.exe
3. On ROOT prompt, type

.x testStopWatchAccess.cxx++At this point your small example should be compiled with your VC++, linked against of the appropriated ROOT DLL’s, loaded in the current ROOT session and executed.

[code]C:>root.exe -b -q -l testStopWatchAccess.cxx++

Welcome to the ROOT tutorials

Type “.x demos.C” to get a toolbar from which to execute the demos

Type “.x demoshelp.C” to see the help window
root [0]
Processing testStopWatchAccess.cxx++…
Info in TWinNTSystem::ACLiC: creating shared library C:\testStopWatchAccess_cxx.dll
22588140_cint.cxx
sde0_.cxx
Creating library C:\testStopWatchAccess_cxx.lib and object C:\testStopWatchAccess_c
xx.exp
Real time 0:00:00, CP time 0.000

This is the end of ROOT – Goodbye
[/code]
After all you should find a bunch of the new files:

[code]C:>dir testStopWatchAccess*
Volume in drive C is System Disk
Volume Serial Number is 1879-4E1C

Directory of C:
09/12/2007 10:52 AM 89 testStopWatchAccess.cxx
09/12/2007 10:53 AM 1,408 testStopWatchAccess_cxx.def
09/12/2007 10:54 AM 21,504 testStopWatchAccess_cxx.dll
09/12/2007 10:53 AM 6,303 testStopWatchAccess_cxx.exp
09/12/2007 10:53 AM 10,060 testStopWatchAccess_cxx.lib
09/12/2007 10:54 AM 543,744 testStopWatchAccess_cxx.pdb
6 File(s) 583,108 bytes[/code]
If that doesn’t work for you, this means you have some sort of the installation proble, REad the ROOT Manual andf then Seek the ROOT team / community assistance to fix your installation if any.[/quote]

I have tried with the same result Run time error R6034.
I have ROOT 5.17.02 installed from this link
ftp://root.cern.ch/root/root_v5.17.02.win32gdk.msi

Cheers, Sergij

[quote=“SBegun”]I have VC++ 8.0 compiler and the Totpr.dll is generated by ACLiC with Run Time Error R6034 in root.exe. Thus I would better prefer to make .EXE files and .DLL files directly by VC++ compiler.
Cheers, Sergij[/quote]Can you upload your Totpr to understand what we are speaking about. Mean time, can you try the example I had posted.

[quote=“SBegun”]I have VC++ 8.0 compiler and the Totpr.dll is generated by ACLiC with Run Time Error R6034 in root.exe. Thus I would better prefer to make .EXE files and .DLL files directly by VC++ compiler.
[/quote]The Run-time error R6034 indicates the problem with your original ROOT DLLs installation rather with root.exe or ACLiC.
Did you compile ROOT with VC++8.0 yourself?

[quote=“fine”][quote=“SBegun”]I have VC++ 8.0 compiler and the Totpr.dll is generated by ACLiC with Run Time Error R6034 in root.exe. Thus I would better prefer to make .EXE files and .DLL files directly by VC++ compiler.
Cheers, Sergij[/quote]Can you upload your Totpr to understand what we are speaking about. Mean time, can you try the example I had posted.[/quote]

I have tried with your example.
Run Time error R6034

Cheers, Sergij

[quote=“SBegun”]I have tried with the same result Run time error R6034.
I have ROOT 5.17.02 installed from this link
ftp://root.cern.ch/root/root_v5.17.02.win32gdk.msi
[/quote]It was comlpiled with VC v.7.1 This can be source of R6034 error. Switchig to “exe” does not help you to get rid of that error. Can you try the ROOT compiled with VC++ v.8.0 instead from root.bnl.gov
It is “one click” installation. It should set the env automatically with no extra effort. Let me know as soon as you get any trouble. (May be you need to uninstall your 7.1 compiled ROOT first).

[quote=“SBegun”]
I have tried with your example.
Run Time error R6034
Cheers, Sergij[/quote]Can you upload your example?

Sergij,

With Visual C++ 8.0, you should use one of the following:
ftp://root.cern.ch/root/root_v5.17.02.w … .debug.msi
ftp://root.cern.ch/root/root_v5.17.02.w … bug.tar.gz
ftp://root.cern.ch/root/root_v5.17.02.win32.vc80.msi
ftp://root.cern.ch/root/root_v5.17.02.win32.vc80.tar.gz

Cheers,
Bertrand.

Thank you.

Now I can use this option without errors.

With best regards.