Author Topic: Starting with QB64 Development  (Read 4517 times)

0 Members and 1 Guest are viewing this topic.

Offline davidshq

  • Newbie
  • Posts: 55
    • View Profile
Starting with QB64 Development
« on: February 26, 2018, 11:10:41 pm »
I've downloaded and looked at some of the source code for QB64 in the past, but haven't done anything with it. I'm playing around with it again and would love some tips on how to get started...

I'm using Visual Studio 2017 at the moment. Is anyone else using VS 2017? If not, what editor are you using?

A few questions to get me started... :)

1. Right off the bat I'm getting the following error from VS's debugger:
Code: QB64: [Select]
  1. CMake Error at internal\c\parts\audio\out\download\openal-soft-1.14\CMakeLists.txt:282 (MESSAGE):
  2. No snprintf function found, please report!
  3.  
  4.  
  5. C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe  -G "Ninja"
  6. -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\myusername\CMakeBuilds\8ce65ea4-c9c0-0a36-88ac-3e78e764abb1\install\x86-Debug"  
  7. -DCMAKE_CXX_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.12.25827/bin/HostX86/x86/cl.exe"  
  8. -DCMAKE_C_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.12.25827/bin/HostX86/x86/cl.exe"  
  9. -DCMAKE_BUILD_TYPE="Debug"
  10. -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe"
  11. "T:\afolderofmine\cpp\qb64\internal\c\parts\audio\out\download\openal-soft-1.14" returned with exit code: 1            
  12. internal\c\parts\audio\out\download\openal-soft-1.14\CMakeLists.txt
  13.  

2. What's up with storing code in txt files?

Thanks!
Dave

Offline luke

  • Administrator
  • Seasoned Forum Regular
  • Posts: 324
    • View Profile
Re: Starting with QB64 Development
« Reply #1 on: February 27, 2018, 07:01:41 am »
I tend to use vim + gdb when I need to trace execution/watch variables. I've never used visual studio, but it would seem it's (erroneously) trying to run cmake over the code.  Anything in a 'download' folder isn't actually used at all and is only there for"reference", apparently, so you can safely delete it (that sounds like a good idea actually).

I have no idea why the endings are .txt either. Most of the C stuff was written in notepad, so I guess convenience of windows file associations might have something to do with it?

As you may have discovered, libqb.cpp contains the bulk of the runtime. As a general rule QB subs and functions are mapped to a similarly named C function with a sub_ or func_ prefix (though the string manipulation ones tend to begin qbs_ and a few graphics ones have qbg_ iirc – consistency is not the name of the game here).

I'm not really sure where to start explaining things, but feel free to ask as many questions as you want. If you want rapid fire answers come talk with me on irc sometime.

Finally, don't be too concerned if you're not too sharp with C++. All of the code is just written as if it were C, and here's a dirty secret: C is just BASIC with pointers and punctuation instead of the english-like words.

Offline davidshq

  • Newbie
  • Posts: 55
    • View Profile
Re: Starting with QB64 Development
« Reply #2 on: February 27, 2018, 11:13:25 am »
Thanks Luke! Very helpful!

Would love to hear if anyone else knows why the files are .txt extensions, I'd suggest that if it was just a convenience thing because of using Notepad that it might be useful to refactor as I think most code analysis software won't evaluate the code since it is in a txt.

Dave