-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Failed to compile when a piece of code include #pkgconfig
#23064
Comments
Did you try |
Yes, I did it also emit the same error. |
Same here, but next give me results: $ pkg-config --modversion zlib
1.2.11
$ pkg-config --libs zlib
-lz |
In my system
Guess |
But |
I think |
C versionThis is a small TCL interpreter called from C named # include <tcl.h>
int AppInit(Tcl_Interp *interp) {
if (Tcl_Init(interp) == TCL_ERROR)
return TCL_ERROR;
Tcl_SetVar(interp, "tcl_rcFileName", "~/.wishrc", TCL_GLOBAL_ONLY);
return TCL_OK;
}
int main(int argc, char *argv[]) {
Tcl_Main(argc, argv, AppInit);
return 0;
} With my installation mentioned before compiles with $ gcc tclsh.c -o tclsh -ltcl8.6 And run and the interpreter is functional (I entered a sum of numbers 1 and 2): $ ./tclsh
% expr {1+2}
3
% V versionNow this is my attemp to convert to V called module main
#pkgconfig --libs --cflags tcl
#include <tcl.h>
fn C.Tcl_Main(argc int, argv &&char, init &voidptr)
//@[typedef]
struct C.Tcl_Interp{}
fn C.Tcl_Init(interp &C.Tcl_Interp) int
fn C.Tcl_SetVar(&C.Tcl_Interp, &char, &char, int)
fn app_init(interp &C.Tcl_Interp) int {
if C.Tcl_Init(interp) == C.TCL_ERROR {
return C.TCL_ERROR
}
C.Tcl_SetVar(interp, c'tcl_rcFileName', c'~/.wishrc', C.TCL_GLOBAL_ONLY)
return C.TCL_OK
}
fn main() {
C.Tcl_Main(0, g_main_argv, app_init)
} #pkgconfig is accepted BUT it doesn't work. With
With
Help wanted. |
After some Also I think doing |
Since I installed Linux on my mac so let me try, @jorgeluismireles you since pretty interest in tcl/tk, why not make a tcl/tk wrapper together? |
I did work on linux maybe their is some env problem on macos |
Any way @jorgeluismireles I will create a new github repo you are welcome to contribute! |
Thanks, you could open a discussion and in there share ideas and findings. |
Here is the github repo link: |
Please try again with latest V. I've added more brew folders that are searched for .pc files.
|
Fixed: |
Describe the bug
I write a simple piece of code to make a c wrapper for tcl/tk
Code:
The
#pkgconfig
line can't findzlib
Full error
I found out that the standard
pkg-config
return none whenpkg-config --cflags zlib
Reproduction Steps
Write a piece of code that included
#pkgconfig
Expected Behavior
It should successfully compile and have zero problems.
Current Behavior
Currently, the V compile emit a error says:
error: could not resolve dependency zlib
Possible Solution
I think there is some problem in the
vlib.pkgconfig
that did not handle the case that is not defined or filter out in the.pc
files.Additional Information/Context
error with
zlib
V version
Current V version: V 0.4.8 b103ce3, timestamp: 2024-12-04 14:11:21 +0200
Environment details (OS name and version, etc.)
Macbook Air M2 (2022)
8 GB of RAM
MacOs Version: Sonoma 14.1.1
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
Huly®: V_0.6-21504
The text was updated successfully, but these errors were encountered: