I tried compiling the following code and I get a warning on line 5 that this statement declares a non-template function but despite this warning the code does compile. However, it does not link. The error message from the linker is:
/tmp/ccIbnsNk.o:t2.C text+0x9b): undefined reference to `operator<<(std::basic_ostream<char, std::char_traits<char=""> >&, Array<int>&)'
I feel the above code defines the function the linker says is undefined. What am I missing?
Thanks for the response. However, I added the line you suggested and it did not solve the problem. I believe the line you suggested tells the compiler that we want to specialize the implementation for the special case of int. However, I am not sure of my facts on this one.
can you help me how can i add the passenger constructor in the cpp file
this is the passenger constructor :
#include "Passenger.h"usingnamespace std;
Passenger::Passenger(string a="",string b="",long c=0)//Constructor that initializes the data members to given parameters
} //end constuctor Passenger body
but it seems i will have infinite No. of errors
when i got the last error i got another LNK2019 error with it, but i thought if i solve one of them the other will be solved also , and my thoughts was wrong
this is the other error :
1>Reservation.obj : error LNK2019: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > __thiscall Reservation::ID_sn(void)" (?ID_sn@Reservation@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "public: class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > __thiscall Reservation::getReservationNumber(void)" (?getReservationNumber@Reservation@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
I have three questions
1.why do I need to use of TEXT macro in my codes and if I remove it compiler shows error
2.why CreateProcess cant open test.txt while second parameter is command line and I have to write full path ("c:\\notepad.exe c:\\1.txt")
3.Do I need to use of WaitForSingleObject
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof (STARTUPINFO);
si.dwFlags = STARTF_USESHOWWINDOW |STARTF_TITLEISAPPID ;
si.wShowWindow = SW_SHOWMAXIMIZED;