简体   繁体   中英

Linker error in release mode only in Xcode C++ Project

I'm working on a project in C++ in Xcode, and it compiles and runs absolutely fine in debug mode. I'm now trying to get it working in release mode, and it's coming up with many linker errors that come down to one particular library (the netcdf library I'm using, to be exact). The errors have the form:

  "NcVar::num_atts() const", referenced from:
      getScaling(NcVar*, double&, double&)in NetCDFHandler.o

where NetCDFHandler is my file (and getScaling is my function). I've had a look at the Build Settings for Debug and Release, and made sure that 'Other Linker Flats', 'Header Search Paths' and 'Library Search Paths' are all the same in both. The only things that remain different are things that should remain different (such as optimisation level, and per configuration build products path).

does anyone have any ideas where things could be going wrong?

Thanks in advance!

------FURTHER INFO------

The linker warning xcode throws up immediately before the first error is:

ld: warning: in /Developer/SDKs/MacOSX10.6.sdk/usr/local/lib/libnetcdf_c++.dylib, file was built for unsupported file format which is not the architecture being linked (i386)

Try to clean if that doesn't help try to se if it is double of imports in your files. Last try is to check on build phase in your project to se if it it correct.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM