Malkverbena / mysql

MySQL connector to Godot Engine.
59 stars 7 forks source link

Error when compiling : error C3861: 'register_mysql_types' : identifier not found #7

Closed romssprogrammer closed 3 years ago

romssprogrammer commented 3 years ago

Hi Malkverbena first of all thank you very much for your work on this module you save my life for my project. i am trying to compile but i have this error:

cmdCap2 do you have an idea of what kind of solution can be found?

Malkverbena commented 3 years ago

@romssprogrammer Sorry for take so long to answer. I was offline :) Are you still experiencing this problem?

romssprogrammer commented 3 years ago

Hello Malkverbena no worries i understand :) thank for answer me back.

yeah still facing this problem and i have the second one already face by others

cmdCap I think my Scub is done correctly cmdCap4

what i have finally done for my project is to create a webService Rest in java to communicate with mysql using httprequest node

would be interesting to understand why compiling doesn't work :)

nice job anyway

Malkverbena commented 3 years ago

A friend of mine did this tutorial. It's in portuguese but you can use translated subtitles. You will find a good explanation there.

https://www.youtube.com/watch?v=ohGP-q_Na9g

romssprogrammer commented 3 years ago

yes i watch it and follow it step by step :) good tutorial !! but i will try again and i will tell you !

Malkverbena commented 3 years ago

@romssprogrammer This error is because the compiler cannot find the path to the file. In the worst case, copy the required files with the extension .h to the Mysql module directory and it will work. But I strongly recommend to solve the issue related to the path on SCsub.

Malkverbena commented 3 years ago

@romssprogrammer Could you please show me your files register_types.h andregister_types.cpp? I'll start t investigate it thi week.

Malkverbena commented 3 years ago

Note that register_mysql_types must be register_MySQL_types.

romssprogrammer commented 3 years ago

Hello here is the screenshot register

Malkverbena commented 3 years ago

@romssprogrammer Could you try compile again the master branch? I did some modifications on SCsub. I don't a machine with the MS Windows right now to test it.

romssprogrammer commented 3 years ago

hello as you ask i tried again but sill have the same error:

[Initial build] Compiling ==> modules\MySQL\MySQL.cpp MySQL.cpp C:\godot1\modules\MySQL\MySQL.h(7): fatal error C1083: Impossible d'ouvrir le fichier include : 'mysql_error.h' : No such file or directory scons: *** [modules\MySQL\MySQL.windows.tools.64.obj] Error 2 scons: building terminated because of errors.

Malkverbena commented 3 years ago

@romssprogrammer Please, reopen this issue

Malkverbena commented 3 years ago

@romssprogrammer I guess the godot compiler should be able to find all mysql headers now.
Could you please try again with the modification I did on scsub file? Don't forget to use the 1.x branch. About thefisrt issue, I can't reproduce it at all. Could you provide a copy of your module folder?

romssprogrammer commented 3 years ago

Hi thank for keeping searching the issue
here the result 08062021

Malkverbena commented 3 years ago

@romssprogrammer Try again. I did some changes on MySQL.h

romssprogrammer commented 3 years ago

Hi thank for keeping searching the issue
here the result

romssprogrammer commented 3 years ago

here the result 09062021

Malkverbena commented 3 years ago

@romssprogrammer I've been baffled by this error. But I noticed that in branch 4.0 this file no longer exists. I still have no idea of the requirements for compiling on the 4.0 branch after this changes. But as soon as possible I have my answers I will update my repository. You should be able to compile to the 3.x branch without any problems.

romssprogrammer commented 3 years ago

Thank for letting me know i will keep follow your work

Le mer. 16 juin 2021 à 20:06, Cleber Alves @.***> a écrit :

@romssprogrammer https://github.com/romssprogrammer I've been baffled by this error. But I noticed that in branch 4.0 this file no longer exists. I still have no idea of the requirements for compiling on the 4.0 branch after this changes. But as soon as possible I have my answers I will update my repository.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Malkverbena/MySQL_Module/issues/7#issuecomment-862597265, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOPY55D7I57XM745MWHMZ33TTDRYVANCNFSM42HI2C7Q .

-- romain baste Storyboarder and 2d animator based in paris

Animation reel :https://vimeo.com/340008998

Portfolio http://romssbook.blogspot.com/

@.***

Malkverbena commented 3 years ago

@romssprogrammer I guess I figured out how fix it. Could you try to compile again?

romssprogrammer commented 3 years ago

Hello sorry for late answer. i get this name error

shellgodot

I think i didn't miss something in the Scsubscript :

!/usr/bin/env python

SCsub

Enter with path to Boost library here

boost_path= "C:/boost"

Enter with the path to jdbc here (mysql_connection.h & mysql_driver.h)

include_path= "C:/mysql-connector-c++-8.0.23-winx64/include/jdbc"

Enter with the path to mysql libs here (mysqlcppconn.lib)

lib_path= "C:/mysql-connector-c++-8.0.23-winx64/lib64/vs14"

--------------------------------------------------------------------------

version_file = open('../../version.py', 'r') for ver in version_file: if ver.startswith("major"): if ver.count("4") > 0: mysql_env.Append(CPPDEFINES=["GODOT4"]) version_file.close()

--------------------------------------------------------------------------

import shutil Import("env") env.add_source_files(env.modules_sources,"*.cpp")

if env["platform"] in ["windows", "UWP"]: target_lib = "" target_lib_arr = [] env.Append(CPPPATH=[include_path, boost_path]) env.Append(LIBPATH=[lib_path]) mysql_env = env.Clone() mysql_env['LIBS'] = []

sufix = env["PROGSUFFIX"]
target_lib="mysqlcppconn"
sufix = sufix[0:-3]
mysql_env.Append(CPPFLAGS =["-I" + include_path, "-L " + lib_path])
target_lib_arr = [target_lib]   # TODO: More libs are expected for static compilling (ssl, crypto e etc...)

# copy libs
for i in target_lib_arr:
    source = lib_path + "/" + i + ".lib"
    destination = lib_path + "/" + i + sufix + "lib"
    shutil.copy2(source, destination)

env.Append(LIBS=target_lib_arr)

elif env["platform"] in ["linuxbsd", "linux", "bsd", "X11", "Server"]: module_env = env.Clone() mysql_env['LIBS'] = [] module_env.Append(CXXFLAGS=['-O2', '-std=c++11']) env.Append(LIBPATH=['/usr/lib']) env.Append(LIBS=['mysqlcppconn'])

Malkverbena commented 3 years ago

The flags '-O2' and '-std=c++11' should not be used. Delete this line.

Malkverbena commented 3 years ago

Try the last update I did.

romssprogrammer commented 3 years ago

Hello i tried again the same thing happen with master branch 1.x

Le sam. 26 juin 2021 à 15:34, Cleber Alves @.***> a écrit :

Try the last update I did.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Malkverbena/MySQL_Module/issues/7#issuecomment-869003105, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOPY55AGZPL2WGQ7YKONOTDTUXJPRANCNFSM42HI2C7Q .

-- romain baste Storyboarder and 2d animator based in paris

Animation reel :https://vimeo.com/340008998

Portfolio http://romssbook.blogspot.com/

@.***

Malkverbena commented 3 years ago

@romssprogrammer Could we talk on Discord? I would like to understand what's going on. I can't reproduce the errors you get at all.

romssprogrammer commented 3 years ago

Hello Malkverbena sorry for the late answer it's because i have to show my application in front of a jury i have to deploy my application on heroku for the date of July 20 and i am struggling. i will find a time to speak with you i soon as possible.

Malkverbena commented 3 years ago

That's fine. I can't reproduce the issue,so it's hard to figure out what is going on. When you get time we can debug it.

romssprogrammer commented 3 years ago

Okay no problem see you soon.

Le sam. 17 juil. 2021 à 22:54, Cleber Alves @.***> a écrit :

That's fine. I can't reproduce the issue,so it's hard to figure out what is going on. When you get time we can debug it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Malkverbena/MySQL_Module/issues/7#issuecomment-881958758, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOPY55AVDX37TXI5I3A4ZX3TYHUZJANCNFSM42HI2C7Q .

-- romain baste Storyboarder and 2d animator based in paris

Animation reel :https://vimeo.com/340008998

Portfolio http://romssbook.blogspot.com/

@.***