- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am working on software containing both Fortran & C parts.
My main() function is written in C (compiled with GCC 3.2.3) but the biggest part of the sources are prepared for IFC (9.0).
To compile and link the package I had to modify standard C signature for main() function:
Standard:
int main(int argc, char ** argv)
Modified version:
void MAIN__()
After the modification I am not able to get and process command line arguments (argc & argv). Even if I modify MAIN__ signature to handle them:
void MAIN__(int argc, char ** argv)
both variables (arg*) contain trashes.
Is there any way to handle command line arguments from C code linked with object files compiled with IFC ?
I tried to do the same with G95 and it seems to work :(
I am working on software containing both Fortran & C parts.
My main() function is written in C (compiled with GCC 3.2.3) but the biggest part of the sources are prepared for IFC (9.0).
To compile and link the package I had to modify standard C signature for main() function:
Standard:
int main(int argc, char ** argv)
Modified version:
void MAIN__()
After the modification I am not able to get and process command line arguments (argc & argv). Even if I modify MAIN__ signature to handle them:
void MAIN__(int argc, char ** argv)
both variables (arg*) contain trashes.
Is there any way to handle command line arguments from C code linked with object files compiled with IFC ?
I tried to do the same with G95 and it seems to work :(
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Don't change the C main. Do build the Fortran code with -nofor_main.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you,
Sebastian
Sebastian

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page