Compile Live555 using VS2005 Part 2

Part 1 gives you instruction on how to build Live555 in command. However, you will have to perform debug attached VS2005 with Live555 source code to running Live555MediaServer Process. This can be troublesome.

Part 2 gives you instruction on how to build Live555 as a VS2005 Project. I am assuming that you have some knowledge on VS2005 environment (create solution, add project, etc...)

1. Create an empty VS2005 C++ Solution as Live555
2. Within the Live555 solution, add 4 sub projects to Live555 solution
3. The naming of the sub-project is preferred to follow live555 naming as shown


4. Each sub-project should be a static library project.


5. Now, copy each live555 folder into respective sub-project. From here, I will do an example for BasicUsage Environment project


6. Next, include all the file to BasicUsageEnvironment vcproj. Also, add additional include library.



7. Repeat step 5 and 6 for Groupsock, LiveMedia and UsageEnvironment.

8. For simplicity, compile each sub-project with project only build menu. This will help you to figure out any missing include file per sub-project basis.

9. If you manage to compile all 4 sub-project successfully, it is time to work on Live555 main project. Include only the following files at Live555 as this example only interested in build Live555MediaServer


10. Mark Live555 as main project and set the 4 sub-projects as project dependencies.



11. Include additional library


12. Include wsock32.lib as linkage dependency


13. Put a debug point at live555MediaServer.cpp main(), then, press F5 to compile and run in debug mode. The project should compile successfully and pause at the debug point. If you continue the program, it will run as command prompt application of Live555MediaServer.

14. If you want to build other testProgs, you will have to create separate project for each of the test application because each testProgs are standalone application

Comments

  1. can you give me solution project?

    ReplyDelete
  2. i tried using your way i can successfully build all subproject.when i debug live555 i am getting error
    1>------ Build started: Project: Live555, Configuration: Debug Win32 ------
    1>DynamicRTSPServer.obj : error LNK2019: unresolved external symbol "protected: static int __cdecl RTSPServer::setUpOurSocket(class UsageEnvironment &,class Port &)" (?setUpOurSocket@RTSPServer@@KAHAAVUsageEnvironment@@AAVPort@@@Z) referenced in function "public: static class DynamicRTSPServer * __cdecl DynamicRTSPServer::createNew(class UsageEnvironment &,class Port,class UserAuthenticationDatabase *,unsigned int)" (?createNew@DynamicRTSPServer@@SAPAV1@AAVUsageEnvironment@@VPort@@PAVUserAuthenticationDatabase@@I@Z)
    1>DynamicRTSPServer.obj : error LNK2019: unresolved external symbol "protected: __thiscall RTSPServer::RTSPServer(class UsageEnvironment &,int,class Port,class UserAuthenticationDatabase *,unsigned int)" (??0RTSPServer@@IAE@AAVUsageEnvironment@@HVPort@@PAVUserAuthenticationDatabase@@I@Z) referenced in function "private: __thiscall DynamicRTSPServer::DynamicRTSPServer(class UsageEnvironment &,int,class Port,class UserAuthenticationDatabase *,unsigned int)" (??0DynamicRTSPServer@@AAE@AAVUsageEnvironment@@HVPort@@PAVUserAuthenticationDatabase@@I@Z)
    1>DynamicRTSPServer.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall Medium::isSource(void)const " (?isSource@Medium@@UBEIXZ)
    1>DynamicRTSPServer.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall Medium::isSink(void)const " (?isSink@Medium@@UBEIXZ)
    1>DynamicRTSPServer.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall Medium::isRTCPInstance(void)const " (?isRTCPInstance@Medium@@UBEIXZ)

    ReplyDelete
  3. It seems that your live555 have some code missing. From the error, it seems that you does not have LiveMedia. In particular, RTSPServer.cpp in LiveMedia

    ReplyDelete
  4. are you interested to watch my project. on that case i will send you the project.

    ReplyDelete
  5. i have built LiveMedia successfully as static library and also it contains RTSPServer.cpp

    ReplyDelete
  6. What I do is to include all source code into a single VS project. May be, you should try to compile everything as 1 solution.

    I don't mind seeing your project. Just tell me what you want to do with it and where to get your project. But, I may take some time.

    Or, if you want my project, I can provide you. However, it is April 2010 code. Just tell me your choice

    ReplyDelete
  7. sure it will be better me if you send your project to me. i am waiting

    ReplyDelete
  8. Here you go. Please note that the link will expires in February 13, 2011

    https://www.yousendit.com/download/MzZINnFOdEM1UjQwTVE9PQ

    ReplyDelete
  9. thanks again..i have run it. it is working ..can you help me one thing? when i run program from testPrgos/testMPEG4VideoStreamer or testH264VideoStreamer program it is running perfectly but when i try to streaming using vlc or quicktime it is showing unsupported transport...can you help me?

    ReplyDelete
  10. hi,,have you tried to play H264 video streaming using testH264VideoStreamer? i have tried using quictimeplayer and also using vlc player but it is showing unsupported transport in rtsp session.....? can you help me

    ReplyDelete
  11. I tried testMpeg4VideoStreamer and it works fine for me.

    Can you try the m4e files from http://www.live555.com/liveMedia/public/m4e/

    Your testMpeg4VideoStreamer RTSP URL should be RTSP://ip:8554/testStream by default

    You said that VLC and quicktime shown unsupported transport.. Do you have any idea what is the SETUP RTSP message?

    Also, please remember to change your filename at testMpeg4VideoStreamer.cpp
    char const* inputFileName = "wwe.m4e";

    ReplyDelete
  12. Hi, I have to work with the live555...I had the same errors of irfan in compiling solution.

    Could you send me the project, please?

    Do you try to convert that project in VS2008?

    ReplyDelete
  13. There you goes. Please note that the expiry date is March 07, 2011 05:05 PST

    https://www.yousendit.com/download/T2pHb2VNNDJlaFJFQlE9PQ

    Sorry, I never try to convert to VS2008.

    ReplyDelete
  14. This comment has been removed by the author.

    ReplyDelete
  15. There has to be something missing in these steps. I am also coming up with the linking issue that everyone else had. sigh

    ReplyDelete
  16. Static library does not need to link. So, you will not see linkage issue.

    When create a exe, it will perform code linkage and if you have missing code or library during linkage, it will have your error.

    Those linkage errors will hint what you are missing. I use hint because it is quite frustrating to see linkage error.

    ReplyDelete
  17. Hi Thompson, I am still facing irfan's and sancho's problem.. the linking error is the same:

    error LNK2019: unresolved external symbol "protected: static int __cdecl RTSPServer::setUpOurSocket(class UsageEnvironment &,class Port &)" (?setUpOurSocket@RTSPServer@@KAHAAVUsageEnvironment@@AAVPort@@@Z) referenced in function "public: static class DynamicRTSPServer * __cdecl DynamicRTSPServer::createNew(class UsageEnvironment &,class Port,class UserAuthenticationDatabase *,unsigned int)" (?createNew@DynamicRTSPServer@@SAPAV1@AAVUsageEnvironment@@VPort@@PAVUserAuthenticationDatabase@@I@Z)

    and so on..


    this is weird because if I click with "Go to Definition" on setUpOurSocket, the code can also find the line into RTSPServer.cpp.. can you help me getting rid of this weird error?

    I've successfully compiled all the .lib projects as you've described!

    ReplyDelete
  18. Hi PaulWalker,

    Even if you can find the RTSPServer.cpp via VS "Go to Definition", your library could still miss RTSPServer on linker level.

    Some random ideas...

    1. You are using DynamicRTSPServer. Can you build Live555 project successfully and the live555.exe created successfully?

    2. If you are using VS2010, please check your property page -> Common Properties. Do you have BasicUsageEnvironment, Groupsock, LiveMedia and UsageEnvironment as reference? If yes, please check all of them if their Project reference properties - > Link Library Dependecies is TRUE.

    3. Go to Solution properties -> Common Properties -> Project Dependencies. Check if you Live555 project depends on BasicUsageEnvironment, Groupsock, LiveMedia and UsageEnvironment?

    4. Since you say that you can compiled all sub libraries, the next alternative is, can you try explicitly putting your library into linker -> input -> Additional Dependency?

    ReplyDelete
  19. Point 2) fixed my problem, thank you!!

    I've been using VS for a while but never experienced such a problem, and I thought the "framework and references" screen was only for managed code.. you are totally right!

    ReplyDelete
  20. I'm working at VS2008, everything seems to be fine until I build LiveMedia solution, then I get 7 errors at Locale.cpp, like this:

    1>c:\users\au79\documents\rtsp\live\livemedia\locale.cpp(37) : error C2065: 'LC_ALL' : undeclared identifier
    1>c:\users\au79\documents\rtsp\live\livemedia\locale.cpp(38) : error C2065: 'LC_NUMERIC' : undeclared identifier
    1>c:\users\au79\documents\rtsp\live\livemedia\locale.cpp(40) : error C2065: 'NULL' : undeclared identifier
    1>c:\users\au79\documents\rtsp\live\livemedia\locale.cpp(40) : error C3861: 'setlocale': identifier not found
    1>c:\users\au79\documents\rtsp\live\livemedia\locale.cpp(41) : error C3861: 'setlocale': identifier not found
    1>c:\users\au79\documents\rtsp\live\livemedia\locale.cpp(54) : error C2065: 'NULL' : undeclared identifier
    1>c:\users\au79\documents\rtsp\live\livemedia\locale.cpp(55) : error C3861: 'setlocale': identifier not found

    Why are those? I'm definitly a newbie!
    The rest of solutions work fine.
    Can you help me? Thank you ahead.

    ReplyDelete
  21. My only advice to you is to search the solution for LC_ALL, LC_NUMERIC, etc.. in the solution and check if they are defined.

    if not, you can try defining

    #define LC_NUMERIC 4
    #define LC_ALL 0

    in your solution

    ReplyDelete
  22. i added the header files and source files in only BasicUsageEnvironment folder in my project(VS 2010 express) and build only BasicUsageENvironment.but it is giving me an error
    1>LINK : error LNK2001: unresolved external symbol _mainCRTStartup
    1>c:\documents and settings\administrator\my documents\visual studio 2010\Projects\live5555\Debug\live5555.exe : fatal error LNK1120: 1 unresolved externals

    what should i do?

    ReplyDelete
    Replies
    1. Have you added all the library dependencies before building the BasicUsageEnvironment project?

      It seems like you have missing some lib files during linkage.

      Delete
  23. when i ran the project as said above i get the following errors
    1>------ Build started: Project: UsageEnvironment, Configuration: Debug Win32 ------
    2>------ Build started: Project: LiveMedia, Configuration: Debug Win32 ------
    1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
    1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
    1>c:\documents and settings\administrator\my documents\visual studio 2010\Projects\livetry\Debug\UsageEnvironment.exe : fatal error LNK1120: 1 unresolved externals
    3>------ Build started: Project: GroupSock, Configuration: Debug Win32 ------
    3>libgroupsock.lib(NetInterface.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in Groupsock.obj
    3>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
    3>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
    3>c:\documents and settings\administrator\my documents\visual studio 2010\Projects\livetry\Debug\GroupSock.exe : fatal error LNK1120: 1 unresolved externals
    2>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
    2>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
    2>c:\documents and settings\administrator\my documents\visual studio 2010\Projects\livetry\Debug\LiveMedia.exe : fatal error LNK1120: 1 unresolved externals
    4>------ Build started: Project: BasicUsageEnvironment, Configuration: Debug Win32 ------
    4>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
    4>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
    4>c:\documents and settings\administrator\my documents\visual studio 2010\Projects\livetry\Debug\BasicUsageEnvironment.exe : fatal error LNK1120: 1 unresolved externals
    ========== Build: 0 succeeded, 4 failed, 1 up-to-date, 0 skipped ==========

    ReplyDelete
  24. Actually, another though is that what VS project did you used for VS?

    Did you create a Console project during VS project creation?

    ReplyDelete
  25. Ya i created a console based empty project in VS 2010 express...
    Ya i have added all the libraries

    ReplyDelete
  26. sir i also try to make a HTTP streaming project using the files(given in live media library)
    ByteStreamMemoryBufferSource.cpp,RTSPServerSupportingHTTPStreaming.cpp,DynamicRTSPServer.cpp,live555MediaServer.cpp
    i didnt change any of the following file
    But when i build the project by pressing F5 and open the stream using url http://ip address:portno/file name(.ts)
    i give an heap corruption error.
    What wrong i have done?Please guide me

    ReplyDelete
  27. Ok.. it seems that you are now able to compile your solution without link issue.

    If you never change those file, all I can say is look at the file that you input the URL string.

    Or, are you using the command line application? If yes, which one are you using?

    Which version of Live555 are you using? In the past, latest version of Live555 does not mean the best and work by default.

    ReplyDelete
  28. sir i had an query in my another code where do i ask that from you?

    ReplyDelete
  29. You could post at this thread if related to live555

    ReplyDelete
  30. sir i want to know i u have or know any link related to parsing of h264 file....so that i can know where its header start,its NAL unit....

    ReplyDelete
  31. H264 file as in mp4, raw data or?

    Does this post help http://thompsonng.blogspot.com/2010/11/mp4-file-format-part-2.html?

    ReplyDelete
  32. Hello sir
    is there any way to know how to find out how much time does the live media server takes to stream a file an a URL and how much data does it send in a second ? and
    how many bytes does live media server send each time while streaming?

    ReplyDelete
  33. I am assuming that you are talking about RTSP protocol.

    You should take a look at RTPTransmissionStats class.

    http://www.live555.com/liveMedia/doxygen/html/classRTPTransmissionStats.html

    Base on those information, you can calculate those information from total octet count, round trip delay, etc..

    ReplyDelete
  34. Sir i am not an experienced in the live media can u just guide me what file s should i add to a solution to find the time that live media server takes to stream a file an a URL and how much data does it send in a second ? and
    how many bytes does live media server send each time while streaming?
    I would be very thank full to you,i am in learning stage as i m an student

    ReplyDelete
  35. To use RTPTransmissionStats, you need to include RTPSink.cpp

    And, you should have access to SimpleRTPSink in your program.

    So, for your questions

    1. Find time that the server take to stream a file

    All you can do is take the time when you start the socket (RTPSink::startPlaying) and the time when you end the socket (RTPSink::stopPlaying). That should give you the time taken to play the file.

    2. How much data send in second

    You need to keep a time when start playing. For example, record time when RTPSink::startPlaying. Then, create a method that calculate data send per second as RTPSink::octetCount / (curTime - startTime)

    3. How many bytes does server send.

    That should be just RTPSink::octetCount()

    ReplyDelete
  36. Sir, I did all the things exactly like you said, but there are still some linker problems. They look like this:

    Error 2 error LNK2019: unresolved external symbol _initializeWinsockIfNecessary referenced in function "protected: __thiscall BasicUsageEnvironment::BasicUsageEnvironment(class TaskScheduler &)" (??0BasicUsageEnvironment@@IAE@AAVTaskScheduler@@@Z) c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Live555\BasicUsageEnviroment.lib(BasicUsageEnvironment.obj) Live555
    Error 3 error LNK2001: unresolved external symbol _initializeWinsockIfNecessary c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Live555\Groupsock.lib(GroupsockHelper.obj) Live555
    Error 4 error LNK2019: unresolved external symbol _our_inet_addr referenced in function "public: __thiscall NetAddressList::NetAddressList(char const *)" (??0NetAddressList@@QAE@PBD@Z) c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Live555\Groupsock.lib(NetAddress.obj) Live555
    Error 5 error LNK2001: unresolved external symbol _our_inet_addr c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Live555\Groupsock.lib(GroupsockHelper.obj) Live555
    Error 6 error LNK2019: unresolved external symbol _our_srandom referenced in function "unsigned int __cdecl ourIPAddress(class UsageEnvironment &)" (?ourIPAddress@@YAIAAVUsageEnvironment@@@Z) c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Live555\Groupsock.lib(GroupsockHelper.obj) Live555
    Error 7 error LNK2019: unresolved external symbol _our_random referenced in function "unsigned int __cdecl chooseRandomIPv4SSMAddress(class UsageEnvironment &)" (?chooseRandomIPv4SSMAddress@@YAIAAVUsageEnvironment@@@Z) c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Live555\Groupsock.lib(GroupsockHelper.obj) Live555
    Error 8 error LNK2001: unresolved external symbol _our_random c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Live555\LiveMedia.lib(RTPSink.obj) Live555
    Error 9 error LNK2001: unresolved external symbol _our_random c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Live555\LiveMedia.lib(RTCP.obj) Live555
    Error 10 error LNK2019: unresolved external symbol _our_random32 referenced in function "protected: void __thiscall RTSPServer::RTSPClientConnection::handleRequestBytes(int)" (?handleRequestBytes@RTSPClientConnection@RTSPServer@@IAEXH@Z) c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Live555\LiveMedia.lib(RTSPServer.obj) Live555
    Error 11 error LNK2001: unresolved external symbol _our_random32 c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Live555\LiveMedia.lib(RTPSink.obj) Live555
    Error 12 error LNK2001: unresolved external symbol _our_random32 c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Live555\LiveMedia.lib(RTPSource.obj) Live555
    Error 13 error LNK1120: 5 unresolved externals c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Debug\Live555.exe Live555

    What else can I do? Please, help!

    ReplyDelete
    Replies
    1. Just add Winsock32.lib in libraries

      Delete
    2. You mean wsock32.lib in additional dependencies? Sir, I've already done that.

      Delete
    3. I was using VS2012. I did the same on VS2005 and it works fine.

      Delete
    4. This comment has been removed by the author.

      Delete
    5. WARNING!!! There are some plain .c files (2 of them). Locate and add them! It took me 4 ours to figure it out finally that I only added *.cpp to every project.

      Delete
  37. Can you please tell how to find the packet size that we received in open rtsp client and test on demand rtsp server in live555

    ReplyDelete
  38. You could use Wireshark to look at the network level and check what is the rtp packet size sent between RTSP server in live 555 to open rtsp client

    ReplyDelete
  39. can we fine ii programmatically?

    ReplyDelete
  40. Hello sir,can you guide on creation and destroy of rtsp server in a thread that is if thread start we create rtsp server and on thread termination i am able to create rtsp server on thread start but don't know how to destroy it

    ReplyDelete
  41. Try using close(rtspServer); where rtspServer is your service instance

    ReplyDelete
  42. This comment has been removed by the author.

    ReplyDelete
  43. im using VS2010...i did every step except adding the .lib..because it was not in the project that i downloaded from live555....i get the following error...
    Error 45 error LNK1120: 44 unresolved externals
    Error 44 error LNK2001: unresolved external symbol "class DelayInterval const DELAY_SECOND" (?DELAY_SECOND@@3VDelayInterval@@B)
    Error 7 error LNK2001: unresolved external symbol "private: virtual bool __thiscall RTSPServer::isRTSPServer(void)const " (?isRTSPServer@RTSPServer@@EBE_NXZ)
    Error 11 error LNK2001: unresolved external symbol "protected: virtual bool __thiscall RTSPServer::specialClientAccessCheck(int,struct sockaddr_in &,char const *)" (?specialClientAccessCheck@RTSPServer@@MAE_NHAAUsockaddr_in@@PBD@Z)
    Error 12 error LNK2001: unresolved external symbol "protected: virtual bool __thiscall RTSPServer::specialClientUserAccessCheck(int,struct sockaddr_in &,char const *,char const *)" (?specialClientUserAccessCheck@RTSPServer@@MAE_NHAAUsockaddr_in@@PBD1@Z)
    Error 13 error LNK2001: unresolved external symbol "protected: virtual class RTSPServer::RTSPClientConnection * __thiscall RTSPServerSupportingHTTPStreaming::createNewClientConnection(int,struct sockaddr_in)" (?createNewClientConnection@RTSPServerSupportingHTTPStreaming@@MAEPAVRTSPClientConnection@RTSPServer@@HUsockaddr_in@@@Z)
    Error 14 error LNK2001: unresolved external symbol "protected: virtual class RTSPServer::RTSPClientSession * __thiscall RTSPServer::createNewClientSession(unsigned int)" (?createNewClientSession@RTSPServer@@MAEPAVRTSPClientSession@1@I@Z)


    and many such errors

    ReplyDelete
  44. Have you attached the winsock32.lib,ws2_32.lib and liblivemedia.lib?

    ReplyDelete
  45. Havent you compile the project as giben in the following link http://thompsonng.blogspot.in/search/label/Live555
    Then you can use live 555 libraries as explained below
    Open the project in VS2010 then open the solution explorer then right click the project name(what ever is your project name) go to linker--->Input--->Additional Dependencies add the following
    WS2_32.Lib;
    WinMM.lib;
    ..\live.2013.02.11\live\groupsock\libgroupsock.lib;
    ..\live.2013.02.11\live\BasicUsageEnvironment\libBasicUsageEnvironment.lib;
    ..\live.2013.02.11\live\UsageEnvironment\libUsageEnvironment.lib;
    ..\live.2013.02.11\live\liveMedia\libliveMedia.lib;

    ReplyDelete
  46. ya did the procedure as in tat link...I dint do the last two steps alone....I have all the .lib files tat u listed except the first two(WS2_32.Lib,
    WinMM.lib)...where can I download ??

    ReplyDelete
    Replies
    1. You don't need to download that,these are the window libraries just write there names as specified in my previous if you want to use these libraries in any of your project

      Delete
  47. And I get the error as "Error 230 error LNK1104: cannot open file 'libliveMedia.lib' " when i try to link and build it as you said.

    ReplyDelete
    Replies
    1. Just can you tell are you using the live 555 libraries in any project ??
      If not then u don't need to do that that i said above.

      Delete
  48. This comment has been removed by the author.

    ReplyDelete
  49. Hi guys. Appreciate and thanks for all the comments and updates.

    I had updated a part 3 post that based on VS2010 and Live555 2013.02.27 build

    Please see http://thompsonng.blogspot.sg/2013/03/compile-live555-using-vs2010-part-3.html

    ReplyDelete
  50. Can you please send me the solution project?
    Thanks.

    ReplyDelete

Post a Comment

Popular Posts