473,320 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Linking problem while calling CPP function in C

hi, Iam calling CPP function in C , I get the following undefined references.

./mycppinc/libmycppinc.a(cpp_file.o)(.text+0xd): In function `std::__verify_grouping(char const*, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const'

./mycppinc/libmycppinc.a(cpp_file.o)(.text+0x60): In function `std::__verify_grouping(char const*, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned int) const'
Nov 13 '07 #1
2 1500
oler1s
671 Expert 512MB
You are calling C++ functions in C? This could potentially be problematic you realize? Especially because it looks like the C++ code relies on C++ standard libraries which obviously are not available in C.
Nov 13 '07 #2
weaknessforcats
9,208 Expert Mod 8TB
In general, you cannot call a C++ function from C.

To do so, the C++ function has to be specifically coded in a way that makes it available to C. I won't go into the method since it looks like you are interested in C only.
Nov 13 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Steven T. Hatton | last post by:
Is there anything that gives a good description of how source code is converted into a translation unit, then object code, and then linked. I'm particularly interested in understanding why putting...
20
by: Steven T. Hatton | last post by:
I just read this in the description of how C++ is supposed to be implemented: "All external object and function references are resolved. Library components are linked to satisfy external...
2
by: | last post by:
Help! I'm new to c++, and am breaking my teeth on MS Visual C++ (bundled within Visual Studio .NET 2003). Am trying to link simple c++ code to fortran dlls created in Compaq Visual Fortran (v6.1)....
7
by: wmkew | last post by:
Hello everyone I'm encountering a R6002 Runtime error and several bugs when trying to generate a simple Managed C++ application with .NET 2003. The main problem seems to arise from linking with...
6
by: Uli | last post by:
Hello, I'm trying to use a DLL (by static linking) which was compiled with Borland C++Builder (BCB) in Visual C++ (Visual-Studio 2003). All functions are declared with the directive 'extern...
0
by: dotyet | last post by:
Hi Everyone, I am trying to build a DB2 UDB UDF which can perform regex over the table data. The user defined function will call an external .dll file to do the task. I am referring to the...
3
by: kalyani1031 | last post by:
hi, my problem is linking my cli module with XORP modules. I am calling my cli_main() in the XORP router manager module rtrmgr. It takes the files and compiles the files that are in the router...
2
by: mdubey82 | last post by:
Dear Friends I am new to vc++; While debugging my vc++ project which is calling c# method (by referencing c# project) I got the linking error I just cant understand how to get rid of...
38
by: abasili | last post by:
Hi everyone, I'm trying to compile a C++ function and then call it from a C program. Since Google is my friend I've ended up to this link which seems very clear: ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.