-
-
Notifications
You must be signed in to change notification settings - Fork 365
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
multiple definition error for CORS middleware #390
Comments
@dranikpg It seems the CORS middleware isn't designed to work with multiple source files, I'll try to look into it but I'd be thankful for help. |
I had yesterday the same issue. My solution was to write "inline" before the functions-impementations and it worked for me. inline CORSRules& CORSRules::prefix(const std::string& prefix)
|
The issue is that the declaration and definitions for |
I mean that Inside the class a declaration is considered to be inline by the compiler. If you implement outside of body, but still in header, you have to mark the method as 'inline' explicitly. struct CORSRules
{
/// Handle CORS for specific blueprint
CORSRules& blueprint(const Blueprint& bp);
}
inline CORSRules& CORSRules::blueprint(const Blueprint& bp)
{
return handler_->blueprint(bp);
} |
Sorry for the late response. I must have missed this when refactoring them out of the class. |
Can't not build in linking parse cause multiple definition.
linker log :
It was build in gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
I use MSBuild c++ cross platform compile.
crow version is v1.0+1 Hotfix
The text was updated successfully, but these errors were encountered: