Lost Password?


Go Back   CodeCall Programming Forum > Software Development > C and C++

C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-09-2008, 06:21 AM
almeria_new almeria_new is offline
Newbie
 
Join Date: Jan 2008
Posts: 3
Rep Power: 0
almeria_new is on a distinguished road
Default Error "undefined reference to..."

Hi!
The first thing to appear and thank you for the help that offers individuals like me
I have used google looking for this mistake and the majority of times appears on having wanted to compile some unload or to install some program and is commented that it is a thing of the gcc.
I am trying to realize an application that uses together files of code C and C ++. The files of C I them can modify to my broad ones, but they of C ++ are used by some libraries and functions that have prohibited me to modify.
This mistake me turns out to be always related to the calls that are done from the Class of C ++ to methods of C. If it does not matter for you, I put the exit of console:
Code:
host:~/Desktop/gop1 # make
gcc -c -I/usr/cxsc/include new_lst1_ari.cpp
gcc -c -I/usr/cxsc/include new_gop1.cpp
gcc new_lst1_ari.o new_gop1.o avl.o gop1_ex.cpp -o salida -I/usr/cxsc/include -L/usr/cxsc/lib -lcxsc
new_lst1_ari.o: In function `ArbolToVector(_nodo*, cxsc::ivector&, cxsc::intvector&)':
new_lst1_ari.cpp:(.text+0x5f7): undefined reference to `NumeroNodos(_nodo*, int*)'
new_gop1.o: In function `GlobalOptimize(DerivType (*)(DerivType const&), cxsc::interval, cxsc::real, _nodo*&, int&, cxsc::interval&)':
new_gop1.cpp:(.text+0x3ca): undefined reference to `NumeroNodos(_nodo*, int*)'
new_gop1.cpp:(.text+0x1515): undefined reference to `Insertar(_nodo**, double, double, double)'
new_gop1.cpp:(.text+0x1649): undefined reference to `Podar(_nodo**)'
new_gop1.cpp:(.text+0x16eb): undefined reference to `Insertar(_nodo**, double, double, double)'
new_gop1.o: In function `New_AllGOp1(DerivType (*)(DerivType const&), cxsc::interval, cxsc::real, cxsc::ivector&, cxsc::intvector&, int&, cxsc::interval&, int&, int)':
new_gop1.cpp:(.text+0x1b1b): undefined reference to `Podar(_nodo**)' collect2: ld returned 1 exit status

I have put in boldface the methods of C that are called from the class of C ++. And that I believe that they give the mentioned mistake.
If you need some information more at all mas to ask for it.
Thank you!!!

Last edited by v0id; 01-09-2008 at 06:59 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 01-09-2008, 07:55 AM
almeria_new almeria_new is offline
Newbie
 
Join Date: Jan 2008
Posts: 3
Rep Power: 0
almeria_new is on a distinguished road
Default solution??

#include <cstdio>
extern "C" {
#include "avl.h"
}

I find it in this web:
[32] How to mix C and C++, C++ FAQ Lite
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Grabbing a Reference of a Property Nabusman C# Programming 3 12-23-2007 09:04 AM
reference to items in array Igor Java Help 3 12-19-2007 12:08 PM
What does he mean? Zephyr General Programming 2 09-30-2007 04:08 AM
A reference to '....' could not be added... alexgrey Visual Basic Programming 1 09-06-2007 01:50 PM
.NET problem with printing a barcode honzac32 C# Programming 3 07-10-2007 04:41 PM


All times are GMT -5. The time now is 11:14 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 101%


Complete - Celebrate!

Ads