tomek-o / tSIP

SIP softphone
https://tomeko.net/software/SIPclient/
157 stars 34 forks source link

Help #13

Closed victorkl400 closed 4 years ago

victorkl400 commented 4 years ago

Could you explain , how do i run it using the source code? i do have c++ builder 6/visual studio 2019/borland c++. It would be great to figure out how does it run. Thx

tomek-o commented 4 years ago

With Turbo C++/BDS2006 I'm just opening project group, selecting either Debug or Release target and rebuilding. tSIP.bdsgroup is "main" project group, containing all subprojects, other project groups are just for convenience. Visual C++ is a very different product. To use it most of the GUI would need to be rewritten. Perhaps starting with baresip might make more sense for VC++ as there are at least project files. C++ Builder 6 is very similar to BDS2006, although project files are not compatible, so they would need to be recreated. I'm not sure what do you mean by "Borland C++" (third product on the list).

victorkl400 commented 4 years ago

Borland C++ 5.02 (https://techrrival.com/download-borland-turbo-c-windows/) is that the Turbo C++/BDS2006 ? I've never heard about any of borland or turbo c++ before so I'm really confused . I'm struggling for days to figure out how to run your code . Could you provide me a link to download this " Turbo C++/BDS2006"?

tomek-o commented 4 years ago

BC++ 5 is another, older product from the times when DOS, Win 3.11 and maybe Win95 were in use, not much in common except "Turbo" name. Turbo C++ Explorer was withdrawn few years ago. It is very likely that as free software with liberal license it was competing with paid versions of C++ Builder. It is not available anymore, but required are indexed by google and seem to be still available on few sites. These files are:

On Windows 7 BDS2006 has some issue with "EditorLineEnds" file, so there is run_bds.bat and run_bds_x64.bat. On Windows 10 x64 it seems to be fine.

victorkl400 commented 4 years ago

I think I´ve got the right bds2006. But now i cannot compile/build :/ image

Btw sorry for bother you that much.

tomek-o commented 4 years ago

This is almost the same to what I'm using, but for some reason standard include paths are missing or they are named in different way. In my installation there is BDS system variable pointing to c:\program files (x86)\borland\bds\4.0 and standard headers are e.g. in C:\Program Files (x86)\Borland\BDS\4.0\include ($(BDS)\include, $(BDS)\include\dinkumware, $(BDS)\include\vcl). This variable is visible in Tools/Options/Environment Variables. It might be different in "full" BDS or your installation might not work / be incomplete. Maybe C++ support is opt-in installation option in full BDS?

Try creating basic VCL or command line "Hello world", including e.g. stdlib.h in source and see if it works. If it works but there is no BDS variable visible - check if there is any similar variable, you can also add extra variables there.

victorkl400 commented 4 years ago

Seems working like charm.

image

I dont know why your code isnt compiling/building at all

tomek-o commented 4 years ago

If installation is fine then this might be some issue with paths, though it is pretty weird that Turbo C++ Explorer and full BDS define them in different way. In my projects (generated by TC++) include paths are defined as this:

$(BDS)\include
$(BDS)\include\dinkumware
$(BDS)\include\vcl

(there are also linker and debugger paths, but let's start with includes). And BDS variable is defined by IDE: BDS And e.g. stdlib.h is inside C:\Program Files (x86)\Borland\BDS\4.0\include Check if your IDE defines BDS variable or is it named in some other way or maybe some subfolder is used for installation that can potentially have both Delphi and C++. Can you attach your project file for comparison?

victorkl400 commented 4 years ago

BDS2006 Enviroment Variables (looks same as yours)

image

And i do have types.h in borland include file also image

tomek-o commented 4 years ago

One more guess - maybe same options are named in different way in project files. Do you see include paths in project properties? BDS2 Can you attach your (working) project file for comparison?

victorkl400 commented 4 years ago

image

tomek-o commented 4 years ago

I'm out of ideas. Working and non-working project would need to be compared manually.

victorkl400 commented 4 years ago

Alright , I'll keep trying to figure out what is going wrong. Anyway , thanks for help and for your awesome project.

tomek-o commented 4 years ago

I don't want to install BDS2006 on my PC (it probably would collide with TC++), can you attach your working "Hello world" project (at least .bdsproj file or whole project zipped)?

Project files could be of course recreated, but it would be error prone.

victorkl400 commented 4 years ago

test.zip

tomek-o commented 4 years ago

I don't see anything overly suspicious and it compiles here. I'm attaching also my basic project for comparison. turbo.zip Assuming that application projects are compatible, maybe this problem is specific to static library projects (as re.bdsproj is this type of project)? Base/empty static library project from my TC++: turbo_static_lib.zip

victorkl400 commented 4 years ago

Your basic project is working here so far as well.

tomek-o commented 4 years ago

Another thing that might be worth checking - is this problem specific to re.bdsproj or not? There is e.g. \rem\mk\win32-tc\rem.bdsproj and any library can be opened and compiled separately.

One suspicious project option in re.bdsproj is inclusion (missing but not actually necessary - it was added automatically and I forgot about it) of .._PROJEKTY\libre\re-0.3.0\mk\win32-tc path. This can be removed from bdsproj file either manually (text editor) or through project options, Paths and Defines, Build Configuration: All configurations (greyed position on the list). Maybe for unknown reason this causes BDS (but not TC++) to ignore following include paths. BDS3

victorkl400 commented 4 years ago

As you said , I removed PROJEKTY , tried compile still the same. image

victorkl400 commented 4 years ago

If i get the Turbo C++ would it work , wouldn't it ? Do you have any installer or files that i could try to run it on my computer ?

tomek-o commented 4 years ago

I believe there shouldn't be a problem - today someone asked me same question and I pointed to https://github.com/tomek-o/tSIP/issues/13#issuecomment-645576697 and first google link: http://194.71.11.165/mirror/archive/ftp.sunet.se/pub/lang/borland/ - seemed to work in less than a hour, but I actually did not ask if compiling finished. ... but I also don't think there should be any problem with BDS2006, it should be virtually identical except for branding, Delphi support and few patches maybe.

victorkl400 commented 4 years ago

So , don't you have any other idea to help me ? If you don't mind i can give you remote access to my computer. It'd be great getting this working.

tomek-o commented 4 years ago

To be sure if there are no problems with these install files I've just asked one guy that used these links today, there might be time zone difference though. In general I would recommend TC++. At the moment it's getting late here, so I would prefer not to start remote desktop session, but if you won't find solution I should have time tomorrow after 19:00 CET/GMT+2 or on Saturday. I guess option that left might be recreating project file and adding source files manually, checking if/when it breaks. Not difficult (re.bdsproj has one or two essential options to change - adding HAVE_SELECT define, changing linker page size to 128, maybe setting data alignment), but potentially time consuming (iterative).

victorkl400 commented 4 years ago

Okay , so i will take a look at turbo c++ , try to install it

victorkl400 commented 4 years ago

Well , I tried to run Turbo C++ but no success , still up to access here remotely ?

tomek-o commented 4 years ago

Yup, I can try. Please use e-mail from my webpage for details (not sure if github has private messages).

tomek-o commented 4 years ago

So, here are my notes after building tSIP with this version of BDS2006. Perhaps it was unpatched as it was crappier than Turbo C++ Explorer and this is saying a lot.

  1. Issue with no access to standard includes seemed like a problem with limited command line length. I don't know exactly whether this is Windows or IDE problem, I've seen this first time and absolute paths were not longer than typical. As IDE is inserting include paths automatically for each source subfolder (at least I don't know workaround for this and these paths are automatically added again after opening/closing/saving project settings) I've moved part of re.lib code from subfolders to common folder, reducing total length/number of include paths. It's worth noting that IDE is adding paths but not removing the automatically when removing source files. Paths need to be deleted manually after moving source files.

  2. ws2tcpip.h apparently needs fixing (missing BORLANDC condition), changing to:

#if defined(_MSC_VER) || defined(__BORLANDC__)
#define WS2TCPIP_INLINE __inline
#else
#define WS2TCPIP_INLINE extern inline /* GNU style */
#endif
  1. There was ambiguity error with strcmp function in jsoncpp.lib. I'll test it with TC++ and probably change.
  2. There was minor issue with precompiled header, "E2209 Unable to open include file 'ChartFX.hpp'": https://support.embarcadero.com/article/35876
  3. Not exacly an issue, but build configuration selection is different than in TC++ and I think it might require manually activating each project and changing its configuration. I've compiled only "Release" targets there. If both Release and Debug would be compiled then it might be less of a problem as often only single "tSIP_exe.bdsgroup" would need to be opened (if not touching libraries).
  4. For baresip.lib project obj files were generated in incorrect folder - not in Release_Build but one level higher. Generated library was empty, with size = 1024B only. I had to manually copy obj files to Release_Build and rebuild library project to link them. Beware, this might cause lot of confusion when changing code.
  5. Executable was not able to run without winspool.dll (and it normally is self-contained!). Following https://www.cyberforum.ru/cpp-builder/thread89061.html I've copied winspool.drv from System32 to Release_Build directory and renamed it to winspool.dll. This thread says that it might be fixed with BDS2006 updates.