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

LDPL is telling me that an external variable is already defined (Windows/MSYS2) #176

Closed
ahribellah opened this issue Mar 16, 2020 · 7 comments

Comments

@ahribellah
Copy link

ahribellah commented Mar 16, 2020

So, the whiptail command fails in MSYS2 (and I've not been able to find a way to install it) and dialog isn't working as a replacement, but LDPL built out of the box in MSYS2's MinGW64 terminal (meaning the one that builds native Windows executables without the MSYS DLL dependency).

I built the fibonacci example and it worked. So I tried building the C++ extension example and I got the following error:

ldpl -i=hello.cpp -o=hello hello.ldpl
* Loading hello.ldpl
* Compiling hello.ldpl
* Including C++ extension hello.cpp
* Building hello
In file included from hello.ldpl:12:
hello.cpp:4:13: error: conflicting declaration 'std::string MY_NAME'
    4 | std::string MY_NAME;
      |             ^~~~~~~
ldpl-temp.cpp:902:15: note: previous declaration as 'chText MY_NAME'
  902 | extern chText MY_NAME;
      |               ^~~~~~~
LDPL Error: compilation failed.
make: *** [Makefile:4: test] Error 1

I'm assuming this is a Windows-specific error.

I also seem to be having issues with lpm that are probably related.

ari@DESKTOP-1ER5E33 MINGW64 /d/code/github/ldpl/examples/cpp-extension
$ lpm install ldpl_socket
The syntax of the command is incorrect.
Searching package 'ldpl_socket'...
Downloading package 'ldpl_socket'...
The system cannot find the path specified.
Package 'ldpl_socket' downloaded.
Copying files...
The system cannot find the path specified.
Adding package to local package list...
Package 'ldpl_socket' installed successfully

Is there a way to see what path it's talking about or why it says the syntax of the command is incorrect?

I read on Reddit that Windows support is in the works, but I'm assuming it's not finished yet? I figured I'd give it a shot anyways. At the very least, LDPL is compiling and it's able to compile lpm and examples without extensions without errors.

@Lartu
Copy link
Owner

Lartu commented Mar 21, 2020

Hi there! Sorry for the late reply. I wouldn't depend on the C++ example, I think it's a little old and outdated. I will try to build it myself later, but I don't expect it to work.

Windows isn't really a supported platform. It was at one point, then it wasn't, then it was again, and for the most time it hasn't been anymore. LPM does not work on windows, but you can download the libraries by hand (they are linked in README.md). Sorry for this and thank you for submitting an issue!

@Lartu
Copy link
Owner

Lartu commented Mar 21, 2020

That said, everything should work fine with MinGW but it's not really supported.

@saper
Copy link
Contributor

saper commented Apr 18, 2020

@arabelladonna can you post a file generated by

 ldpl -r -i=hello.cpp -o=hello hello.ldpl

somewhere?

It should contain the line https://gist.github.com/saper/be135ce816ceb594893479989ed83843#file-hello-generated-cpp-L20

#define ldpl_text chText

@saper
Copy link
Contributor

saper commented Apr 18, 2020

Also, does this help?

diff --git a/examples/cpp-extension/hello.cpp b/examples/cpp-extension/hello.cpp
index 144f90a..a4c490e 100644
--- a/examples/cpp-extension/hello.cpp
+++ b/examples/cpp-extension/hello.cpp
@@ -2,7 +2,7 @@
 #include <string>
 #include "../../src/ldpl.h"
 
-ldpl_text MY_NAME;
+chText MY_NAME;
 
 void HELLO()
 {
@@ -12,4 +12,4 @@ void HELLO()
 void GREET()
 {
     std::cout << "Salutations, " << MY_NAME << "!" << std::endl;
-}
\ No newline at end of file
+}

@Lartu
Copy link
Owner

Lartu commented Apr 18, 2020

I haven't been able to replicate this error on Linux, so I guess it must be a Windows error. Is anyone here able to test it on Windows?

@xvxx
Copy link
Collaborator

xvxx commented Apr 18, 2020

@arabelladonna @saper I updated the C++ example to fix the chText issue in #177, please git pull and try that again. Thank you!

@Lartu
Copy link
Owner

Lartu commented Apr 18, 2020

Oh! I can see the problem! Thank you so much @xvxx !

@Lartu Lartu closed this as completed Jun 17, 2020
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

4 participants