[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bison complains about undefined reference of my own data type
From: |
sgaurelius |
Subject: |
Re: Bison complains about undefined reference of my own data type |
Date: |
Mon, 24 Nov 2008 01:55:01 -0800 (PST) |
I think you right, there is something wrong in the linkage.
Well, I am in the beginning of using Bison, so what I do is pretty basic. I
have indeed included properly the file, because when I create an instance of
my class(lets say variable.h), it throw me an error. When I only declare a
pointer to the class, it recognizes it, but it throws me an error when I try
to allocate memory for it.
Do you have any guide, on how to include a library to bison. I will search
it by myseld, but if you got somehting, it'd be useful.
Vukki Starborn wrote:
>
> What exactly say the compiler?
> If you get some undefined reference message on stage of compilation of
> bison
> output, then you must check if all needed definitions really included.
> If you get undefined reference message on linking stage, the solution
> usually is to add object file with implementation to project.
> Also there may be troubles at linking stage if different parts of your
> code
> compiled with different linkage (C vs C++). C++ compiler use demangling
> while C not.
> As i can see, the problem not in bison, but in proper way to link all of
> your code together.
>
> 2008/11/23 Efstratios Gavves <address@hidden>
>
> Hi!
>>
>> I am a newbie in bison, so I don't know all the secrets. I used for a
>> while
>> a standard example with its own data type and now I want to include my
>> own.
>> I included the header file, but the compiler throws me an exception for
>> undefined reference. However, this is not true, the implementation of the
>> function of my data types class are in the cpp file. The explanation I
>> can
>> give is the following.
>>
>> The example's data type was in a header file, let's say example.h. The
>> implementation was in the same .h file, so it worked. My data type's
>> implementation is in a separate .cpp file. So, there is some problem for
>> bison to recognize .cpp files? Maybe, because it is in C and not C++ ?
>>
>> Do you now if there is a solution? The cpp can't get into the h, because
>> they are already built, so I can't just change them all, it's a pretty
>> big
>> project.
>>
>> Thank you,
>> Stratis
>>
>>
>> _______________________________________________
>> address@hidden http://lists.gnu.org/mailman/listinfo/help-bison
>>
> _______________________________________________
> address@hidden http://lists.gnu.org/mailman/listinfo/help-bison
>
>
--
View this message in context:
http://www.nabble.com/Bison-complains-about-undefined-reference-of-my-own-data-type-tp20648597p20657771.html
Sent from the Gnu - Bison - Help mailing list archive at Nabble.com.
- Bison complains about undefined reference of my own data type, Efstratios Gavves, 2008/11/23
- Re: Bison complains about undefined reference of my own data type, Vukki Starborn, 2008/11/23
- Re: Bison complains about undefined reference of my own data type,
sgaurelius <=
- Re: Bison complains about undefined reference of my own data type, Vukki Starborn, 2008/11/24
- Re: Bison complains about undefined reference of my own data type, sgaurelius, 2008/11/28
- Re: Bison complains about undefined reference of my own data type, Laurence Finston, 2008/11/28
- Re: Bison complains about undefined reference of my own data type, Samuel Tardieu, 2008/11/28
- Re: Bison complains about undefined reference of my own data type, Laurence Finston, 2008/11/28
- Re: Bison complains about undefined reference of my own data type, Samuel Tardieu, 2008/11/28
- Re: Bison complains about undefined reference of my own data type, Laurence Finston, 2008/11/28
- Re: Bison complains about undefined reference of my own data type, Samuel Tardieu, 2008/11/28