开发者

C++: undefined reference to function

开发者 https://www.devze.com 2023-04-03 06:07 出处:网络
I have the problem, that I开发者_Python百科 want to compile some software using the lib hqp. This lib uses adolc, but a deprecated function from an old version. As I only have the new version, one cla

I have the problem, that I开发者_Python百科 want to compile some software using the lib hqp. This lib uses adolc, but a deprecated function from an old version. As I only have the new version, one class (adoublev) is missing and I get compile errors. Now I try to write a wrapper but here I get errors.

Before: I was till now not aware of the problem and compiled hqp with the new version of adolc. I wrote a simple adoublev class that has the necessary operators implemented (operator[]).

Now I want to compile a example. I get

Prg_T2Topt.o:(.rodata._ZTV10Prg_T2Topt[vtable for Prg_T2Topt]+0x20):
  undefined reference to `Omu_Program::consistic(int, double, adoublev const&, adoublev const&, adoublev&)'

Notice: Prg_T2Topt.* is my example and Omu_Program is part of hqp.

Why did the first installation of hqp not end up with an error about a missing declaration/definition of adoublev (gcc/g++ used)? Do I need to update hqp such that I does not use adoublev anymore?

Why does the compilation of my example result in an error about consistic even though this method is not implemented in the example?

The example can be found in http://codepad.org/Cv0tdoyS and http://codepad.org/ezQQPUg4 (is a bit lengthy)


Since your class Prg_T2Topt is based on Omu_Program, it inherits Omu_Program's methods including consistic(), and since your class does not override consistic(), compiler is trying to use Omu_Program::consistic().

What libraries are you linking with? It looks like you missing something during linking phase.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号