c++ - Undefined reference error to linked class -


I can not understand how I can fix this linking issue for my life. I have installed a simple #include and I still get this error I know that IDE understands that the file is linked, because I get all the other errors when the header file is moved.

I'm a propeller-GCC for the record

This is the complete project:

simplelink.cpp

  #include "testclass .h "int main (zero) {TestClass test1 = TestClass (); Return test1.value; }   

testclass.h (in the same directory as simplelink.cpp)

  #ifndef _MYSIMPLELINK_ #define _MYSIMPLELINK_struct TestClass {TestClass (); Intestine value; }; #endif   

testclass.c

  #include "testclass.h" test class :: test class () {value = 13; }   

This is the output I received:

  Propeller-Alf-GCC.exe-v gcc 4.6.1 (propellerjac_vi1_0_0_2162) propeller-alf- C ++ - I -l. -o CMM / Silicink.off-OS-MCM -Wall -m32bit-couple -no-exception -fno-rtti simplelink.cpp c: \ user \ virtual \ apeda local \ temp \ cc81YpVR.o: `_main 'in the function: (.text + 0x 9): `Unspecified reference to 'Test class :: test class ()' Collection 2: LD back in 1st position to exit failed to build! Check the source for the bad function call or global variable name; TestClass :: TestClass () '   

testclass.c should be testclass.cpp .

In addition, you need to link both simplelink and testclass to your executable. You must add testclass.cpp to your build string, though you do each of your makeup file. You can create an object file for CPP, and then link the object files.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -