Forums
first code won't run - Printable Version

+- Forums (http://www.scratchpadgames.net/forums)
+-- Forum: Main Forums (http://www.scratchpadgames.net/forums/forumdisplay.php?fid=1)
+--- Forum: Help my code won't work?? (http://www.scratchpadgames.net/forums/forumdisplay.php?fid=22)
+--- Thread: first code won't run (/showthread.php?tid=44)

Pages: 1 2


first code won't run - pahendriks - 03-14-2018

Hi,

I bought your e-book last week in Holland. I'm a guy who used to code on the Commodore Amiga in the nineties. I created a pacman clone in assembler. See https://www.youtube.com/watch?v=nsgAFKIdlJ4 for my creation which I finished in 1992.

So I started with your book ands bought the Raspberry Pi (I think 1 day before the 3B+ was released). So I have an 3B. And Yesterday also a new release of the linux distri was released. So I was a little bit too early...

I managed to update the pi and it worked ok. The hello World program worked fine.

After typing in the source for 'my first triangle' I had some type errors but it seemed ok finally. I ran the program and nothing happened. So I read that I had to update the library settings as mentioned here: http://www.scratchpadgames.net/DownLoad.html

But after that my code does not run after these changes. I get some errors which I can not solve.

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets
The command ""C:\Program Files (x86)\Sysprogs\VisualGDB\\VisualGDB.exe" /build "C:\Users\Patrick\source\repos\GameProject1B\GameProject1B\GameProject1B.vcxproj" "/solution:C:\Users\Patrick\source\repos\GameProject1B\GameProject1B.sln" "/configBig Grinebug" "/platform:Win32"" exited with code 1.

C:\Users\Patrick\source\repos\GameProject1B\GameProject1B\collect2
ld returned 1 exit status

C:\Users\Patrick\source\repos\GameProject1B\GameProject1B\VisualGDB
Command-line action failed

Can you help me solve these errors?


Best regards from Holland!

Patrick


RE: first code won't run - Brian Beuken - 03-14-2018

Hi Patrick,

so this is your hello triangle project failing to build? Im not sure I can locate the problem from those errors, but I will do my best for you.
Is it possible you could zip up the directory with all your code, and mail it to me I will try to locate the error.

I have not tested the code in the brand new version of Raspbian (released due to the new 3B+) so I will also try that just to make sure there's nothing strange going on.

brian@scratchpadgames.net

B


RE: first code won't run - Brian Beuken - 03-14-2018

I just tested my hello triangle code with the very latest distro and it works fine, also with old and new libs on an upgraded distro SD, again works fine.
Most likely there is a typo somewhere in your make file created by your project properties, since it does not seem to be getting as far as a build.

if you can zip up your dir (excluding Debug/Release/obj  and VisualGDBCache dirs)  I can take a look at it 1st thing tomorrow and hopefully spot the error.

my email is brian@scratchpadgames.net


RE: first code won't run - pahendriks - 03-15-2018

(03-14-2018, 11:36 PM)Brian Beuken Wrote: I just tested my hello triangle code with the very latest distro and it works fine, also with old and new libs on an upgraded distro SD, again works fine.
Most likely there is a typo somewhere in your make file created by your project properties, since it does not seem to be getting as far as a build.

if you can zip up your dir (excluding Debug/Release/obj  and VisualGDBCache dirs)  I can take a look at it 1st thing tomorrow and hopefully spot the error.

my email is brian@scratchpadgames.net

I will zip and mail. Thanks!

Patrick


RE: first code won't run - Brian Beuken - 03-15-2018

Thanks Patrick

ok i got it, with the new later distro, you have to include the pthread library as well, it wasn't needed with the older Jessie version of Raspbian but the new libs do insist on it.

If you just add pthread your code builds and runs just fine I didn't add that in my little warning on the download page, I will change that tonight when I can edit the website.

Thanks for finding this, its annoying that updates to the OS cause these kinds of niggles but that's why the site is here to keep things up to date. I'll add pthread to the list of files needed. And this post will let people know of this error


RE: first code won't run - Brian Beuken - 03-15-2018

Oh and for future reference, the VS error list is sometimes too concise and does not give a lot of info on the errors, much better to switch your tab view to the output, which would give a more easy to follow error (well easy for some Big Grin)

1>VisualGDB: Run "make CONFIG=Debug" in directory "/tmp/VisualGDB/c/Users/beuken/Desktop/openglesprojects/GameProject1/GameProject1" on pi@192.168.0.100 (SSH)
1>g++ -ggdb -ffunction-sections -O0 -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface -I/opt/vc/include/interface/vmcs_host/linux -DDEBUG=1 -c GameProject1.cpp -o Debug/GameProject1.o -MD -MF Debug/GameProject1.dep
1>g++ -o Debug/GameProject1 -Wl,-gc-sections -L/opt/vc/lib -Wl,--start-group Debug/GameProject1.o -lGLESv2_static -lEGL_static -lvchiq_arm -lvcos -lkhrn_static -lbcm_host -Wl,--rpath='$ORIGIN' -Wl,--end-group
1>/usr/bin/ld: /opt/vc/lib/libEGL_static.a(khrn_client_platform_linux.c.o)(0): error : undefined reference to symbol 'pthread_getspecific@@GLIBC_2.4'
1>//lib/arm-linux-gnueabihf/libpthread.so.0: error adding symbols: DSO missing from command line
1>collect2 : error : ld returned 1 exit status
1>Makefile:138: recipe for target 'Debug/GameProject1' failed
1>make: *** [Debug/GameProject1] Error 1

here I was able to read a more complex error and noticed that pthread was at fault. The errors don't always make sense but they give more information that can lead to the cause.


RE: first code won't run - pahendriks - 03-15-2018

(03-15-2018, 08:40 AM)Brian Beuken Wrote: Thanks Patrick

ok i got it, with the new later distro, you have to include the pthread library as well, it wasn't needed with the older Jessie version of Raspbian but the new libs do insist on it.

If you just add pthread your code builds and runs just fine I didn't add that in my little warning on the download page, I will change that tonight when I can edit the website.

Thanks for finding this, its annoying that updates to the OS cause these kinds of niggles but that's why the site is here to keep things up to date. I'll add pthread to the list of files needed. And this post will let people know of this error

Yes, now it also works here in Holland! But you have to be focused as it only shows the triangle for a short time. So I changed 200 in line 215 to 2000.

Next step!


RE: first code won't run - Brian Beuken - 03-15-2018

yes its only on for a short time so you don't get too bored with it, its not very inspiring Big Grin

But it is your 1st program, typed in by yourself and all your typo's fixed, so thats a great step. Gefeliciteerd!


RE: first code won't run - pahendriks - 03-15-2018

(03-15-2018, 03:28 PM)Brian Beuken Wrote: yes its only on for a short time so you don't get too bored with it, its not very inspiring Big Grin

But it is your 1st program, typed in by yourself and all your typo's fixed, so thats a great step. Gefeliciteerd!

After 2 hours of typing and 2 hours of searching for typos I thought 2 seconds of fireworks would be al little too short for al this work I have done. Wink

Do you have relatives in Holland als your name is really Dutch and you know even a dutch word (or was google translate your best friend)?


RE: first code won't run - Brian Beuken - 03-15-2018

True, but getting a proper triangle up and running is a great achievement

Though I am Scottish I am from a Dutch family, my great Grandfather was Dutch, from Limburg and moved with family to Scotland before ww1 and established a very large family. Changing our name from van den Beucken to Beuken. (we still have the van den but we don't use it) By the time my generation came around we were properly Scottish and no one spoke Dutch, so I sadly don't even pronounce my own name correctly Big Grin

Ironically I now live and work here in Netherlands myself. in Breda, and though I don't speak dutch well, I do (sometimes) understand it and am trying to improve.