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

Code not compilable #7

Open
raiken-mf opened this issue Jan 6, 2021 · 3 comments
Open

Code not compilable #7

raiken-mf opened this issue Jan 6, 2021 · 3 comments

Comments

@raiken-mf
Copy link

raiken-mf commented Jan 6, 2021

Using the mingw32-make Version GNU Make 3.82.90

gcc -o account_add account_add.o -L src/mysql/lib -llibmysql md5.o
cp account_add.exe ./install/login
process_begin: CreateProcess(NULL, cp account_add.exe ./install/login, ...) failed.
make (e=2): The system cannot find the file specified.
makefile:33: recipe for target 'account_add' failed
mingw32-make: *** [account_add] Error 2

When removing account_add from makefile:

gcc -c -I src/md5/include -I src/mysql/include -I src/prs src/login_server/login_server.c
src/login_server/login_server.c: In function 'main':
src/login_server/login_server.c:5125:11: error: redeclaration of 'ch' with no linkage
  unsigned ch;
           ^~
src/login_server/login_server.c:5062:11: note: previous declaration of 'ch' was here
  unsigned ch,ch2;
           ^~
src/login_server/login_server.c:5127:8: error: redeclaration of 'fp' with no linkage
  FILE* fp;
        ^~
src/login_server/login_server.c:5073:8: note: previous declaration of 'fp' was here
  FILE* fp;
        ^~
makefile:71: recipe for target 'login_server.o' failed
mingw32-make: *** [login_server.o] Error 1
@gatchi
Copy link
Owner

gatchi commented Jan 7, 2021

That's weird. It's saying it can't find account_add.exe even tho it was just made? Or did gcc silently fail? What does the working directory look like after make is run?

@raiken-mf
Copy link
Author

raiken-mf commented Jan 10, 2021

Sorry for the late response.
Here's a screenshot of the working dir.

I reverted the changes to makefile and tried to compile it again. Same as 1st error message. And yes, account_add.exe was successfully created somehow. Maybe... the size of the exe is 54 kb, it didn't copy the executable to the login dir though. There's still an executable with size 72 kb.

But that's not the important executable.
root

It seems the makefile has not the correct syntax for windows. Maybe if I try to compile it using git bash console.

@raiken-mf
Copy link
Author

Trying to compile it using git bash results into the following:

gcc -o account_add account_add.o -L src/mysql/lib -llibmysql md5.o
cp account_add.exe ./install/login
gcc -c -I src/md5/include -I src/mysql/include -I src/prs src/login_server/login_server.c
src/login_server/login_server.c: In function 'main':
src/login_server/login_server.c:5125:11: error: redeclaration of 'ch' with no linkage
  unsigned ch;
           ^~
src/login_server/login_server.c:5062:11: note: previous declaration of 'ch' was here
  unsigned ch,ch2;
           ^~
src/login_server/login_server.c:5127:8: error: redeclaration of 'fp' with no linkage
  FILE* fp;
        ^~
src/login_server/login_server.c:5073:8: note: previous declaration of 'fp' was here
  FILE* fp;
        ^~
makefile:71: recipe for target 'login_server.o' failed
mingw32-make: *** [login_server.o] Error 1

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

2 participants