Am trying to build a c program in netbeans on mac osx 10.7.5 and am getting the following error. I am not sure what is going on. I am trying to learn c.
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
nbproject/Makefile-Debug.mk:73: warning: overriding commands for target `build/Debug/GNU-MacOSX/UnsortedList.o'
nbproject/Makefile-Debug.mk:68: warning: ignoring old commands for target `build/Debug/GNU-MacOSX/UnsortedList.o'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-MacOSX/cs350_lab6_linkedlist
nbproject/Makefile-Debug.mk:73: warning: overriding commands for target `build/Debug/GNU-MacOSX/UnsortedList.o'
nbproject/Makefile-Debug.mk:68: warning: ignoring old commands for target `build/Debug/GNU-MacOSX/UnsortedList.o'
mkdir -p dist/Debug/GNU-MacOSX
gcc -o dist/Debug/GNU-MacOSX/cs350_lab6_linkedlist build/Debug/GNU-MacOSX/UnsortedList.o build/Debug/GNU-MacOSX/UnsortedList.o build/Debug/GNU-MacOSX/main.o
ld: warning: ignoring file build/Debug/GNU-MacOSX/UnsortedList.o, file was built for unsupported file format which is not the architecture being linked (x86_64)
ld: warning: ignoring file build/Debug/GNU-MacOSX/UnsortedList.o, file was built for unsupported file format which is not the architecture being linked (x86_64)
Undefined symbols for architecture x86_64:
"_CreateList", referenced from:
_main in main.o
"_InsertItem", referenced from:
_main in main.o
"_DeleteItem", referenced from:
_main in main.o
"_PrintList", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-MacOSX/cs350_lab6_linkedlist] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 71ms)
If i put all the methods definitions in the main file instead of writing separately in implementation file, then it's building fine and showing no error.
Related
I am trying to install and run OpenMPI on VSCode using this tutorial https://medium.com/#li.nguyen_15905/setting-up-vscode-for-mpi-programming-b6665da6b4ad
When I "Run build task" to compile the Hello.c file I receive this error:
(`Executing task: C/C++: mpicc build active file <
Starting build...
/Users/mohamad/opt/usr/local/bin/mpicc -g /Users/mohamad/opt/usr/local/bin/helloworld/.vscode/hello.c -o /Users/mohamad/opt/usr/local/bin/helloworld/.vscode/hello
ld: warning: ignoring file /Users/mohamad/opt/usr/local/lib/libmpi.dylib, **building for macOS-x86_64 but attempting to link with file built for macOS-arm64**
Undefined symbols for architecture x86_64:
"_MPI_Comm_rank", referenced from:
_main in hello-c829ad.o
"_MPI_Comm_size", referenced from:
_main in hello-c829ad.o
"_MPI_Finalize", referenced from:
_main in hello-c829ad.o
"_MPI_Get_processor_name", referenced from:
_main in hello-c829ad.o
"_MPI_Init", referenced from:
_main in hello-c829ad.o
"_ompi_mpi_comm_world", referenced from:
_main in hello-c829ad.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Build finished with error(s).
The terminal process failed to launch (exit code: -1).`)
Running the command mpirun -np 2 hello gives:
mpirun was unable to find the specified executable file, and therefore
did not launch the job. This error was first reported for process
rank 0; it may have occurred for other processes as well.
NOTE: A common cause for this error is misspelling a mpirun command
line parameter option (remember that mpirun interprets the first
unrecognized command line token as the executable).
Node: Mohamads-MBP
Executable: hello
--------------------------------------------------------------------------
2 total processes failed to start
Any suggestions that could resolve this issue?
Note: All configuration settings used are included in the link.
I am stuck with this error:
mpif90 -o /Users/manfredo/Desktop/ED2/ED/build/ed_2.1-opt edmain.o -L/opt/local/lib/libgcc/ -lstdc++ -I/Users/manfredo/Desktop/ED2/ED/src/include -I/opt/local/include /Users/manfredo/Desktop/ED2/ED/build/ed_2.1-opt.a -lm -lz -L/opt/local/lib -lhdf5 -lhdf5_fortran
Undefined symbols for architecture x86_64:
"_calchydrosubsurface_", referenced from:
_ed_model_ in ed_2.1-opt.a(ed_model.o)
...
other similar errors
...
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[1]: *** [/Users/manfredo/Desktop/ED2/ED/build/ed_2.1-opt] Error 1
make: *** [all] Error 2
I have tried adding -stdlib=libstdc++ or including the libraries lstdc++ or lstc++.6 as suggested here or here and I had already posted a question about the same error but still not able to fix it.
The compilation with mpif is needed. Any help will be appreciated.
I've downloaded the latest release of libzip and am currently trying to build it on OSX and failing:
Linking C shared library libzip.dylib
Undefined symbols for architecture x86_64:
"_crc32", referenced from:
__zip_filerange_crc in zip_filerange_crc.o
_crc_read in zip_source_crc.o
_decrypt in zip_source_pkware.o
__zip_string_crc32 in zip_string.o
(maybe you meant: __zip_string_crc32)
"_deflate", referenced from:
_compress_read in zip_source_deflate.o
(maybe you meant: _zip_source_deflate)
"_deflateEnd", referenced from:
_deflate_compress in zip_source_deflate.o
"_deflateInit2_", referenced from:
_deflate_compress in zip_source_deflate.o
"_inflate", referenced from:
_decompress_read in zip_source_deflate.o
"_inflateEnd", referenced from:
_deflate_decompress in zip_source_deflate.o
"_inflateInit2_", referenced from:
_deflate_decompress in zip_source_deflate.o
"_zError", referenced from:
__zip_error_strerror in zip_error_strerror.o
_zip_error_to_str in zip_error_to_str.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [libzip.3.0.dylib] Error 1
make[2]: *** [CMakeFiles/zip.dir/all] Error 2
make[1]: *** [CMakeFiles/zip.dir/rule] Error 2
make: *** [zip] Error 2
It needs a crc32 function but it doesn't include one nor does it seem to link to anything else. Has anyone been able to build libzip on OSX 10.9?
You seem to be missing to link a against libz.
Get the developer files for zlib somewhere and add -lz to the (end of the command line of the) link command.
I am currently trying to install rng-tools on OSX, as I have a specific need for it to speed up a certain simulator that I am currently using. At first, I faced the problem of not having argp, so I installed argp-standalone from Homebrew. However, I still receive the following error message when trying to make rng-tools:
gcc -g -O2 -o rngtest stats.o rngtest.o librngd.a
Undefined symbols for architecture x86_64:
"_argp_parse", referenced from:
_main in rngtest.o
"_argp_usage", referenced from:
_parse_opt in rngtest.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[2]: *** [rngtest] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
I checked /usr/local/include/argp.h and it does seem to contain the correct function definitions referenced in rngtest.c, so any thoughts on what might be the problem?
I just needed rngtest which I managed to compile on OSX using this https://github.com/fproulx/rngtest (which also needs brew install argp-standalone). I made that into a homebrew formula which can be obtained here: https://github.com/oderwat/homebrew-experiments
My environment:
OS: OSX ML 10.8.5
VIM: 7.4
GCC: 4.2.1 (Apple LLVM version 5.0)
GDB: GNU gdb 6.3.50-20050815
I want to debugging in VIM with C programming language. After I seached Google, I found Clewn, but when I make it, it returned the following messages.
make all-recursive
Making all in .
gcc -DHAVE_CLEWN -g -O2 -Wall -o clewn clewn.o gdb_lvl2.o gdb_lvl3.o misc.o netbeans.o obstack.o pty.o -lreadline -lcurses
Undefined symbols for architecture x86_64:
"_ding", referenced from:
_clewn_beep in misc.o
"_rl_getc", referenced from:
_cli_getc in clewn.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [clewn] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Excuse for my English, hope you know what I means. And thank you so much!!!
I haven't used clewn since around 2007–2008 and never on OS X, but you could try the following to at least get it to compile.
"_ding", referenced from:
_clewn_beep in misc.o
Simply comment out the body of the clewn_beep function. At least for now.
"_rl_getc", referenced from:
_cli_getc in clewn.o
Try replacing the call to rl_getc in clewn.c with a call to cli_getc and see if that works.
I also had to add the following line in clewn.c to get it to compile (OS X 10.8.5):
extern int rl_done;