Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
first code won't run
#11
I hope it's okay to dig this thread out, as I'm encountering follow-up issues after adding pthread to the library names in the Visual GDB settings (maybe that's the problem?). Here's the output from VS:

Code:
1>------ Build started: Project: Project1, Configuration: Debug Win32 ------
1>VisualGDB: Sending 6 updated source files to build machine...
1>VisualGDB: Run "make  CONFIG=Debug" in directory "/tmp/VisualGDB/c/Dev/GameProgrammingPi/Project1" on pi@192.168.0.104 (SSH)
1>mkdir Debug
1>g++ -ggdb -ffunction-sections -O0  -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads/ -Iopt/vc/include/interface/ -Iopt/vc/include/interface/vmcs_host/linux -DDEBUG=1  -c main.cpp -o Debug/main.o -MD -MF Debug/main.dep
1>g++ -o Debug/Project1 -Wl,-gc-sections   -L/opt/vc/lib/ -Wl,--start-group Debug/main.o -lGLESv2_static -lEGL_static -lvchiq_arm -lvcos -lkhrn_static -lpthread  -Wl,--rpath='$ORIGIN'   -Wl,--end-group
1>Debug/main.o: In function `init_ogl(Target_State*, int, int)':
1>C:\Dev\GameProgrammingPi\Project1\main.cpp(216): error : undefined reference to `vc_dispmanx_display_open'
1>C:\Dev\GameProgrammingPi\Project1\main.cpp(217): error : undefined reference to `vc_dispmanx_update_start'
1>C:\Dev\GameProgrammingPi\Project1\main.cpp(234): error : undefined reference to `vc_dispmanx_element_add'
1>C:\Dev\GameProgrammingPi\Project1\main.cpp(239): error : undefined reference to `vc_dispmanx_update_submit_sync'
1>Debug/main.o: In function `main':
1>C:\Dev\GameProgrammingPi\Project1\main.cpp(325): error : undefined reference to `bcm_host_init'
1>/opt/vc/lib//libEGL_static.a(khrn_client_platform_linux.c.o): In function `platform_get_dimensions':
1>khrn_client_platform_linux.c : error : undefined reference to `vc_dispmanx_display_open'
1>khrn_client_platform_linux.c : error : undefined reference to `vc_dispmanx_display_get_info'
1>khrn_client_platform_linux.c : error : undefined reference to `vc_dispmanx_update_start'
1>khrn_client_platform_linux.c : error : undefined reference to `vc_dispmanx_display_open'
1>khrn_client_platform_linux.c : error : undefined reference to `vc_dispmanx_display_get_info'
1>khrn_client_platform_linux.c : error : undefined reference to `vc_dispmanx_update_start'
1>khrn_client_platform_linux.c : error : undefined reference to `vc_dispmanx_element_add'
1>khrn_client_platform_linux.c : error : undefined reference to `vc_dispmanx_update_submit_sync'
1>/opt/vc/lib//libEGL_static.a(khrn_client_platform_linux.c.o): In function `platform_get_handle':
1>khrn_client_platform_linux.c : error : undefined reference to `vc_dispmanx_display_open'
1>khrn_client_platform_linux.c : error : undefined reference to `vc_dispmanx_display_get_info'
1>khrn_client_platform_linux.c : error : undefined reference to `vc_dispmanx_update_start'
1>khrn_client_platform_linux.c : error : undefined reference to `vc_dispmanx_display_open'
1>khrn_client_platform_linux.c : error : undefined reference to `vc_dispmanx_display_get_info'
1>khrn_client_platform_linux.c : error : undefined reference to `vc_dispmanx_update_start'
1>khrn_client_platform_linux.c : error : undefined reference to `vc_dispmanx_element_add'
1>khrn_client_platform_linux.c : error : undefined reference to `vc_dispmanx_update_submit_sync'
1>collect2 : error : ld returned 1 exit status
1>Makefile:138: recipe for target 'Debug/Project1' failed
1>make: *** [Debug/Project1] Error 1
1>-------------------------------------------------------------
1>Command exited with code 2
1>Executable: make
1>Arguments:  CONFIG=Debug
1>Directory: /tmp/VisualGDB/c/Dev/GameProgrammingPi/Project1
1>VisualGDB : error : Command-line action failed
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command ""C:\Program Files (x86)\Sysprogs\VisualGDB\\VisualGDB.exe" /build "C:\Dev\GameProgrammingPi\Project1\Project1.vcxproj" "/solution:C:\Dev\GameProgrammingPi\GameProgrammingPi.sln"  "/config:Debug" "/platform:Win32"" exited with code 1.
1>Done building project "Project1.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

So there are errors regarding everything that starts with "vc_dispmanx_..." and then there's "C:\Dev\GameProgrammingPi\Project1\main.cpp(325): error : undefined reference to `bcm_host_init'" ... I'm completely clueless with Linux, so I could use a hint about what goes wrong here.

Using Visual Studio 2017. The "Hello World" text program already worked.

Thank you in advance!


EDIT:
Okay, I solved it, I thought that all I had to enter in the library names were those:
  • GLESv2_static 
  • EGL_static 
  • vchiq_arm 
  • vcos 
  • khrn_static 
  • pthread
But that's not all of it, because I forgot to add bcm_host, so the whole thing now looks like this: 

[Image: rT9m0KG.png]

And after that, I finally saw the triangle in all its glory! Smile
Reply
#12
Great to hear you fixed it.

Well done
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's 



Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)