HI about command Require

Previous topic - Next topic

mentalthink

HI today I restart my learnig of c++, because I like complement gLBasic whit C++, but I stay stagnant in my first probes.
Well, I try to make the example of the Help of Glbasic whitout succes  :(

I put my code, is very simple, the .cpp file maded on Dev c++ and the Glbasic code.

Thanks,
Iván J.

Dev C++ Code
Code (glbasic) Select
//PRUEBA PARA GLBASIC CON C++
// test1.cpp
//#include "glb.h"


// test1.cpp
#include "glb.h"
int suma();
int main(){
   
return 0;   
}
int suma(){
    int a; int b;
    a=10;
    b=100;
    return (a+b);   
}



This are the Warnings on Dev C++
8 C:\Users\mentalthink\Documents\DEV\GLBASICCPP.cpp In file included from C:\Users\mentalthink\Documents\DEV\GLBASICCPP.cpp
61:1 C:\Users\mentalthink\Documents\DEV\glb.h [Warning] "__stdcall" redefined
77:1 C:\Users\mentalthink\Documents\DEV\<built-in> [Warning] this is the location of the previous definition


gLBAsic Code:
Code (glbasic) Select
// --------------------------------- //
// Project: CPP
// Start: Wednesday, September 08, 2010
// IDE Version: 8.085


//SETCURRENTDIR("Media") // seperate media and binaries?

REQUIRE "GLBASICCPP.cpp"

IMPORT int suma()

suma()


Another question what I have about Require command, it´s I don´t know because occurs, is:

When a make the Require Command, and don´t have error, in example I dont call the function on gLbasic, if I put a (while/wend) bucle, no make nothing the program, I don´t know because don´t make the while true, likes own Require annul the rest of code .

Best Regards, and thanks for your time

Iván Jimenez.