Click here to Skip to main content
15,898,538 members

Comments by Carlo Timossi 2021 (Top 1 by date)

Carlo Timossi 2021 17-Nov-21 12:08pm View    
Thank you for your prompt answer but I've tried but it does not work unfortunately:
I've put in C++ code:
extern "C" {
extern struct
{
short int nstream;
short int nunit;
short int ncomp;
} general_;

extern struct {
float tau;
} pi_;
}
This structure has been suggested by the article " How to access FORTRAN COMMON blocks from C/C++ - Advanced Features and User Routines - FLUKA User Forum[^]."
But I've got the following error list:

Severity Code Description Project File Line Suppression State
Error LNK1120 2 unresolved externals ConsoleApplication1 C:\Users\carlo.timossi\Projects\Examples\ConsoleApplication1\ConsoleApplication1\Debug\ConsoleApplication1.exe 1
Error (active) E0147 declaration is incompatible with "struct <unnamed> general_" (declared at line 12) ConsoleApplication1 C:\Users\carlo.timossi\Projects\Examples\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.cpp 12
Error (active) E0147 declaration is incompatible with "struct <unnamed> pi_" (declared at line 16) ConsoleApplication1 C:\Users\carlo.timossi\Projects\Examples\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.cpp 16
Error LNK2001 unresolved external symbol _general_ ConsoleApplication1 C:\Users\carlo.timossi\Projects\Examples\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj 1
Error LNK2001 unresolved external symbol _pi_ ConsoleApplication1 C:\Users\carlo.timossi\Projects\Examples\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj 1