Jump to content

  • Log In with Google      Sign In   
  • Create Account

Solid_Spy

Member Since 26 Nov 2012
Offline Last Active Oct 14 2014 09:17 AM

Posts I've Made

In Topic: Help! I cannot run makefiles with commands D:!

03 October 2014 - 05:24 AM

UPDATE:

 

Well, I reinstalled MSYS, and this time installed it into the right directory, and now I get these errors when trying to compile the Lua libraries:

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:\Users\NULL>cd C:\Users\NULL\Downloads\lua-5.2.3

C:\Users\NULL\Downloads\lua-5.2.3>make
Please do 'make PLATFORM' where PLATFORM is one of these:
   aix ansi bsd freebsd generic linux macosx mingw posix solaris
See doc/readme.html for complete instructions.

C:\Users\NULL\Downloads\lua-5.2.3>make mingw
cd src && make mingw
make[1]: Entering directory `/c/Users/NULL/Downloads/lua-5.2.3/src'
make[1]: *** No rule to make target `mingw'.  Stop.
make[1]: Leaving directory `/c/Users/NULL/Downloads/lua-5.2.3/src'
make: *** [mingw] Error 2

C:\Users\NULL\Downloads\lua-5.2.3>mingw32-make
Please do 'make PLATFORM' where PLATFORM is one of these:
   aix ansi bsd freebsd generic linux macosx mingw posix solaris
See doc/readme.html for complete instructions.

C:\Users\NULL\Downloads\lua-5.2.3>mingw32-make mingw
cd src && mingw32-make mingw
mingw32-make[1]: Entering directory 'c:/Users/NULL/Downloads/lua-5.2.3/src'
mingw32-make[1]: *** No rule to make target 'mingw'.  Stop.
mingw32-make[1]: Leaving directory 'c:/Users/NULL/Downloads/lua-5.2.3/src'
Makefile:55: recipe for target 'mingw' failed
mingw32-make: *** [mingw] Error 2

C:\Users\NULL\Downloads\lua-5.2.3>

In Topic: Help! I cannot run makefiles with commands D:!

03 October 2014 - 04:57 AM

Strange. On my machine it compiles without any problems. What distribution of MinGW do you use? The "/usr/bin/sh" part looks like Cygwin to me. If it is I can't really help you as I never used it before.

I used the version that was provided in the download link on the main website, I don't know how to check the version. I downloaded the installer, and even updated it. I'm pretty sure i'm using MinGW. I checked the files.

 

I just wish someone would show me a step by step guide on how to run a simple makefile, like the Lua makefile. I know how to build code using g++ -o XXX commands, but this stuff is a bit more advanced.

 

Or better yet, I would like to know why I am getting this error.


In Topic: Help! I cannot run makefiles with commands D:!

02 October 2014 - 11:49 PM

You need to run make (or mingw32-make as it is called in the MinGW destribution I use) in the directory that contains the Makefile. In this case this would be the "lua-5.2.3" folder (for some reason you have 2 or these, there should be only one after unzipping the archive).

 

btw: make mingw tells make to build a target called "mingw" so that's not going to work. ;)

That's what I was doing.. I went into the proper directory, and ran make.exe by entering make.d i'll try it with mingw32-make.

 

EDIT: It didn't work :/. Even when I changed the files.

 

here is my code:

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:\Users\NULL>cd C:\Users\NULL\Downloads\lua-5.2.3.tar\lua-5.2.3\lua-5.2.3

C:\Users\NULL\Downloads\lua-5.2.3.tar\lua-5.2.3\lua-5.2.3>mingw32-make
Please do 'make PLATFORM' where PLATFORM is one of these:
   aix ansi bsd freebsd generic linux macosx mingw posix solaris
See doc/readme.html for complete instructions.

C:\Users\NULL\Downloads\lua-5.2.3.tar\lua-5.2.3\lua-5.2.3>mingw32-make mingw
cd src && mingw32-make mingw
      0 [main] sh 3780 sync_with_child: child 11864(0x164) died before initializ
ation with status code 0xC0000142
    147 [main] sh 3780 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
Makefile:55: recipe for target 'mingw' failed
mingw32-make: *** [mingw] Error 128

C:\Users\NULL\Downloads\lua-5.2.3.tar\lua-5.2.3\lua-5.2.3>

In Topic: simple 3d question

02 October 2014 - 12:03 AM

 

@Alvaro Did it as you said … is this correct,will it do the job... :

bool IsManInFrontofDish( vector3& manPos, vector3& manFacingDirection, vector3& dishPos ) {
double magnitude1 = sqrt( dot(manPos, manPos)  ) ; 
double magnitude2 =  sqrt( dot(dishPos,dishPos)  ) ;
double dotProduct =  dot(manPos,dishPos);
double cosValue = dotProduct/ (magnitude1*magnitude2)

if(cosValue > .9) return true
 return false;  
}

It looks like you didn't even use the manFacingDirection, or compute the direction from the dishPos to the manPos. Just find the direction of both objects, and don't forget to normalize, then perform a dot product, and check if it is close to -1.


In Topic: passing data between objects using messages... wat do?

01 October 2014 - 11:36 PM

Messages are fine.  Components are fine.  What you're actually talking about is "binding", or specifically the difference between late and early/static binding.

 

Early binding, which occurs when you normally use a variable in C++, is a completely waste of a messaging system

 

Late binding is typically better introduced with a pair of different features: named variables which you likely already have with your message system, and introspection.  These together effectively allows the ability to find and interact with a variable at runtime.  Lots of more modern languages feature introspection as a first-class feature, but C++ doesn't fall in that category.  Adding introspection however is a pretty easy thing to add via macros, and doesn't result in a clunky battery of "handle message" functions with everyone passing around either function handles or pointers to internal state.

 

Not going to bother telling you to switch to a language that features introspection if what you want it introspection, there are a lot of C++ libraries out there are facilitate the introduction of introspection/reflection.

 

Named lookup + introspection = everything you're asking for.

Ah, ok I see now. I was just researching introspection and realized that that is what Unity uses. I was considering using Introspection, but just didn't know how to use it in c++. I wouldn't mind using it if I can find a way to make it work in c++, maybe boost has a library?

 

Yeah Introspection would definitly solve my problem. I will look into that more. Thanks for the help!


PARTNERS