Author Topic: [C++] Using Libraries / Wrappers from here from other languages  (Read 4993 times)

0 Members and 1 Guest are viewing this topic.

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Is it possible to use any of the existing libraries from here say for example the FreeBASIC ones - TinyPTC_Ext and MiniFMOD170. Or can they be converted into C++ by the authors?

Cheers,
Clyde.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline TinDragon

  • Pentium
  • *****
  • Posts: 644
  • Karma: 24
    • View Profile
    • J2K's blog
I think some of them are c/c++ libs that have just been compiled to work with FB and had a .bi included added. I think rbz tinyptc_ext code was posted on here for c/c++ at some point, I recall looking at it to work out how to do the same in blitzmax using its direct opengl commands.

It really depends what exactly you want to do, some libs for FB arent needed in c/c++ as there already included in the install, others might need some adjustments to the code to compile in visual c++ but most should work fairly easy. I am in the process myself of setting up VS C++ and C# 2008 express, from what I can tell VC++ has no MFC with it and no DX sdk but apart from them I have had no problems compiling any of my old code that used gdi or opengl :)


Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Yes, they can be used in MSVC, in fact all those libraries that I did for FB was coded in MSVC.
They only need a proper header file (.h) and setup your vcproj correctly to be used.

You can start with tinyptc_ext, check the attached file below, it was done in MSVC 2005 but you can just let your MSVC 2008 convert it for you.
Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
tried that and opted to build and got errrors:
Code: [Select]
------ Build started: Project: tinyptc_ext - Example, Configuration: Debug Win32 ------
Compiling...
Main.cpp
Compiling manifest to resources...
Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
Copyright (C) Microsoft Corporation.  All rights reserved.
Linking...
Main.obj : error LNK2019: unresolved external symbol _ptc_update referenced in function _main
Main.obj : error LNK2019: unresolved external symbol _ptc_open referenced in function _main
Main.obj : error LNK2019: unresolved external symbol _ptc_setdialog referenced in function _main
Main.obj : error LNK2019: unresolved external symbol _ptc_setflip referenced in function _main
Main.obj : error LNK2019: unresolved external symbol _ptc_allowclose referenced in function _main
LIBCMTD.lib(wincrt0.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
.\Debug/tinyptc_ext  - Example.exe : fatal error LNK1120: 6 unresolved externals
Build log was saved at "file://c:\Users\Mike\Documents\Programming Arena\PC Arena\PC Programs\TinyPTCext\Debug\BuildLog.htm"
tinyptc_ext - Example - 7 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline TinDragon

  • Pentium
  • *****
  • Posts: 644
  • Karma: 24
    • View Profile
    • J2K's blog
I assume you just did a conversion of the project to vc 2008, this doesnt add the .libs to the projects path so they are not being added to the build process hence the reason it cant find them. You can tell it to add them and there are several ways to do that. A very simple but not really correct way is to right click on the project name in solution browser select add>exsisting item then add the .h and the 2 .lib files to the project, it might ask about custom build rules, just say no for now, once you do this the 3 files should show up in the solution explorer window along with the original main.cpp file. if you now build it will create the .exe's.

Note I am pretty sure this is a bad way to add the .lib files to the build process but its a quick way, can atleast see if your able to compile. Hopefully one of the more experienced coders can explain the correct way to do this for future reference.




Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Another way to include a .lib file is:
Project->Properties - look for Linker / Input -> Additional Dependencies and add your library there.

Clyde: Looking at your error message I can see you're compiling it in Debug mode, go to Build -> Configuration Manager - and in Active Solution Configuration select Release. Now you can build it again and it should work.

Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Mighty huge thanks dudes :)

Cheers and making some progress,
Clyde.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won: