|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Cannot Mix C Code
But if you compile everything as C++, the symbols should match up and the linker should have no problem. I'd focus on just getting it to compile as C++. I don't know why this should be too much of a problem. If it's some some stupid persistent project setting that you can't change or something, try copying the code into new .cpp files.
|
|
#2
|
|||||
|
|||||
|
Re: Cannot Mix C Code
Quote:
As to what the problem may be with your current extern "C" way, what is a "scheme *" type defined as? Is it a C type or a C++ class? Consult this FAQ for more information. |
|
#3
|
|||
|
|||
|
Re: Cannot Mix C Code
Thanks! It works now.
I did not recognize at first that the source file was compiled separately; I wanted to have .c in order to convey the fact that it is a C source file, rather than a C++ class. |
|
#4
|
|||
|
|||
|
Re: Cannot Mix C Code
I'm now facing the same issue, but this time I cannot merely rename the source file to .cpp because it contains numerous implicit type conversions which are considered errors in C++. Manual typecasting will probably take a week. Maybe I should try calling from inline asm to avoid name mangling issues, or simply rename the C functions to the mangled name...not elegant but this might work.
Last edited by nabioullinr : 02-09-2010 at 12:17 AM. |
|
#5
|
|||
|
|||
|
Re: Cannot Mix C Code
Or just put the header include inside an extern "C".
|
|
#6
|
|||
|
|||
|
Re: Cannot Mix C Code
That only works when the file has the extension .cpp (i.e., is compiled as C++).
|
|
#7
|
|||
|
|||
|
Re: Cannot Mix C Code
Exactly... so when you are including the C header file in a .cpp file, you include the header as extern "C".
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cannot deploy code | Patrick Chiang | FRC Control System | 18 | 03-16-2013 03:46 PM |
| Cannot Download Code | mandalorethx | C/C++ | 5 | 01-15-2010 12:44 PM |
| Cannot get Code to Download to cRIO | greekgod8591 | C/C++ | 25 | 03-09-2009 10:10 PM |
| Cannot Download Code to our Robot | jcvd | C/C++ | 9 | 01-27-2009 01:09 PM |