• Ever wanted an RSS feed of all your favorite gaming news sites? Go check out our new Gaming Headlines feed! Read more about it here.

Vanillalite

Banned
Oct 25, 2017
7,709
I first learned how to program with codecademy's Python course. It was good and helped me get some basic concepts down, so I'd say it is good for begginers. For now just do these courses, don't rush them and don't worry if you can't remember everything they teach you as it will come with practice.


This too! Don't expect to be a master programmer after a quick online tutorial nor expect to remember all of the concepts. It will all come in due time.
 

turbobrick

Member
Oct 25, 2017
13,063
Phoenix, AZ
Is this a good thread to ask questions in? I'm trying to figure something out in Vue if anyone knows anything about that.

I just started learning Vue like 2 weeks ago, so I'm not the best at it. And I'm using it for web development.

Basically, I'm on a page and I have an array that I'm using. Now I have a link to another page, which I'm using a <router-link> to do that, and I'm passing a few params with it as well. But on the page I go to I need to use that same array and I'm not sure how to do this. I've tried to find my answer from the Vue documentation and also just from google searching, but no luck.
 

Rembrandt

Banned
Oct 25, 2017
2,267
Do all of that first. Try and get some key concepts down.

What is a variable and how to declare one.

What are loops? What are if/then do/while ect.. statements.

What are arrays?

What are classes?

Stuff like that which generally apply across all languages.


I first learned how to program with codecademy's Python course. It was good and helped me get some basic concepts down, so I'd say it is good for begginers. For now just do these courses, don't rush them and don't worry if you can't remember everything they teach you as it will come with practice.

thanks, guys! MS and W3C have a certification thing at EDX for front-end development. I noticed codecademy started me right with javascript whereas this wants to go through HTML5, CSS and then javascript.

Should I stick with this first and once the edx class hits javascript return to codeacdemy? I don't wanna get confused since they'll both be teaching two separate things.

i'm in for the long haul, I suppose! i'm super thankful sites like these exist.

has anyone received a certification from a site like courser, udacity or edx? I'm leaning towards edx or udacity just because they both offer certificates from Google, MS, etc. instead of just universities and even then, edx offers courses from Harvard and MIT which is nuts imo

This too! Don't expect to be a master programmer after a quick online tutorial nor expect to remember all of the concepts. It will all come in due time.

thanks for this. so far, it hasn't been incredibly daunting but I quickly realized I'll have to do this everyday or I'll forget everything. my goal is to develop solid foundations primarily, so i don't mind retreading on things right now.
 

Contact

Member
Oct 27, 2017
287
thanks, guys! MS and W3C have a certification thing at EDX for front-end development. I noticed codecademy started me right with javascript whereas this wants to go through HTML5, CSS and then javascript.

Should I stick with this first and once the edx class hits javascript return to codeacdemy? I don't wanna get confused since they'll both be teaching two separate things.

i'm in for the long haul, I suppose! i'm super thankful sites like these exist.

has anyone received a certification from a site like courser, udacity or edx? I'm leaning towards edx or udacity just because they both offer certificates from Google, MS, etc. instead of just universities and even then, edx offers courses from Harvard and MIT which is nuts imo



thanks for this. so far, it hasn't been incredibly daunting but I quickly realized I'll have to do this everyday or I'll forget everything. my goal is to develop solid foundations primarily, so i don't mind retreading on things right now.
I'd say go through the HTML and CSS course first. JS main thing is that it can interact with the web and be used to make sites (you can run JS in your browser).
I have a certification from coursera for the first deeplearning.ai course and I'll get the second certificate soon. I'll be honest and tell you that I don't know how much value they have, but they should be able to tell people that you can learn things by yourself at least. Making a portfolio is the most import part, I believe.
 

Rembrandt

Banned
Oct 25, 2017
2,267
I'd say go through the HTML and CSS course first. JS main thing is that it can interact with the web and be used to make sites (you can run JS in your browser).
I have a certification from coursera for the first deeplearning.ai course and I'll get the second certificate soon. I'll be honest and tell you that I don't know how much value they have, but they should be able to tell people that you can learn things by yourself at least. Making a portfolio is the most import part, I believe.

Thanks! I'll finish up the edx course and refresh later.

how's that going so far? enjoy all the money! I was thinking the same about the portfolio. Can't wait to add my first project.
 

Contact

Member
Oct 27, 2017
287
Has anyone done the third course of deeplearning.ai? I'm thinking of joining as an audit as there is no programming and I don't know if the case studies are worth it.

Thanks! I'll finish up the edx course and refresh later.

how's that going so far? enjoy all the money! I was thinking the same about the portfolio. Can't wait to add my first project.
I'm finishing the second one and it's going nicely. I want to get to the fourth course soon as CNNs sound really interesting and are probably useful in my field. I'm not getting money from deep learning projects atm (still in college), but I might if I win some Kaggle competitions lol.
 

JeTmAn

Banned
Oct 25, 2017
3,825
Finally got the 3pi robot I received for Christmas working (needed the proper cable), time to dust off my C and get writing for this thing...
 

milch

Member
Oct 25, 2017
569
In Qt, is there a good way to apply the same code to a bunch of different UI elements?

For instance, I have four widgets that I want to fill with plots, all basically in the same way, only with a different image and of course different object names. Seems to be quite a waste to write the same code four times and just swap out the Qt objects, but I dunno how to switch out object names in stuff like ui.prePlot->replot(); dynamically.

Basically, I'd want to write a method that I just feed with the UI element and image and do all the rest in there.

(I also don't know the right key words to google around for this kind of problem, it seems :-( )

Thanks!

Edit: Disregard everything, call by reference
 
Last edited:

Selbran

Member
Oct 25, 2017
1,567
Hey, ya'll! I've started working with HashMap's and have been having a little issue with them and would appreciate any help. I've read the JAVA documentation involving HashMap and also searched online for a solution, but I can't quite find what I am looking for. The HashMap has two variables entered into it the name of the employee (The key value), and their randomly generated ID (The value I want to access when the key is entered). I already have a method that adds an employee to the HashMap and randomly generates an ID for them, it works fine and so does the method to remove the employee. I am then supposed to make another method where I would enter a parameter id and that would look for any id's matching it in the HashMap and remove them, then I would make a separate method called generateID to assign a new randomly generated ID to the employee name key.

My issue is that I do not know how I am supposed to type it out so I am referencing the id I want to remove in the method. If I do something like employees.get(id) or employees.get(inputName, id) it says it cannot find the variable inputName and so I don't know how to set it up properly. Below is a snippet of the code I am typed up. It's missing some of the other methods, but they all work fine. The only issue I'm really having is removing/changing the value of the id.

import java.util.Random;
import java.util.HashMap;

private Random randomGenerator = new Random();
private HashMap<String, String> employees;
private String Name;

public Company (String name)
{
employees = new HashMap<>();
Name = name.trim().toUpperCase();
}

public String addEmployee(String inputName)
{
int n = randomGenerator.nextInt(max - min)+min;
String id = String.valueOf(n);
employees.put(inputName, id);
}

public String removeID(String id)
{
employees.remove(id);
return id;
}

public String generateID(String name)
{

}
 

NotBacon

Member
Oct 27, 2017
222
Hey, ya'll! I've started working with HashMap's and have been having a little issue with them and would appreciate any help. I've read the JAVA documentation involving HashMap and also searched online for a solution, but I can't quite find what I am looking for. The HashMap has two variables entered into it the name of the employee (The key value), and their randomly generated ID (The value I want to access when the key is entered). I already have a method that adds an employee to the HashMap and randomly generates an ID for them, it works fine and so does the method to remove the employee. I am then supposed to make another method where I would enter a parameter id and that would look for any id's matching it in the HashMap and remove them, then I would make a separate method called generateID to assign a new randomly generated ID to the employee name key.

My issue is that I do not know how I am supposed to type it out so I am referencing the id I want to remove in the method. If I do something like employees.get(id) or employees.get(inputName, id) it says it cannot find the variable inputName and so I don't know how to set it up properly. Below is a snippet of the code I am typed up. It's missing some of the other methods, but they all work fine. The only issue I'm really having is removing/changing the value of the id.

import java.util.Random;
import java.util.HashMap;

private Random randomGenerator = new Random();
private HashMap<String, String> employees;
private String Name;

public Company (String name)
{
employees = new HashMap<>();
Name = name.trim().toUpperCase();
}

public String addEmployee(String inputName)
{
int n = randomGenerator.nextInt(max - min)+min;
String id = String.valueOf(n);
employees.put(inputName, id);
}

public String removeID(String id)
{
employees.remove(id);
return id;
}

public String generateID(String name)
{

}


In Java 7: Iterate over the key set and see what the corresponding values are. Replace the values you want with put().

In Java 8: Use map.forEach() to do essentially the same thing but using a lambda so you get cool points.
 

8byte

Attempted to circumvent ban with alt-account
Banned
Oct 28, 2017
9,880
Kansas
Are there a few people in here who are familiar with the Swift programming language? I've been teaching myself little by little over the last few weeks, and just want to make sure I don't clutter up the thread with inquiries if it's not a big language here. Thanks!
 

ThanksVision

Alt account
Banned
Oct 25, 2017
1,030
can any C monsters help me figure out what I'm doing wrong with my memory allocation ?

I have a struct that holds a char array, among other things.
I first malloc an array of these structs:
Code:
Record* recordList = malloc(numEntries * sizeof(Record));

Then, in a while loop I allocate these entries and their character arrays individually:
Code:
Record* rec = malloc(sizeof(Record);
rec->description = calloc(descLength+1, sizeof(char));

My program is functionally complete and yields the results I want, but now I am trying to free this space to make valgrind happy. I have a clearRecords method:
Code:
clearRecords(Record* recList, uint8_t numEntries) {
    for (int i=0; i<numEntries; i++) {
        free(recList[i].description);
        free(&recList[i]);
    }
    free(recList);
}

I am getting free errors when I run my driver, however, and valgrind doesn't share much. Any tips on how I am supposed to free this correctly?
 

mugurumakensei

Elizabeth, I’m coming to join you!
Member
Oct 25, 2017
11,320
recList already has enough space for the records. You don't need to allocate again.
You create a record structure on the stack and then memcpy into the specific array address. Right now you end up freeing blocks in the middle of the array.
You do need to free each description in your design though.
Basically, loop through free the descriptions. Then free the array. You don't need to free each individual record just the list.
 

MotiD

Member
Oct 26, 2017
1,560
Could anyone help me with this problem?

I'm trying to write a program that compares two arrays with integers and determine if they are the same
The code is not done yet (size is used because I need to choose between an array of size 8 or 10 which I will later add, and count will be used to compare the arrays)

The problem I'm having is

1. for the second array, even tho I'm writing the exact same kind of code as the first one, it lets me input one more number unless I set j<=7
2. I'm getting a 'c stack around variable corrupted' which as I understand means I'm exceeding the size of the array

Also, I'm not sure if the logic of the function even checks out yet ;p

Code:
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int comparearray(int a[], int b[], int size)
{
    int i, j=0, count=0;
    for (i = 0; i < size; i++)
    {
        do {
            if (a[i] != b[j]) {
                j++;
            }
            else if (a[i] == b[j])
            {
                j++;
                count++;
            }
        } while (j <= 8);
        j = 0;
    }
    printf("The count is: %d\n", count);
    return count;
}
int main()
{
    int array[8];
    int array1[8];
    int i, j, k, result, size;
    printf("Please type the size of the array\n");
    scanf("%d", &size);
    printf("First array:\n");
    for (i = 0; i <= 8; i++)
    {
        scanf("%d", &array[i]);
    }
    printf("Second array:\n");
    for (j = 0; j <= 7; j++)
    {
        scanf("%d ", &array1[j]);
    }
    result = comparearray(array, array1, size);

    return 0;
}

Thanks!
 

mugurumakensei

Elizabeth, I’m coming to join you!
Member
Oct 25, 2017
11,320
You've got i <= 8 in one loop with the max index is 7 and j <= 8 in another loop again when the max index is 7.
 

Yoshimitsu126

The Fallen
Nov 11, 2017
14,679
United States
Can I ask Unity questions here? I'm trying to move the player in their 2D UFO tutorial (3 of 9 videos) but the arrow key won't move the ufo.

Here's what isn't the problem:
1. Kinematic is not checked
2. Code is good (imported from the store)
3. Speed is not zero
4. Gravity is zero

My unity version is 2017.4.0f1

Thanks!
 

MotiD

Member
Oct 26, 2017
1,560
You've got i <= 8 in one loop with the max index is 7 and j <= 8 in another loop again when the max index is 7.
Right. Thanks! ><

Edit:

I ran into a problem with my approach, trying to think of a solution for it now, anyone has any bright ideas? ;p

Let's say I have two arrays

First array:
1
2
3
4
5
6
7
8

Second array:
1
2
3
4
5
6
3
8

My program checks the first index of the first array versus the entirety of the second array and adds 1 to the counter if there's a match, then does the same for all the next indexes of the first array. But the problem with my approach is I could have the same number appear a couple of different times in the second array and I'd have no idea of telling if the first array matches the second array.

I thought about creating a third array that does a count for each index individually but that seems like a bit of an overkill? I dunno

'Fixed' code

Code:
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int comparearray(int a[], int b[], int size)
{
    int i, j=0, count=0;
    for (i = 0; i < size; i++)
    {
        do {
            if (a[i] != b[j]) {
                j++;
            }
            else if (a[i] == b[j])
            {
                j++;
                count++;
            }
        } while (j <= 7);
        j = 0;
    }
    printf("The count is: %d\n", count);
    return count;
}
int main()
{
    int array[8];
    int array1[8];
    int i, j, result, size;
    printf("Please type the size of the array\n");
    scanf("%d", &size);
    printf("First array:\n");
    for (i = 0; i <= 7; i++)
    {
        scanf("%d", &array[i]);
    }
    printf("Second array:\n");
    for (j = 0; j <= 7; j++)
    {
        scanf("%d", &array1[j]);
    }
    result = comparearray(array, array1, size);

    return 0;
}
 
Last edited:

ThanksVision

Alt account
Banned
Oct 25, 2017
1,030
recList already has enough space for the records. You don't need to allocate again.
You create a record structure on the stack and then memcpy into the specific array address. Right now you end up freeing blocks in the middle of the array.
You do need to free each description in your design though.
Basically, loop through free the descriptions. Then free the array. You don't need to free each individual record just the list.

Sorry just seeing this--I ended up realizing my mistake soon after posting and was able to fix everything by removing the allocation for individual struct objects as you said... I completely missed the fact that my initial malloc of the array held enough space for every object.

Thanks so much !
 

Zoe

Member
Oct 25, 2017
14,236
I'm trying to write a program that compares two arrays with integers and determine if they are the same

My program checks the first index of the first array versus the entirety of the second array and adds 1 to the counter if there's a match, then does the same for all the next indexes of the first array. But the problem with my approach is I could have the same number appear a couple of different times in the second array and I'd have no idea of telling if the first array matches the second array.

Are you trying to see if the arrays are the same or if they have the same set of numbers? There's a difference.

If the former, then you should be exiting the loop as soon as there's a mismatch. If the latter, then sorting the arrays first would probably be best (assuming you've already learned that).
 

MotiD

Member
Oct 26, 2017
1,560
Are you trying to see if the arrays are the same or if they have the same set of numbers? There's a difference.

If the former, then you should be exiting the loop as soon as there's a mismatch. If the latter, then sorting the arrays first would probably be best (assuming you've already learned that).

I'm trying to see if they have the same set of numbers. They don't have to be in the same sequence or have the same number of appearances, just make sure that both arrays contain the same numbers
So let's say array 1 could be

1,2,3,4,4,5,6,7

array 2 could be

2,1,3,3,4,6,5,7

I'm not sure what you mean by sorting the array, could you elaborate?
 

ThanksVision

Alt account
Banned
Oct 25, 2017
1,030
I'm trying to see if they have the same set of numbers. They don't have to be in the same sequence or have the same number of appearances, just make sure that both arrays contain the same numbers
So let's say array 1 could be

1,2,3,4,4,5,6,7

array 2 could be

2,1,3,3,4,6,5,7

I'm not sure what you mean by sorting the array, could you elaborate?

If you sort the arrays from lowest to highest before comparing them, you'll have an easier time traversing the arrays and won't have to go over the same values more than once.

This way, you should be able to use a single while loop and an iterator for each array. There are only three cases to handle then: if the values are equal, less than, or greater. If the values are less than or greater, all we have to do is increment the corresponding iterator and continue searching for matches, because we know that the arrays are in the correct order.

Code:
while (i and j are less than size of arrays)
  if (a[i] == b[j]) 
    count++;
    i++;
    j++;
  else if(a[i] < b[j]) 
    i++;
  else
    j++;
 

Zoe

Member
Oct 25, 2017
14,236
But if this is an assignment and you guys haven't gone over sorting yet... you may get busted.
 

Theonik

Member
Oct 25, 2017
852
What I would do is first check they are the same size, if not return that they are different then and there. Since this is C/C++ you can use sizeOf assuming an array with the same memory is of same size.
Then for each number in one array check that it exists in the other. Return false in the first mismatch. Return true in the bottom which will be reached if there is no mismatch.
E: Oh since you are only looking for membership ignore the first bit.
 

MotiD

Member
Oct 26, 2017
1,560
If you sort the arrays from lowest to highest before comparing them, you'll have an easier time traversing the arrays and won't have to go over the same values more than once.

This way, you should be able to use a single while loop and an iterator for each array. There are only three cases to handle then: if the values are equal, less than, or greater. If the values are less than or greater, all we have to do is increment the corresponding iterator and continue searching for matches, because we know that the arrays are in the correct order.

Code:
while (i and j are less than size of arrays)
  if (a[i] == b[j])
    count++;
    i++;
    j++;
  else if(a[i] < b[j])
    i++;
  else
    j++;

I actually just asked a friend and she thought of something else but her idea gave me a new one. I don't really care if there's more than one match so I just placed a break statement here

Code:
else if (a[i] == b[j])
           {
               j++;
               count++;
               break;
}

This only solves half the problem tho. If the first array is the one that has the same number multiple times and it doesn't include all the numbers from the second array, I don't have any way of knowing.

I'll look into your method now. Thanks!
 
Last edited:

Megasoum

Member
Oct 25, 2017
22,563
I'm working on a JAVA Homework where we have to create our first GUI with Swing and man... what a fucking pain in the ass.

I can get all four of my JPanels in the window (basically the top one is 4 radio buttons, the second one under it is a text box and a button, the thirst one is a list and the 4th one at the bottom is just a row of buttons)... They are all there but I can't get to resize properly. Right now they just completely fill the window. This is dumb and annoying.


Edit: Right ok... I think I finally got it to work with setPreferredSize but man this is still super clunky
 
Last edited:

Theonik

Member
Oct 25, 2017
852
Swing boilerplare really did my head in. So glad I don't touch the stuff anymore.
Why would anyone teach you Swing over JAVAFX is beyond me.
 

Theonik

Member
Oct 25, 2017
852
JavaFX is almost 10 years old now. lol
In our course we dropped teaching Swing in favour of doing JavaFX some 5 years ago
 

Megasoum

Member
Oct 25, 2017
22,563
I think I finally got my main UI done... That shit is really finicky...

Now I just need to figure out how to actually put my data in a JTable... Making progress!
 

vypek

Member
Oct 25, 2017
12,537
Stopping by for a short rant:

People who merge in breaking changes without noting the breaking changes are incredibly annoying. Especially when there is a documented procedure on how we handle breaking changes. Now I've got to spend a day fixing broken stuff which is going to throw off my hours I'm logging on this project.
 

Antagon

Member
Nov 4, 2017
516
Stopping by for a short rant:

People who merge in breaking changes without noting the breaking changes are incredibly annoying. Especially when there is a documented procedure on how we handle breaking changes. Now I've got to spend a day fixing broken stuff which is going to throw off my hours I'm logging on this project.

Why are they able to do this? You should be able to configure your build systems so that merges to develop are only possible after a successful build.
 

Theonik

Member
Oct 25, 2017
852
Why are they able to do this? You should be able to configure your build systems so that merges to develop are only possible after a successful build.
Problem: You are working on a branch. Team/Person b is working on a different branch and merges breaking changes that affect your branch. The tests and other gates for that build pass because master doesn't break but the changes affect your work. You rebase.

Now you have to spend hours fixing your branch. My worst case for this was I had a branch with upcoming changes that was relying on some internal library functionality. A senior team member decided to refactor the module and removed 'unused functionality' that I was of course using in my branch. Had to basically rewrite the whole thing and re-implement some parts of the old API in the new file.
 

vypek

Member
Oct 25, 2017
12,537
Why are they able to do this? You should be able to configure your build systems so that merges to develop are only possible after a successful build.

Problem: You are working on a branch. Team/Person b is working on a different branch and merges breaking changes that affect your branch. The tests and other gates for that build pass because master doesn't break but the changes affect your work. You rebase.

Antagon it is exactly as Theonik describes. Except more developers besides me have been affected by this so a handful of us have breaking changes for our features we are adding. It wouldn't have been a problem if we were given a heads up at all.
 

kickz

Member
Nov 3, 2017
11,395
Man does scope creep suck, feels like you're in quicksand when the requirements for a project keep changing =\
 

Holtlegna

Member
Oct 27, 2017
45
Code:
void Display()
{
    char flan[SIZE];
    int count = 0;
    pudding.open("beta.txt");
    while (!pudding.eof())
    {
        pudding.getline(flan, SIZE);
        while (flan[count] != '\0')
        {
            cout << flan[count];
            count++;
        }
    }
    pudding.close();
}
So i need help when it comes to outputting a file int a c-string. like it will show the file then get stuck. here is the code that i am using. The file it is reading from is long
 
Oct 28, 2017
10,000
What are the errors? I've never compiled it with any version of VS, but i'm pretty familiar with VS linker and fixing linker errors so maybe it will be something obvious.
WJ2nAQz.png


There's also a lot of warnings but those don't really matter.
 

Contact

Member
Oct 27, 2017
287
Can I ask Unity questions here? I'm trying to move the player in their 2D UFO tutorial (3 of 9 videos) but the arrow key won't move the ufo.

Here's what isn't the problem:
1. Kinematic is not checked
2. Code is good (imported from the store)
3. Speed is not zero
4. Gravity is zero

My unity version is 2017.4.0f1

Thanks!
I dunno how many people here use unity, but you might also want to post that on the indie game development thread on the gaming forum.
 

metaprogram

Member
Oct 28, 2017
1,174
WJ2nAQz.png


There's also a lot of warnings but those don't really matter.

What does your link command line look like? You can show it by going into Tools > Options > Projects and Solutions > Build and Run and setting MSBuild project build output verbosity to the highest setting. Then after you do a build, Ctrl+F in the output window and search for link.exe and you should find the command line.

Can you also paste the declarations of the 3 functions? Just grep your source tree for all header files containing glConfig, GetRefAPI, and GetBotLibAPI (without the leading underscores)
 
Last edited:
Oct 28, 2017
10,000
What does your link command line look like? You can show it by going into Tools > Options > Projects and Solutions > Build and Run and setting MSBuild project build output verbosity to the highest setting. Then after you do a build, Ctrl+F in the output window and search for link.exe and you should find the command line.

Can you also paste the declarations of the 3 functions? Just grep your source tree for glConfig, GetRefAPI, and GetBotLibAPI (without the leading underscores)

1> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\bin\HostX86\x86\link.exe /ERRORREPORT:PROMPT /OUT:".\Debug/quake3.exe" /INCREMENTAL /NOLOGO winmm.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:".\Debug/quake3.pdb" /MAP:".\Debug/quake3.map" /SUBSYSTEM:WINDOWS /STACK:"8388608" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\Debug\quake3.lib" /MACHINE:X86 /SAFESEH win32\winquake.res

1> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Tracker.exe /a /d "C:\Program Files (x86)\MSBuild\15.0\FileTracker\FileTracker32.dll" /i "C:\Users\<UserName Redacted>\Desktop\Quake-III-Arena-master\Quake-III-Arena-master\code\Debug\quake3.tlog" /r "C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\CL_CGAME.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\CL_CIN.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\CL_CONSOLE.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\CL_INPUT.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\CL_KEYS.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\CL_MAIN.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\CL_NET_CHAN.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\CL_PARSE.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\CL_SCRN.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\CL_UI.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\CMD.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\CM_LOAD.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\CM_PATCH.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\CM_POLYLIB.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\CM_TEST.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\CM_TRACE.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\COMMON.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\CVAR.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\FILES.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\HUFFMAN.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\MD4.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\MSG.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\NET_CHAN.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\Q_MATH.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\Q_SHARED.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\SND_ADPCM.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\SND_DMA.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\SND_MEM.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\SND_MIX.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\SND_WAVELET.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\SV_BOT.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\SV_CCMDS.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\SV_CLIENT.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\SV_GAME.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\SV_INIT.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\SV_MAIN.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\SV_NET_CHAN.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\SV_SNAPSHOT.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\SV_WORLD.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\UNZIP.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\VM.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\VM_INTERPRETED.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\VM_X86.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\WIN_INPUT.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\WIN_MAIN.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\WIN_NET.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\WIN_SHARED.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\WIN_SND.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\WIN_SYSCON.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\WIN_WNDPROC.OBJ|C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\WIN32\WINQUAKE.RES" /b MSBuildConsole_CancelEvent82ef8ce74235414c93602b4a0c8a1129 /c "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\bin\HostX86\x86\link.exe" /ERRORREPORT:PROMPT /OUT:".\Debug/quake3.exe" /INCREMENTAL /NOLOGO winmm.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:".\Debug/quake3.pdb" /MAP:".\Debug/quake3.map" /SUBSYSTEM:WINDOWS /STACK:"8388608" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\Debug\quake3.lib" /MACHINE:X86 /SAFESEH win32\winquake.res
Code:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\bin\HostX86\x86\link.exe"

If I understand you right, here.
Code:
/*****************************************************************************
 * name:        cl_cin.c
 *
 * desc:        video and cinematic playback
 *
 * $Archive: /MissionPack/code/client/cl_cin.c $
 *
 * cl_glconfig.hwtype trtypes 3dfx/ragepro need 256x256
 *
 *****************************************************************************/
Code:
extern glconfig_t glConfig;
extern    int        s_paintedtime;
extern    int        s_rawend;
Code:
static void readQuadInfo( byte *qData )
{
    if (currentHandle < 0) return;
    cinTable[currentHandle].xsize    = qData[0]+qData[1]*256;
    cinTable[currentHandle].ysize    = qData[2]+qData[3]*256;
    cinTable[currentHandle].maxsize  = qData[4]+qData[5]*256;
    cinTable[currentHandle].minsize  = qData[6]+qData[7]*256;
 
    cinTable[currentHandle].CIN_HEIGHT = cinTable[currentHandle].ysize;
    cinTable[currentHandle].CIN_WIDTH  = cinTable[currentHandle].xsize;
    cinTable[currentHandle].samplesPerLine = cinTable[currentHandle].CIN_WIDTH*cinTable[currentHandle].samplesPerPixel;
    cinTable[currentHandle].screenDelta = cinTable[currentHandle].CIN_HEIGHT*cinTable[currentHandle].samplesPerLine;
    cinTable[currentHandle].half = qfalse;
    cinTable[currentHandle].smootheddouble = qfalse;
 
    cinTable[currentHandle].VQ0 = cinTable[currentHandle].VQNormal;
    cinTable[currentHandle].VQ1 = cinTable[currentHandle].VQBuffer;
    cinTable[currentHandle].t[0] = (0 - (unsigned int)cin.linbuf)+(unsigned int)cin.linbuf+cinTable[currentHandle].screenDelta;
    cinTable[currentHandle].t[1] = (0 - ((unsigned int)cin.linbuf + cinTable[currentHandle].screenDelta))+(unsigned int)cin.linbuf;
        cinTable[currentHandle].drawX = cinTable[currentHandle].CIN_WIDTH;
        cinTable[currentHandle].drawY = cinTable[currentHandle].CIN_HEIGHT;
  
    // rage pro is very slow at 512 wide textures, voodoo can't do it at all
    if ( glConfig.hardwareType == GLHW_RAGEPRO || glConfig.maxTextureSize <= 256) {
                if (cinTable[currentHandle].drawX>256) {
                        cinTable[currentHandle].drawX = 256;
                }
                if (cinTable[currentHandle].drawY>256) {
                        cinTable[currentHandle].drawY = 256;
                }
        if (cinTable[currentHandle].CIN_WIDTH != 256 || cinTable[currentHandle].CIN_HEIGHT != 256) {
            Com_Printf("HACK: approxmimating cinematic for Rage Pro or Voodoo\n");
        }
    }
#if defined(MACOS_X)
    cinTable[currentHandle].drawX = 256;
    cinTable[currentHandle].drawX = 256;
#endif
}
Code:
if ( glConfig.hardwareType == GLHW_RAGEPRO || glConfig.maxTextureSize <= 256) {

Code:
void CL_InitRef( void ) {
    refimport_t    ri;
    refexport_t    *ret;
    Com_Printf( "----- Initializing Renderer ----\n" );
    ri.Cmd_AddCommand = Cmd_AddCommand;
    ri.Cmd_RemoveCommand = Cmd_RemoveCommand;
    ri.Cmd_Argc = Cmd_Argc;
    ri.Cmd_Argv = Cmd_Argv;
    ri.Cmd_ExecuteText = Cbuf_ExecuteText;
    ri.Printf = CL_RefPrintf;
    ri.Error = Com_Error;
    ri.Milliseconds = CL_ScaledMilliseconds;
    ri.Malloc = CL_RefMalloc;
    ri.Free = Z_Free;
#ifdef HUNK_DEBUG
    ri.Hunk_AllocDebug = Hunk_AllocDebug;
#else
    ri.Hunk_Alloc = Hunk_Alloc;
#endif
    ri.Hunk_AllocateTempMemory = Hunk_AllocateTempMemory;
    ri.Hunk_FreeTempMemory = Hunk_FreeTempMemory;
    ri.CM_DrawDebugSurface = CM_DrawDebugSurface;
    ri.FS_ReadFile = FS_ReadFile;
    ri.FS_FreeFile = FS_FreeFile;
    ri.FS_WriteFile = FS_WriteFile;
    ri.FS_FreeFileList = FS_FreeFileList;
    ri.FS_ListFiles = FS_ListFiles;
    ri.FS_FileIsInPAK = FS_FileIsInPAK;
    ri.FS_FileExists = FS_FileExists;
    ri.Cvar_Get = Cvar_Get;
    ri.Cvar_Set = Cvar_Set;
    // cinematic stuff
    ri.CIN_UploadCinematic = CIN_UploadCinematic;
    ri.CIN_PlayCinematic = CIN_PlayCinematic;
    ri.CIN_RunCinematic = CIN_RunCinematic;
    ret = GetRefAPI( REF_API_VERSION, &ri );
#if defined __USEA3D && defined __A3D_GEOM
    hA3Dg_ExportRenderGeom (ret);
#endif
    Com_Printf( "-------------------------------\n");
    if ( !ret ) {
        Com_Error (ERR_FATAL, "Couldn't initialize refresh" );
    }
    re = *ret;
    // unpause so the cgame definately gets a snapshot and renders a frame
    Cvar_Set( "cl_paused", "0" );
}
Code:
ret = GetRefAPI( REF_API_VERSION, &ri );

Code:
void SV_BotInitBotLib(void) {
    botlib_import_t    botlib_import;
    if ( !Cvar_VariableValue("fs_restrict") && !Sys_CheckCD() ) {
        Com_Error( ERR_NEED_CD, "Game CD not in drive" );
    }
    if (debugpolygons) Z_Free(debugpolygons);
    bot_maxdebugpolys = Cvar_VariableIntegerValue("bot_maxdebugpolys");
    debugpolygons = Z_Malloc(sizeof(bot_debugpoly_t) * bot_maxdebugpolys);
    botlib_import.Print = BotImport_Print;
    botlib_import.Trace = BotImport_Trace;
    botlib_import.EntityTrace = BotImport_EntityTrace;
    botlib_import.PointContents = BotImport_PointContents;
    botlib_import.inPVS = BotImport_inPVS;
    botlib_import.BSPEntityData = BotImport_BSPEntityData;
    botlib_import.BSPModelMinsMaxsOrigin = BotImport_BSPModelMinsMaxsOrigin;
    botlib_import.BotClientCommand = BotClientCommand;
    //memory management
    botlib_import.GetMemory = BotImport_GetMemory;
    botlib_import.FreeMemory = BotImport_FreeMemory;
    botlib_import.AvailableMemory = Z_AvailableMemory;
    botlib_import.HunkAlloc = BotImport_HunkAlloc;
    // file system access
    botlib_import.FS_FOpenFile = FS_FOpenFileByMode;
    botlib_import.FS_Read = FS_Read2;
    botlib_import.FS_Write = FS_Write;
    botlib_import.FS_FCloseFile = FS_FCloseFile;
    botlib_import.FS_Seek = FS_Seek;
    //debug lines
    botlib_import.DebugLineCreate = BotImport_DebugLineCreate;
    botlib_import.DebugLineDelete = BotImport_DebugLineDelete;
    botlib_import.DebugLineShow = BotImport_DebugLineShow;
    //debug polygons
    botlib_import.DebugPolygonCreate = BotImport_DebugPolygonCreate;
    botlib_import.DebugPolygonDelete = BotImport_DebugPolygonDelete;
    botlib_export = (botlib_export_t *)GetBotLibAPI( BOTLIB_API_VERSION, &botlib_import );
    assert(botlib_export);     // bk001129 - somehow we end up with a zero import.
}
Code:
botlib_export = (botlib_export_t *)GetBotLibAPI( BOTLIB_API_VERSION, &botlib_import );
 
Last edited:

metaprogram

Member
Oct 28, 2017
1,174
From the link line, you can see that it's not linking in any quake .lib files. It's only linking these lib files.

winmm.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

So there are two possibilities:

1) GetBotLibAPI, GetRefAPI, and glInit are expected to be defined in some object file which is linked directly into the EXE

2) These 3 things are expected to be defined in some library which is not on the link line for some reason.

Couple of things:
a) Is all of this code you pasted from the file cl_cin.c? Or does some of it come from other files
b) I think you pasted the wrong thing for glConfig; You pasted the extern declaration, but not the definition. And in the spoiler, you pasted a function, not a global variable definition.
c) It looks like you pasted the definitions of the fucntions, but not the declarations. They should be in a header file somewhere with just the signature. For example it may just look like

void CL_InitRef( void );

But I'm curious if there's anything else on the line.

d) Can you paste the output of running dumpbin /symbols "C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\CL_CIN.OBJ" | grep GetBotLibAPI

(If you don't have grep installed on your machine, you can instead upload the entire output to a pastebin)
 
Oct 28, 2017
10,000
From the link line, you can see that it's not linking in any quake .lib files. It's only linking these lib files.
winmm.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
So there are two possibilities:
1) GetBotLibAPI, GetRefAPI, and glInit are expected to be defined in some object file which is linked directly into the EXE
2) These 3 things are expected to be defined in some library which is not on the link line for some reason.
Couple of things:
a) Is all of this code you pasted from the file cl_cin.c? Or does some of it come from other files
b) I think you pasted the wrong thing for glConfig; You pasted the extern declaration, but not the definition. And in the spoiler, you pasted a function, not a global variable definition.
c) It looks like you pasted the definitions of the fucntions, but not the declarations. They should be in a header file somewhere with just the signature. For example it may just look like
void CL_InitRef( void );
But I'm curious if there's anything else on the line.
d) Can you paste the output of running dumpbin /symbols "C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\CL_CIN.OBJ" | grep GetBotLibAPI
(If you don't have grep installed on your machine, you can instead upload the entire output to a pastebin)
When I saw it after you instructed me I though it may be something like that.
1 & 2) Makes sense.
A) The first three are about glConfig come from the class cl_cin.c, GetRefAPI and CLinit_Ref come from the class cl_main.c, and GetBotLibAPI and SV_BotInitBotLib come from the class sv_bot.c
B & C) Yeah I was a little confused by that.
This is all I found in regards to glConfig and I think it's from the OpenGL API.
Located in cg_public.h
Code:
 CG_GETGLCONFIG,
Loacted in client.h
Code:
  glconfig_t    glconfig;
Located in tr_local.h
Code:
extern glconfig_t    glConfig;
...
void        RE_BeginRegistration( glconfig_t *glconfig );
Located in tr_public.h
Code:
    void    (*BeginRegistration)( glconfig_t *config );
Located in tr_types.h
Code:
** glconfig_t
...
} glconfig_t;
Located in ui_public.h
Code:
     UI_GETGLCONFIG,
Located in client.h
Code:
 void CL_InitRef( void );
I couldn't find SV_BotInitBotLib; the closest I could find was in server.h
Code:
SV_BotInitBotLib
d) I tried to install grep for windows and even use the findstr command in place but it didn't display anything. So I used this command dumpbin /symbols "C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\CL_CIN.OBJ". Not sure if it was you want and seemed to have dumped everything, but here. https://pastebin.com/1E6J7TdC
 

Selbran

Member
Oct 25, 2017
1,567
In Java 7: Iterate over the key set and see what the corresponding values are. Replace the values you want with put().

In Java 8: Use map.forEach() to do essentially the same thing but using a lambda so you get cool points.
Hey just wanted to thank you once again for helping me. I kind of struggled with the project all week because I forgot I posted here and then checked your reply. I ended up Google'ing what lambda is and after working through it was able to finish the method as intended.
 

metaprogram

Member
Oct 28, 2017
1,174
When I saw it after you instructed me I though it may be something like that.
1 & 2) Makes sense.
A) The first three are about glConfig come from the class cl_cin.c, GetRefAPI and CLinit_Ref come from the class cl_main.c, and GetBotLibAPI and SV_BotInitBotLib come from the class sv_bot.c
B & C) Yeah I was a little confused by that.
This is all I found in regards to glConfig and I think it's from the OpenGL API.
Located in cg_public.h
Code:
 CG_GETGLCONFIG,
Loacted in client.h
Code:
  glconfig_t    glconfig;
Located in tr_local.h
Code:
extern glconfig_t    glConfig;
...
void        RE_BeginRegistration( glconfig_t *glconfig );
Located in tr_public.h
Code:
    void    (*BeginRegistration)( glconfig_t *config );
Located in tr_types.h
Code:
** glconfig_t
...
} glconfig_t;
Located in ui_public.h
Code:
     UI_GETGLCONFIG,
Located in client.h
Code:
 void CL_InitRef( void );
I couldn't find SV_BotInitBotLib; the closest I could find was in server.h
Code:
SV_BotInitBotLib
d) I tried to install grep for windows and even use the findstr command in place but it didn't display anything. So I used this command dumpbin /symbols "C:\USERS\<UserName Redacted>\DESKTOP\QUAKE-III-ARENA-MASTER\QUAKE-III-ARENA-MASTER\CODE\DEBUG\CL_CIN.OBJ". Not sure if it was you want and seemed to have dumped everything, but here. https://pastebin.com/1E6J7TdC

Yea sorry can you do the same for cl_main.obj and sv_bot.obj? If glMain is from opengl and the other two aren't in cl_cin.obj either then that won't have anything useful

Also, CL_InitRef and that SV_ function are both fine and not the problem, so don't worry about those

Edit: Wait do you mean to say CL_InitRef is in the same .c file as GetRefAPI? Is this file on the internet somewhere?
 
Last edited:
Oct 28, 2017
10,000
Yea sorry can you do the same for cl_main.obj and sv_bot.obj? If glMain is from opengl and the other two aren't in cl_cin.obj either then that won't have anything useful

Also, CL_InitRef and that SV_ function are both fine and not the problem, so don't worry about those

Edit: Wait do you mean to say CL_InitRef is in the same .c file as GetRefAPI? Is this file on the internet somewhere?

It's fine you're helping me, dumping is relatively easy. Here, you go. cl_main.obj dump https://pastebin.com/iF7UPaaX sv-bot.obj https://pastebin.com/7VucXs6L

Oh sorry about that, I think it's my bad but yes, what I'm trying to compile is Quake III Arena from id-Software on Github, here I'll fetch the links real quick.

Here is the general Git. https://github.com/id-Software/Quake-III-Arena

To get there go to the link -> code -> client -> cl_main.c.

Here is the specific class on Github. https://github.com/id-Software/Quake-III-Arena/blob/master/code/client/cl_main.c
 

Narumi

Member
Oct 25, 2017
253
Hi, need some advice on Octave.

How do I construct a Hull White tree for Pricing Options? I'm at a loss and I don't even know how to start. The option I'm pricing involves a Zt state variable (that follows a Ornstein Uhlenbeck process) and the payoff function is as follow:

Ik6jLrv.png


Ultimately I'm suppose to figure out a payoff for when te=2, so I only require Z2. Even then, how do I derive Z2?

Also, the risk neutral mean EQ, is it correct that the way to implement this is to assign probabilities pu, pd and pm to the function contained within EQ?

Many thanks.
 

metaprogram

Member
Oct 28, 2017
1,174
It's fine you're helping me, dumping is relatively easy. Here, you go. cl_main.obj dump https://pastebin.com/iF7UPaaX sv-bot.obj https://pastebin.com/7VucXs6L

Oh sorry about that, I think it's my bad but yes, what I'm trying to compile is Quake III Arena from id-Software on Github, here I'll fetch the links real quick.

Here is the general Git. https://github.com/id-Software/Quake-III-Arena

To get there go to the link -> code -> client -> cl_main.c.

Here is the specific class on Github. https://github.com/id-Software/Quake-III-Arena/blob/master/code/client/cl_main.c

Ok so the first problem is that GetRefAPI isn't actually in cl_main.c. What is in cl_main.c is this:

Code:
ret = GetRefAPI( REF_API_VERSION, &ri );

That is just a call to the function. What we need is the definition of the function. I searched the GitHub, and it shows up in various places. For example, in tr_public.h we have this:

Code:
refexport_t*GetRefAPI( int apiVersion, refimport_t *rimp );

But that is not a definition, that is a declaration. A declaration just says "hey there's a function called GetRefAPI and here's the signature. You can call it, but since I don't have the code for it, the linker is going to have to figure this out."

A definition is where the code actually occurs. That is in code/renderer/tr_init.c. Which you can see here:

Code:
refexport_t *GetRefAPI ( int apiVersion, refimport_t *rimp ) {
  static refexport_t re;
  ...
}

What this means is that the important object file is going to be tr_init.obj. For any given symbol (function, variable, etc) exactly one object file should contain a symbol for it. That's what I was getting at with the dumpbin commands. I was trying to see "does this object file have the right symbol?" If it does, and the name is correct, you won't get an unresolved external.

So when diagnosing this kind of thing, you have to ask:

1) Which object file contains the definition
2) Is that object file being linked in
3) If not, why not? If so, why isn't the name matching?

So now that we know it should be in tr_init.obj we go back and look at the link line again. This time we're looking for tr_init.obj. And we see, it is nowhere to be found.

So this brings us to #3 above. The proper object file is not being linked in, and we need to know why.

I went to the top level of the GitHub repo and saw that there is a quake3.vcproj file. I opened it up in GitHub (not in VS), and Ctrl+F'ed for tr_init.c found that this project does not even compile this file. So it needs to be coming from somewhere else. Probably it's compiled in a different file and then supposed to be linked in to the final project. So I opened the .sln instead and saw that there is another project called renderer/renderer.vcproj and sure enough, this is the project that compiles tr_init.c.

So now we have a clue. quake3.vcproj is supposed to be linking in the files from renderer.vcproj, but it isn't. How is it supposed to link them in? Well, in renderer.vcproj we see this line:

Code:
OutputFile=".\Debug_TA\renderer.lib"

So we can tell that it is supposed to be outputting a file named renderer.lib, and presumably this file is supposed to be linked into the final executable. Remember one of the first observations I made when I looked at the link line was that there are no quake-specific libraries.

So to fix it. The first thing to check is: Did you open quake3.sln or did you open quake3.vcproj? If it's the latter, that's the problem. Open the .sln file instead. However, I suspect you are already opening the .sln file.

This could be an issue with such an old version of the MSVC project file format not fully forwards-compatible with the new version, so when it tries to upgrade, information is lost. The reason I suspect this is because I don't see anything in any of the project files or solution files to indicate that quake3.exe (from quake3.vcproj) should try to link renderer.lib (from renderer.vcproj).

If you just want to test this theory out, go into quake3.vcproj, edit project settings, go to Linker and find Additional Input files then add a full absolute path to renderer.lib on your hard drive.

I suspect the errors will go away. If you want to do it the "right" way, probably in the solution file you need to add a dependency from quake3.vcproj to renderer.vcproj, and then in the Configuration Properties > Linker > General for the quake3 project, make sure "Link Library Dependencies" is set to Yes