| Anonymous | Login | Signup for a new account | 2013-05-22 08:17 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
| 0005467 | OCaml | OCaml general | public | 2012-01-06 23:35 | 2012-01-07 00:04 | |||||||
| Reporter | testcocoon | |||||||||||
| Assigned To | meyer | |||||||||||
| Priority | normal | Severity | minor | Reproducibility | always | |||||||
| Status | resolved | Resolution | duplicate | |||||||||
| Platform | Godi | OS | Linux | OS Version | ||||||||
| Product Version | 3.12.1 | |||||||||||
| Target Version | Fixed in Version | |||||||||||
| Summary | 0005467: no extern "C" into ocaml C-stub headers | |||||||||||
| Description | When creating a binding to C++ code it is necessary to compile against a C++ compiler (ex g++). in this case using caml_copy_string() function produces a linker issue: llvmex_ocaml.o: In function `llvmex_get_as_string': llvmex_ocaml.c:(.text+0x127): undefined reference to `caml_copy_string(char const*)' The problem is due to the fact that caml_copy_string is seen as C++ symbol (not as C symbol). To correct the issue it is necessary to put extern "C" around the ocaml headers: extern "C" { #include "caml/alloc.h" #include "caml/custom.h" #include "caml/memory.h" #include "caml/fail.h" #include "caml/callback.h" } In my opinion this should not be the case. It would be better that the headers starts with: #ifdef __cplusplus extern "C" { #endif and ends with: #ifdef __cplusplus } #endif To enable the possibility to use it in C and C++. | |||||||||||
| Tags | No tags attached. | |||||||||||
| Attached Files | ||||||||||||
Relationships |
||||||
|
||||||
Notes |
|
|
(0006619) meyer (developer) 2012-01-06 23:58 |
Sorry a bit tired today, I thought i changed to resolve by mistake, now I see it's a dupe |
|
(0006620) protz (manager) 2012-01-07 00:04 |
No worries! |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2012-01-06 23:35 | testcocoon | New Issue | |
| 2012-01-06 23:44 | meyer | Assigned To | => meyer |
| 2012-01-06 23:44 | meyer | Status | new => assigned |
| 2012-01-06 23:45 | protz | Relationship added | duplicate of 0004963 |
| 2012-01-06 23:45 | protz | Status | assigned => resolved |
| 2012-01-06 23:45 | protz | Resolution | open => duplicate |
| 2012-01-06 23:57 | meyer | Status | resolved => new |
| 2012-01-06 23:58 | meyer | Note Added: 0006619 | |
| 2012-01-06 23:58 | meyer | Status | new => resolved |
| 2012-01-07 00:04 | protz | Note Added: 0006620 | |
| Copyright © 2000 - 2011 MantisBT Group |