- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have the fortran calling a C function working properly. I want to be able to include some simple C++ classes within my C code so I renamed my file with a *.cpp suffix. Now, I cannot get the linker to find my function anymore in my *.cpp file. Do I have to declare something different now that I am using a *.cpp filename? Maybe I have to do something different with the underscores.
Thanks,
Tim
I have the fortran calling a C function working properly. I want to be able to include some simple C++ classes within my C code so I renamed my file with a *.cpp suffix. Now, I cannot get the linker to find my function anymore in my *.cpp file. Do I have to declare something different now that I am using a *.cpp filename? Maybe I have to do something different with the underscores.
Thanks,
Tim
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you use .cpp then C++ name mangling is applied - use
extern "C"
to name your routines and disable name mangling.
Steve
extern "C"
to name your routines and disable name mangling.
Steve
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