Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't make Hello World on latest commit #53

Open
Yoti opened this issue Dec 18, 2019 · 7 comments
Open

Can't make Hello World on latest commit #53

Yoti opened this issue Dec 18, 2019 · 7 comments

Comments

@Yoti
Copy link

Yoti commented Dec 18, 2019

Bash:

git clone https://github.com/vitasdk/samples
cd samples/hello_world
make

Error:

mkdir -p out/./
arm-vita-eabi-gcc -c -Wl,-q -I../common -o out/main.o src/main.c
arm-vita-eabi-g++ -Wl,-q -std=c++11 -I../common out/main.o -lSceDisplay_stub -o vita_sample.elf
/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/9.1.0/../../../../arm-vita-eabi/bin/ld: out/main.o: in function `main':
main.c:(.text+0xa): undefined reference to `psvDebugScreenInit'
/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/9.1.0/../../../../arm-vita-eabi/bin/ld: main.c:(.text+0x16): undefined reference to `psvDebugScreenPrintf'
collect2: error: ld returned 1 exit status
Makefile:50: recipe for target 'vita_sample.elf' failed
make: *** [vita_sample.elf] Error 1
@No-User
Copy link

No-User commented Apr 15, 2020

Try using cmake . before make

@Yoti
Copy link
Author

Yoti commented Apr 15, 2020

@No-User cmake works, make using makefile won't.

@yne
Copy link
Contributor

yne commented Apr 15, 2020

that's because debugScreen is now a new object file
ded5780#diff-40ca84316d1604ae66b8676544118b83

can you try putting the CMake line ../common/debugScreen.c before the main one ?
No idea why putting the main.c before the debugScreen.c one would fail tho.

@Yoti
Copy link
Author

Yoti commented May 16, 2020

@yne
cmake works without any issues. Makefile won't.

@yne
Copy link
Contributor

yne commented May 16, 2020

That's because the only job of CMake is to create a Makefile.
(why would we keep things simple when we can make them complicated huh).

And apparently it does not do it well.

So can you try something like this in your CMakelist.txt :

add_executable(${PROJECT_NAME}
  debugScreen.c
  src/main.c
)

or maybe

add_executable(${PROJECT_NAME}
  ../common/debugScreen.c
  src/main.c
)

@Yoti
Copy link
Author

Yoti commented May 17, 2020

@yne
I'm using already existed makefile. It works on previous commit.

@yne
Copy link
Contributor

yne commented May 17, 2020

Oh okay I thought you were using the cmake .. && make command
In this case I guess, the ../common/debugScreen.c shall be added to this line

But I still don't understand why does this folder have both a Makefile+CMakelist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants