Skip to content
New issue

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

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

Already on GitHub? # to your account

Hint: Escape double quotes when defining MALLOB_BASE_DIRECTORY #1

Open
faultlin3 opened this issue Jun 11, 2021 · 0 comments
Open

Hint: Escape double quotes when defining MALLOB_BASE_DIRECTORY #1

faultlin3 opened this issue Jun 11, 2021 · 0 comments

Comments

@faultlin3
Copy link

Hi,

When defining MALLOB_BASE_DIRECTORY, the quotes need to be escaped for the MacroExpansion to work. (Probably the shell removing quotes?)
Example (fail):
> make MALLOB_BASE_DIRECTORY='"/tmp"'

g++ -DMALLOB_BASE_DIRECTORY="/tmp" -c -std=c++17 src/mallob_ipasir.cpp -Isrc
src/mallob_ipasir.hpp: In constructor ‘MallobIpasir::MallobIpasir()’:
<command-line>: error: expected primary-expression before ‘/’ token
src/mallob_ipasir.hpp:38:24: note: in expansion of macro ‘MALLOB_BASE_DIRECTORY’
   38 |         _api_directory(MALLOB_BASE_DIRECTORY + std::string("/.api/jobs.") + MALLOB_API_INDEX + std::string("/")),
      |                        ^~~~~~~~~~~~~~~~~~~~~
<command-line>: error: ‘tmp’ was not declared in this scope; did you mean ‘tm’?
src/mallob_ipasir.hpp:38:24: note: in expansion of macro ‘MALLOB_BASE_DIRECTORY’
   38 |         _api_directory(MALLOB_BASE_DIRECTORY + std::string("/.api/jobs.") + MALLOB_API_INDEX + std::string("/")),
      |                        ^~~~~~~~~~~~~~~~~~~~~
make: *** [makefile:7: mallob_ipasir.o] Error 1

Example (works):
make MALLOB_BASE_DIRECTORY='\"/tmp\"'

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

No branches or pull requests

1 participant